Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
xnomeda
Newbie


Joined: 24 Nov 2009
Posts: 7

PostPosted: Fri Dec 04, 2009 3:19 pm   

Send nothing instead of an empty line in trigger
 
Is there any way to send nothing instead of a blank line from a trigger? i.e. I have a trigger:
Code:
%if(%eval(@cur_health < (0.80*(@max_health))),"tell jolo restore");

If my health is below 80% of max, then it will send 'tell jolo restore', if not it sends a blank line as if I hit enter with nothing in the command bar. Is there any way to circumvent this? This would come in handy for quite a few of my scripts, including my spellup script which checks variables and sends the commands to cast spells based on those variables, but if it doesn't need to recast, it sends a blank line, which sometimes includes sending about10-12 blank lines to the mud because I only need to recast one spell. This isn't exactly a horrible thing, it doesn't affect performance or anything, but it seems ugly to me.

Any help is appreciated, thank you.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Fri Dec 04, 2009 3:44 pm   
 
Is that actually the entire line? You should not start a line with a function or anything starting with a %. Perhaps you should be using #if instead of %if? I think that will actually solve your problem. It thinks this is a command to be sent to the mud, which it evaluates first and ends up sending a blank line.
Reply with quote
xnomeda
Newbie


Joined: 24 Nov 2009
Posts: 7

PostPosted: Fri Dec 04, 2009 5:03 pm   
 
Thats perfect, thanks for the tip, yeah I replaced the functions with #IFs and it works great, thank you.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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