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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Creating a macro to disable all triggers

Creating a macro to disable all triggers

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


Posted by Dina   (2 posts)  [Biography] bio
Date Tue 28 Nov 2017 12:48 AM (UTC)
Message
i'm very sorry if this has already been discussed, i'm completely new to this and i've searched the forums and tested out a few things but failed every time.
i want to create a macro (alt+something whatever) to simpy disable all triggers instantly, is that possible?
if so, how should i do it?
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Tue 28 Nov 2017 05:46 AM (UTC)
Message
If you look at the Triggers configuration dialog (where they are all listed) there is a checkbox "Enable Triggers". You can turn that on or off in a script. I assume you are using Lua scripting (the default).

First make a couple of aliases, one to disable all triggers, and one to enable them again, like this:


<aliases>

  <alias
   match="disable_all_triggers"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>
SetOption ("enable_triggers", false)
ColourNote ("red", "", "Triggers disabled.")
</send>
  </alias>

  <alias
   match="enable_all_triggers"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>
SetOption ("enable_triggers", true)
ColourNote ("green", "", "Triggers enabled.")
</send>
  </alias>

</aliases>



Template:pasting For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.


Now use the Macros configuration to make a certain couple of macro keys call these aliases. For example make F7 send "disable_all_triggers" and F8 send "enable_all_triggers".

Now when you hit those keys the macro sends that word, which is picked up by the command processor, which then calls the alias, which calls the script. The confirmation message (which you can omit) tells you what has happened.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Dina   (2 posts)  [Biography] bio
Date Reply #2 on Tue 28 Nov 2017 02:10 PM (UTC)
Message
Hi, and thank you for the quick and clear answer, is succesfully made it work and it was easy even with my no-coding experience.

I am now trying a new thing : making a chat redirector. i am playing hellmoo, and found this http://hellmoo.org/wiki/index.php/Triggers
it appears you have already made one. i followed your steps, saved it in .xml as ChatRedirector.xml in my plugins folder, and tried adding and enabling it. sadly it doesn't seem to be working, the plugin is enabled but nothing changes. by trying and failing a few times, it seems i have to create a world first for the chat to be redirected in, is that correct?
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Tue 28 Nov 2017 09:11 PM (UTC)
Message
This is really a new question isn't it?

In that plugin there is a line:


chat_world = "hellmoo_Chat"


So for that to work you need to have made another world called "hellmoo_Chat" and set its IP address to 0.0.0.0.

However that plugin is 10 years old. There are more recent ones that redirect to a miniwindow, which saves you having to have new worlds open. I think this is the latest thread about it:

http://www.gammon.com.au/forum/?id=12855

You would however need to adjust the triggers in it to match what comes from your MUD. The page you linked has some example triggers, and the page I mention above says:


--[[
Call this plugin by making as many triggers as you want in your main
  world file (or other plugins) and then passing the style runs to this 
  plugin like this:
--]]

function chattrigger (name, line, wildcards, styles)
    require "serialize"
    check (CallPlugin ("10778718503f0c91106745f5", 
                       "display", serialize.save_simple (styles)))
  end -- chattrigger


So you basically use the triggers from your page, but change them to call the script above and it should work. In fact if you rename that function "chattrigger" to "redirect" then the work should be minimal.

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


11,945 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]