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


Joined: 26 Oct 2004
Posts: 1

PostPosted: Tue Oct 26, 2004 3:04 pm   

Help with pickin' an item in a stringlist.
 
I wish to do the following with an F-Key:

current name, list: name anothername yetanothername null null null

i hit the F-Key

current anothername, list: name anothername yetanothername null null null

i hit the F-Key

current yetanothername, list: name anothername yetanothername null null null

i hit the F-Key

current name, list: name anothername yetanothername null null null

It's possible?
Reply with quote
Mortis
Beginner


Joined: 10 Feb 2004
Posts: 21
Location: Sweden

PostPosted: Tue Oct 26, 2004 5:14 pm   
 
#VAR List {First|Second|Third}
#VAR Current {First}

#key F12 {#IF (%ismember( @Current, @List)=%numitems( @List)) {#VARIABLE Current %item( @List, 1)} {#VARIABLE Current %item( @List, %eval( %ismember( @Current, @List)+1))}}


Copy/paste and press enter. It doesnt echo when you press F12 but it works.
If you want it to echo just put #SAY @Current last in the macro.

Make sure you set Current to the first element in the list.
Or it wont start. (Could be fixed but I dont see the point)
_________________
When you lose, dont lose the lesson.
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