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


Joined: 27 Jun 2001
Posts: 82

PostPosted: Tue Nov 27, 2001 2:51 am   

Temp triggers?
 
I am kind of confused how to make a temporary trigger. I want the trigger to fire only if a command is true. Would the easiest way be to have a second trigger that turns the trigger class on or off?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Nov 27, 2001 3:00 am   
 
quote:

I am kind of confused how to make a temporary trigger. I want the trigger to fire only if a command is true. Would the easiest way be to have a second trigger that turns the trigger class on or off?



What, specifically, are you trying to do with this trigger?

Something like this?
#trigger {some pattern} {#if (%defined(MyAlias)) {#noop TRUE, the alias is defined} {#noop FALSE, the alias is not defined}

EDIT: if you want the trigger to fire only when the command (what command?) returns true, then a temporary trigger is not for you. A temporary trigger in most cases will fire only once and then delete itself. The only case where a #temp trigger seems to not delete itself is in the following:

#trigger {(%w) swings at you} {#temp {It's a (%w) blow to the head!} {shout OWWWWWW!}}

The temp trigger contained in this trigger will change (%w) to whatever text matched it and transform the resultant trigger into a normal pattern trigger. Thus, it doesn't delete.

li'l shmoe of Dragon's Gate MUD
Reply with quote
undergod
Wanderer


Joined: 27 Jun 2001
Posts: 82

PostPosted: Tue Nov 27, 2001 3:27 am   
 
Something like...

#var fighting (true/false)

if fighting is true have a trigger like
#trigger {(%w) flees (%w)!} {%2;kill %1}

but, I don't want it to fire if the mob flees
from someone else

I know I could do it with an alias and such, but I was wondering if I could do it with triggers?
Reply with quote
decantor
Apprentice


Joined: 14 Nov 2001
Posts: 100

PostPosted: Tue Nov 27, 2001 5:20 am   
 
if you are fighting, #VAR fighting 1
if you are not, #VAR fighting ""

#TRIGGER {(%w) flees (%w)} {#IF (@fighting) {%2;kill %1} {#abort}}
Reply with quote
undergod
Wanderer


Joined: 27 Jun 2001
Posts: 82

PostPosted: Tue Nov 27, 2001 8:33 am   
 
Hmm... that does look easier, thanks for the advice.
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