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
dazed-n-confused999
Wanderer


Joined: 03 Aug 2004
Posts: 79

PostPosted: Sat Mar 11, 2006 5:41 am   

Detecting if a list variable is empty
 
I have a list variable called sickness.
What happens is this, say I get hit with a poison. I see
"You vomit all over the place"
I trigger #additem sickness vomit
I have an ailias called "vomit" that administers the right cure.
Then I see "You are cured of vomiting"
So I trigger #delitem sickness vomit
I have an ailias call it cure with the value: %item( @SICKNESS, 1)
I tack the cure ailias onto long attack macros
This works great, only thing is if/when I have no sickness
I would like a way to substitute another ailias in there
such as a defences check and maybe put up the needed defence
just like the previous ailias works.
I was thinking of using some variable like @redefine that would call
upon "cure" ailias if needed, but if its empty it would call on
some other ailias. I guess what I really need is a way for zmud to
determine that the list variable is empty and switch over to
the other ailias. Any ideas, links, ect. would be nice.
Reply with quote
campnic
Newbie


Joined: 05 Mar 2006
Posts: 8

PostPosted: Sat Mar 11, 2006 5:35 pm   
 
#IF (%numitem(@SICKNESS)>0) {Do action.} {Dont do action}
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