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
ron2777
Newbie


Joined: 06 Mar 2002
Posts: 2
Location: USA

PostPosted: Wed Mar 06, 2002 5:54 am   

zmud 4.62 variable
 
i still use 4.62 cause i learn with it, too lazy to mess with the new ones
but have a little question about the variable
#4 drink water, is you drink 5 times
but what if you store the 4 in a var like count
#var count 4
i know to get the 4 out, you need use @count
then how do you make it able to do
#4 drink water by using the @count, or is there a way.

anyone can help pls tell me, thanks!

Ron
Reply with quote
iljhar
GURU


Joined: 10 Oct 2000
Posts: 1116
Location: USA

PostPosted: Wed Mar 06, 2002 8:41 am   
 
I don't have 4.62, but have you tried using [] or <> to expand the variables?

#[@count] {drink water}
#<@count> {drink water}

Iljhar
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Mar 06, 2002 1:33 pm   
 
Also, check to see if 4.62 has a #REPEAT command, because this would help in this case.

Kjata
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Mar 06, 2002 3:00 pm   
 
Try the obvious first:
#@count drink water
If that doesn't work, try expanding the variable as per Iljhar's response. Next, check out YOUR helpfiles to see what commands you have that are designed for repeating things, such as #REPEAT or #LOOP as per Kjata's response.

If all the easy ways fail, write a script to do it.
#ALIAS repeat {#IF (@count > 0) {#ADD count -1;%-1;repeat %-1}}
There, a nice freeze-the-computer type alias


LightBulb
All scripts untested unless otherwise noted
Reply with quote
ron2777
Newbie


Joined: 06 Mar 2002
Posts: 2
Location: USA

PostPosted: Wed Mar 06, 2002 10:18 pm   
 
Thanks for everyones help
i solve the problem by
#loo @count drink water
using loop to repeat it


Thanks!

Ron
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