Gammon Forum
Entire forum
MUSHclient
Suggestions
Trigger activate/deactivate
Trigger activate/deactivate
|
It is now over 60 days since the last post. This thread is closed.
  Refresh page
Posted by
| Severian
(3 posts) bio
|
Date
| Mon 24 Sep 2001 10:35 PM (UTC) |
Message
| Would it be possible to put in a key combo that would activate/deactivate triggers from the main window? Something like CTRL-SHIFT-T. | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #1 on Mon 24 Sep 2001 11:02 PM (UTC) |
Message
| To do this you need three steps, because there is no such keystroke built in at present:
- Add a couple of small script subs to your script file:
' ---------------------------------------------------------
' Alias to enable all triggers
'
' Alias: enable_triggers
' Label: EnableTriggers
' Script: EnableTriggers
' ---------------------------------------------------------
Sub EnableTriggers (thename, theoutput, thewildcards)
world.setoption "enable_triggers", 1
End Sub
' ---------------------------------------------------------
' Alias to disable all triggers
'
' Alias: disable_triggers
' Label: DisableTriggers
' Script: DisableTriggers
' ---------------------------------------------------------
Sub DisableTriggers (thename, theoutput, thewildcards)
world.setoption "enable_triggers", 0
End Sub
- Make two aliases "enable_triggers" and "disable_triggers" which call those two scripts (see comments above).
- Make two macros (eg. F3 and F4) that send aliases "enable_triggers" and "disable_triggers"
What will now happen is that when you press F3 (for example):
- F3 will send "enable_triggers"
- "enable_triggers" will be caught by the alias
- The script function EnableTriggers will be called. This will turn on that option.
Similarly for F4 for disable_triggers.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Severian
(3 posts) bio
|
Date
| Reply #2 on Fri 12 Oct 2001 07:21 AM (UTC) |
Message
| Ok, programming skill is nil, and i think i followesed the directions, but it doesnt work, so i obviously didnt.
Little hand holding, please? | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #3 on Fri 12 Oct 2001 09:36 AM (UTC) |
Message
| Ah, OK, there are a few places this could go wrong.
First, make sure that scripting is enabled (Configuration -> Scripting) and that the script file in the Scripting tag is pointing to the same file that you put the script functions into.
Check that the aliases are matching, eg. by putting something into the alias that sends something, eg. "think enabling triggers"
Check that the macro keys are calling the aliases (if you do the previous paragraph this should be obvious). |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Severian
(3 posts) bio
|
Date
| Reply #4 on Fri 12 Oct 2001 03:50 PM (UTC) |
Message
| Did all that, and i get output from my aliases. But it doesnt actually enable or disable triggers.
| top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #5 on Sat 13 Oct 2001 06:36 AM (UTC) |
Message
| OK, check the script is being called. In each script routine put in something like:
world.note "** enabling alias now **"
just before the line "end sub". |
- 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.
13,978 views.
It is now over 60 days since the last post. This thread is closed.
  Refresh page
top
Quick links:
MUSHclient.
MUSHclient help.
Forum shortcuts.
Posting templates.
Lua modules.
Lua documentation.
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.