Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ De and activate triggers?

De and activate triggers?

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Morten   (5 posts)  Bio
Date Thu 23 Aug 2001 10:08 AM (UTC)
Message
Greetings

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

Thanks in Advance.

Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Thu 23 Aug 2001 10:58 AM (UTC)
Message
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).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


9,425 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.