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
Malleus
Novice


Joined: 05 Jan 2003
Posts: 45
Location: USA

PostPosted: Tue Mar 25, 2003 5:35 am   

preventing blank lines from triggers
 
I have an hpbar trigger(to do general stuff when hp is low, etc...) But when its enabled, every round the hpbar i sshown it adds a blank line underneath it, and i have mutliple hpbar trigger, so i get like 3/4 blank lines and its a lot of wsted space/spam....anyway to kep the trigger enabled, but stop it from making a blank line underneath the hpbar?

/ Malleus /
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Tue Mar 25, 2003 6:24 am   
 
Show an example of one of these triggers causing the extra line.


Ton Diening
Reply with quote
Malleus
Novice


Joined: 05 Jan 2003
Posts: 45
Location: USA

PostPosted: Tue Mar 25, 2003 5:51 pm   
 
here my TRIGGER:
HP~: (%n)/(%n) SP~: (%n)/(%n) W~: (%n)/(%n)~((%n)~) L~: (%n)~% P~: (%n)/(%n)~% A: (%n) T~: (%w) G~: (%n)

heres the SCRIPT:
@currenthp = %1
@water = %5
%if( %5<10, wateralarm)
#MATH gxptotal @gxptotal+%13
#IF (%1 = %2) {
#T- hpalarm
#WA 500
#T- hpmodeset
}
%if( %11<2, lmp)


heres the MUD OUTPUT:
Rich Dwarf hit you hard.
> > HP: 556/624 SP: 154/238 W: 153/401(51) L: 20% P: 2/72% A: 20 T: goner G: 146


Rich Dwarf gurgles in his own blood as he dies.
(notice the 2 empty lines under the hpbar, if i disable these triggers, there are none)

/ Malleus /
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Mar 25, 2003 6:29 pm   
 
This is caused by using %if instead of #IF.

LightBulb
Advanced Member
Reply with quote
Malleus
Novice


Joined: 05 Jan 2003
Posts: 45
Location: USA

PostPosted: Tue Mar 25, 2003 7:29 pm   
 
awesome, works...
thanks.

/ Malleus /
Reply with quote
Anabasis
Wanderer


Joined: 26 Jan 2001
Posts: 74

PostPosted: Tue Mar 25, 2003 8:25 pm   
 
Just out of curiosity...

Would anyone care to explain why %if returns a blank line? Is this something that just occurs with %if, or is this something one runs into on different functions as well?

Ana
Reply with quote
Charbal
GURU


Joined: 15 Jun 2001
Posts: 654
Location: USA

PostPosted: Tue Mar 25, 2003 8:34 pm   
 
Well, %if is a function and it always returns a value. In this case, when the condition is true, it returns wateralarm. When the condition is false, since no false-value is specified, it returns the default value, a zero-length string.

These are just returned values... since they are on a line by themselves, they are essentially evaluated. So the wateralarm alias is called if the condition is true and the zero-length string otherwise. But when a zero length string is executed, that's just like pressing enter without anything in the command-line.



 - Charbal
Reply with quote
Anabasis
Wanderer


Joined: 26 Jan 2001
Posts: 74

PostPosted: Tue Mar 25, 2003 11:53 pm   
 
Thanks. That makes sense.

Ana
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