using an alias to switch a trigger on / off

Posted by Scouse on Thu 21 Jul 2005 05:57 AM — 7 posts, 32,354 views.

#0
been looking through forums and cant figure this one out ..

so ,
I have an alias that responds to a variable when im fighting someone -

*Nargus* smites your head into bloody fragments.

*Nargus* is then my target variable.

Now , im setting up a trigger for when he flees in X direction like -

*Nargus* panics and attempts to flee.
*Nargus* leaves west.

then I will capture the target has fled in that direction and i will follow and attempt to hit it .

However , and heres the bit I cant find .

In some situations , I dont want to follow him when he flees , so I need to be able to turn off the trigger that fires on seeing -

*Nargus* flees west.

I wanna use my macros for this , which I know how to do , I just dont know how to make an alias enable / disable a trigger .

so , ideally , heres the chain of events ...

I hit F1 which calls ThisisF1
in my aliases list ThisisF1 sends a command to toggle my trigger - on / off

I get a message -
Flee kill trigger ON
or
Flee kill trigger OFF

then ,

*Nargus* flees west. ( next line from the mud I want to trigger on )

would look summit like -

\**\* flees * ( this line isnt tested but I beleive it should work so that %1 is Nargus without the astericts

I would in game move in %2 direction ( or not if its toggeled off )
then would
K %1

I just cant figure out the toggling part , any help greatly appreciated .

scouse
Amended on Thu 21 Jul 2005 06:01 AM by Scouse
#1
If you want to toggle your trigger, you'll need to look into using one of the supported scripting languages and make use of the EnableTrigger function. You won't be able to do it without scripting.
#2
ok , i figured it out , heres my 2 tracking triggers which im still working on :P

<triggers>
<trigger
expand_variables="y"
match="@target leaves * riding *"
name="chase"
sequence="90"
>
<send>%1 k @target</send>
</trigger>
</triggers>


<triggers>
<trigger
expand_variables="y"
match="@target leaves * "
name="chase2"
sequence="100"
>
<send>%1 k @target</send>
</trigger>
</triggers>


now i know @target wont work , im still figuring that part out yet on how to do that bit :P

heres the alias I came up with to turn em on and off
<aliases>
<alias
match="thisisF8"
enabled="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>world.enabletrigger "chase", true
world.enabletrigger "chase2", true</send>
</alias>
</aliases>
<aliases>
<alias
match="thisisF9"
enabled="y"
send_to="12"
sequence="100"
>
<send>world.enabletrigger "chase", false
world.enabletrigger "chase2", false</send>
</alias>
</aliases>


USA #3
Why wont @target work?
And you can add a note to those aliases to tell you on/off (note "trigger on", etc).
Sweden #4
These kind of triggers is why triggers are banned (mostly) on MUME. Trigger-Player-Killing is not fun :(

// Fredrik
#5
im not actually sure why @target wont work , im still tinkering with it to try and figure out why .
Australia Forum Administrator #6

<triggers>
  <trigger
   enabled="y"
   expand_variables="y"
   match="@target leaves * riding *"
   name="chase"
   sequence="90"
  >
  <send>%1
k @target</send>
  </trigger>
</triggers>


Assuming you have enabled the trigger, and you have the variable "target" set up, it works for me.