De and activate triggers?

Posted by Morten on Thu 23 Aug 2001 10:08 AM — 2 posts, 11,904 views.

#0
Greetings

I would like to know if it is possible to make a macro
to deactivate and activate triggers and how?

Thanks in Advance.

Australia Forum Administrator #1
Yes you can do that. If by "macro" you mean the macro keys, then it is a two-step process.

First the macro key has to call an alias.

The alias can then call a script which will enable/disable the triggers.

For example, if you wanted to enable three triggers with F2 and disable those three with F3.




First, make the macros:


F2 -> enabletriggers_1111
F3 -> disabletriggers_1111


The idea here is that the F2 and F3 macros generate a word that you would not normally use in mudding.

Then add two aliases:


Match on: enabletriggers_1111
Send: (nothing)
Label: enabletriggers
Script: On_EnableTriggers


Second one:


Match on: disabletriggers_1111
Send: (nothing)
Label: disabletriggers
Script: On_DisableTriggers


These two aliases will "catch" the macro words, send nothing to the MUD, but call the appropriate script functions. Then add the following routines to the script file (VBscript):


Sub On_EnableTriggers (thename, theoutput, thewildcards)
World.EnableTrigger "trigger1", TRUE
World.EnableTrigger "trigger2", TRUE
World.EnableTrigger "trigger3", TRUE
End Sub

Sub On_DisableTriggers (thename, theoutput, thewildcards)
World.EnableTrigger "trigger1", FALSE
World.EnableTrigger "trigger2", FALSE
World.EnableTrigger "trigger3", FALSE
End Sub


Finally you would make sure that the relevant triggers are given the labels you chose (trigger1, trigger2, trigger3).