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
stark62
Wanderer


Joined: 04 Apr 2003
Posts: 94
Location: United Kingdom

PostPosted: Wed Dec 30, 2009 3:11 pm   

some sort of list or string routine
 
Ok not sure how to do this but am sure its not that difficult.
Ok i need something to store some items
so lets say i have a list/string that is a|b|c|d|e

what i want to do is have a command that says something like

use a (next time its used) use b (next time) use c (next) used d (next) use e
then the next time i use the alias it goes back to start of list to - use a etc

does that make sense

an alias that runs through a list in order then starts again - i wish to make a few of these lists so the simpler the better
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Dec 30, 2009 5:26 pm   
 
#VARIABLE CycleList {%exec( %1 = %additem( %item( @%1, 1), @%1))%pop( %1)}

You might need to change #VARIABLE to #FUNCTION, but it works properly for me as it is written. Use it like so:

names = "tom|dick|harry"
@CycleList(names)

When you upgrade to CMud, you'll want to use CMud functions and rewrite this (I'm not sure if the cmud parser will parse #varfunc functions like ZMud does, so things like @%1 might not come out right.)
_________________
EDIT: I didn't like my old signature
Reply with quote
stark62
Wanderer


Joined: 04 Apr 2003
Posts: 94
Location: United Kingdom

PostPosted: Wed Dec 30, 2009 11:26 pm   
 
awesome thanks
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