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
remus
Wanderer


Joined: 06 Jul 2002
Posts: 53
Location: Australia

PostPosted: Mon Feb 03, 2003 7:35 pm   

Empty variable stop and message
 
Hello everyone,
Anyone have any ideas how to acomplish what I am trying to do?
Here is the problem at present. I have a spellup script I wrote. I have listed it below. What I would like to do is stop it firing on the last after the string defs is empty. As an example if I set @targ as Mastermune what happens is that it fires off to the string is empty and then fires a line with just Mastermune causing the infamous HUH? response from the mud.

It needs to stay with the @targ on the end so that if I set #var targ {} then I can use the script on myself

Anyways here is the script:
#CLASS {DEFENCE_SYS}
#ALIAS adddef {#ADDI spellupX "cast %1";#echo %1 has been added to your defences list.}
#ALIAS defup {#ECHO Def system Active;%item( @defs, "1") @targ}
#ALIAS resetdefs {#VAR defs @spellupX;#ECHO Defences reset}
#VAR defs {}
#VAR spellupX {cast dragonskin|cast barkskin|cast iceshield|cast fireshield|cast cloak|cast camo|cast float|cast detect|cast nature|cast gaincon|cast gainint|cast sanctum|}
#TRIGGER {You enchant yourself (*)} {#DELN defs 1;%item( @defs, "1") @targ}
#TRIGGER {FIZZLE....the player has (*) already up} {#DELN defs 1;%item( @defs, "1") @targ}
#TRIGGER {You lost your concentration.} {%item( @defs, "1") @targ}
#TRIGGER {^You cast the spell (*) on (*).} {#DELN defs 1;%item( @defs, "1") @targ}
#TRIGGER {Your cloak of nature adds} {#DELN defs 1;%item( @defs, "1") @targ}
#TRIGGER {Your cloak of nature is already cast upon you.} {#DELN defs 1;%item( @defs, "1") @targ}
#TRIGGER (@defs=) {#var @targ {};#echo Defence system completed}
#CLASS 0


Remus Parish aka
Rangek, Fist of the Slayers Hand.
coa.servegame.com port:23
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Feb 03, 2003 9:38 pm   
 
Just add an #IF.
#IF (%numitems( @defs) > 0} {cast next spell} {say done}

LightBulb
Advanced Member
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