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


Joined: 20 Sep 2008
Posts: 1

PostPosted: Sat Sep 20, 2008 5:10 am   

How to alternate potions?
 
I'm a newb as far as zmud settings go, so bare with me please. Someone gave me a setting a long time ago to alternate potions on the MUD I play. I vaguely remember some of the text.

I had to set a variable named hth. It's value was potion44444. Then another variable named htt and its value was potion44444 then potion55555 in the next line and I clicked string list. Then made an alias (this is where I forgot what to do) the value was four lines long and the purpose of it was to sip from potion44444 and then switch to sip from potion55555 the second time, then switch back to potion44444 the third time, etc.

My question is, does anyone know how I can make my potions do that again?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: Sat Sep 20, 2008 5:33 am   
 
you could make a list of the potions you want to drink, then use a variable as a placeholder

#VAR potions {potion44444|potion55555|potion44444}
#VAR potionToSip 1

Then you incriment it when you succeed your sip, and a check to make sure your counter is not out of bounds

#TRIGGER {succefull sipping message(s)} {#ADD potionToSip 1;#IF (@potionToSip>%numitems(@potion)) {potionToSip=1}}

Then make an alias to do your sipping as needed like so

#ALIAS sipper {sip %item(@potions, @potionToSip)}
_________________
Discord: Shalimarwildcat
Reply with quote
Rappy
Wanderer


Joined: 15 Jul 2005
Posts: 96

PostPosted: Sat Sep 20, 2008 12:13 pm   
 
%case would be a better option, no need to check for out of bounds.

Code:

#TRIGGER {successful sipping message} {#ADD potionToSip 1}
#ALIAS sipper {sip %case(@potionToSip,"potion44444","potion5555")


-Rappy
_________________
Windows 11 Pro,
cMUD 3.34
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