About Us
Products
Purchase
Downloads
Support
Forums
Contact Us
Site
 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
Noodles
Beginner


Joined: 03 Mar 2004
Posts: 12
Location: USA

PostPosted: Fri Mar 19, 2004 8:56 am   

Stringlist / Expanding Variables
 
Is there a way to expand variables in a stringlist? I've spent the better part of 2 hours reading help's / faq's / and testing.... It's late here, can someone point it out so I can smack my forehead and say "DOH!"

ex.
#VAR ATTACKMOVES {@flyingkick|@barefists|@leadpipe}
#1 {%item( @ATTACKMOVES, %random( 1, 3))}
I tried " " { } [ ] ( ) < > and varied combos.

Laugh at me if it is simple, laugh at me if it can't be done :)

Thankyou again in advance :)
Noodles
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Fri Mar 19, 2004 10:50 am   
 
What you have there, #VAR ATTACKMOVES {@flyingkick|@barefists|@leadpipe} should work. it should expand the variables automatically and set @Attackmoves properly.
Reply with quote
Serentus
Apprentice


Joined: 28 Sep 2001
Posts: 103
Location: USA

PostPosted: Fri Mar 19, 2004 11:01 am   
 
If your wanting to send it to the mud you could try
#EXEC {%item(@AttackMoves,%random(1,3))}

other wise try %exec(), %expand() may also be helpful.
Reply with quote
Noodles
Beginner


Joined: 03 Mar 2004
Posts: 12
Location: USA

PostPosted: Fri Mar 19, 2004 11:45 am   
 
Wonderful, thanks, exactly what I needed. :)
Noodles
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Fri Mar 19, 2004 11:45 am   
 
If don't want the variables to be expanded before you select one of the three variables at random, and then expand them, you could try this:

#1 %eval(@%item( {flyingkick|barefists|leadpipe}, 3))
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