[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Suggestions
. . -> [Subject]  Trigger activate/deactivate

Trigger activate/deactivate

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


Posted by Severian   (3 posts)  [Biography] 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.
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] 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:




  1. 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


  2. Make two aliases "enable_triggers" and "disable_triggers" which call those two scripts (see comments above).

  3. 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
[Go to top] top

Posted by Severian   (3 posts)  [Biography] 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?
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] 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
[Go to top] top

Posted by Severian   (3 posts)  [Biography] 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.

[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] 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
[Go to top] 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] Refresh page

Go to topic:           Search the forum


[Go to top] 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.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]