|
undergod Wanderer
Joined: 27 Jun 2001 Posts: 82
|
Posted: 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?
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 |
|
|
|
undergod Wanderer
Joined: 27 Jun 2001 Posts: 82
|
Posted: 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? |
|
|
|
decantor Apprentice
Joined: 14 Nov 2001 Posts: 100
|
Posted: 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}} |
|
|
|
undergod Wanderer
Joined: 27 Jun 2001 Posts: 82
|
Posted: Tue Nov 27, 2001 8:33 am |
Hmm... that does look easier, thanks for the advice.
|
|
|
|
|
|