|
stark62 Wanderer
Joined: 04 Apr 2003 Posts: 94 Location: United Kingdom
|
Posted: 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 |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 |
|
|
|
stark62 Wanderer
Joined: 04 Apr 2003 Posts: 94 Location: United Kingdom
|
Posted: Wed Dec 30, 2009 11:26 pm |
awesome thanks
|
|
|
|
|
|