Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Neros
Newbie


Joined: 03 Jun 2003
Posts: 6
Location: Denmark

PostPosted: Sun Aug 31, 2003 4:32 pm   

Using a . after a variable
 
Hello.

Sometimes when I am bounty hunting I need to go though more of the same type of mob in the same room. I'm trying to make an alias that does this. This is what I've done.

#ALIAS lm {
#VAR i %2
#WHILE (@i <> 0) {
look @i .%1
#add i -1
}
}

If I type lm owl 3, this will be the output.

look 3 .owl
look 2 .owl
look 1 .owl

I need to have it output the following

look 3.owl
look 2.owl
look 1.owl

But how do I more the . without the variable i thinking that it's suddenly an array variable?
Reply with quote
Neros
Newbie


Joined: 03 Jun 2003
Posts: 6
Location: Denmark

PostPosted: Sun Aug 31, 2003 5:12 pm   
 
Typical. After a few hours looking and trying to figure it out, you post your problem. A little while after you solve it yourself.

I made it work this way, and it's even shorter.
#ALIAS lm {#LOOP %2 {look %{i}.%1}}

command ex.
lm owl 3
will output
look 1.owl
look 2.owl
look 3.owl
Reply with quote
Loto
Apprentice


Joined: 05 May 2003
Posts: 194

PostPosted: Sun Aug 31, 2003 5:12 pm   
 
I <i>think</i> ths will work...

#ALIAS lm {
#VAR i %2
#WHILE (@i <> 0) {
look @{i}.%1
#add i -1
}
}


Edit: Oh, I see you got yer problem done... Lol. You postedit whie I was typing my answer
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net