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 Aug 22, 2012 9:24 am   

#delitem variables
 
ok I got a trigger for potions when one is empty - trouble is it I have a lot of potions so this is what I got

I have a few alias for sipping potions (sipHp or sipMana or sipHeal)
which have values of
sip @potionhealth.1 or sip@potionmana.1 or sip@potionheal.1
in each of the variables are a list of potions as I carry a few of each

if empty I get this

You see no "potion(%d)" to drink or sup from.
I want to do this
#delitem (from correct potion type eg potionhealth potionmana etc) (potion%1)
and then try to sip again the same potion

so if I can I want to put something in my sipHp alias which identifies potion type (eg health mana heal) and then when I get the no potion(%d) trigger I would like it to
#delitem from the correct variables - potionhealth potionmana or potionheal
and then retry sipping the potion

so simple I want to sip a potion - if its empty - delitem from correct potion stringlist and then sip again at next potion on that stringlist
Reply with quote
shalimar
GURU


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

PostPosted: Wed Aug 22, 2012 10:44 am   
 
try
sip %item(@potionHeal, 1)

and when its empty
#NOOP %pop(potionHeal)

%pop deletes the first item of a given stringlist.
_________________
Discord: Shalimarwildcat
Reply with quote
stark62
Wanderer


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

PostPosted: Wed Aug 22, 2012 12:52 pm   
 
ok thanks - but I was not clear I think

You see no "potion1111" to drink or sup from.

is shown any time a potion is empty but I wish to delitem from the correct variable - if that is any clearer

so I need to delitem potion(%d) from either @potionmana @potionhealth or @potionheal

I am looking for ideas using zmud that might be possible - so when i go to sip a potion it sets what the potion type is and then deletes it from the potion stringlist if its not there??

unfortunately the empty potion is the same no matter what i just try to sip
Reply with quote
shalimar
GURU


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

PostPosted: Wed Aug 22, 2012 12:59 pm   
 
ahhh i see that could be acomplished with an alias (i prefer buttons so i can just click on them)

Code:
#ALIAS sip {
drink=%1
~sip %item(%concat("@potion", @drink), 1)
}

'sip mana' would try to drink a mana potion

then reference the @drink var in your cleanup trigger

Code:
#TR {You see no "potion1111" to drink or sup from.} {#NOOP %pop(%concat("potion", @drink))}
_________________
Discord: Shalimarwildcat
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