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

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Pause/Unpause all triggers with 1 alias
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Pause/Unpause all triggers with 1 alias

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


Posted by Gymosphere   (2 posts)  [Biography] bio
Date Thu 01 Jan 2009 10:11 AM (UTC)
Message
I have many triggers with many groups. Some are without groups. Some groups are enabled, some groups are disabled.

I know I can enable/disable a group.

But how do I pause the whole trigger list, and when unpause, it will go back to the state before I pause?

Something similar to clicking trigger, and then check/uncheck the "enable triggers' checkbox. Just that, I need to make an alias to do the same thing.

Is there a way to do that?
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Thu 01 Jan 2009 07:24 PM (UTC)

Amended on Thu 01 Jan 2009 07:25 PM (UTC) by Nick Gammon

Message
To disable all triggers:


<aliases>
  <alias
   match="dt"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>
SetOption ("enable_triggers", 0)
Note ("Triggers disabled.")
</send>
  </alias>
</aliases>


To enable them again, as they were:


<aliases>
  <alias
   match="et"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>
SetOption ("enable_triggers", 1)
Note ("Triggers enabled.")
</send>
  </alias>
</aliases>


To use the above, see: http://mushclient.com/pasting

These assume scripting is active, and Lua is the scripting language. However other scripting languages would look very similar.

- Nick Gammon

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

Posted by WillFa   USA  (525 posts)  [Biography] bio
Date Reply #2 on Fri 02 Jan 2009 01:29 AM (UTC)

Amended on Fri 02 Jan 2009 01:33 AM (UTC) by WillFa

Message
The requested one alias...


<aliases>
  <alias
   match="tt"
   name="ToggleTriggers"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>
SetOption ("enable_triggers", (GetOption("enable_triggers")+1)%%2)
Note ("Triggers are enabled: " .. tostring(GetOption("enable_triggers") == 1))
</send>
  </alias>
</aliases>
[Go to top] top

Posted by Gymosphere   (2 posts)  [Biography] bio
Date Reply #3 on Fri 02 Jan 2009 10:29 PM (UTC)
Message
Great one! Thank you for the best support on the net!
[Go to top] top

Posted by Azoroth   (31 posts)  [Biography] bio
Date Reply #4 on Fri 09 Jan 2009 02:22 PM (UTC)
Message
How would you do the same for disabling aliases? As I find myself having to do this occassionally on my mud for certain quests/areas?
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Fri 09 Jan 2009 09:05 PM (UTC)
Message
Clearly you can't make an alias to enable aliases as it wouldn't fire.

I have taken Willfa's idea of a single toggling alias, and turned it into an accelerator key. You could change the keystroke easily enough. Since this doesn't rely upon aliases being active, it will toggle aliases on or off.


AcceleratorTo ("Ctrl+Alt+A", [[
SetOption ("enable_aliases", math.fmod (GetOption ("enable_aliases") + 1, 2))
Note ("Aliases are enabled: " .. tostring (GetOption ("enable_aliases") == 1))
]], sendto.script)


The only problem is that accelerators are not saved in the world file, so you really need to do this every time the world loads.

Simply making a script file, and putting that in it, should do the trick - as that would be executed every time the script file loads.

- Nick Gammon

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

Posted by Azoroth   (31 posts)  [Biography] bio
Date Reply #6 on Fri 09 Jan 2009 10:23 PM (UTC)
Message
Erm sorry Nick, I meant to disable aliases. Or does the same thing apply? I'm guessing not.
[Go to top] top

Posted by WillFa   USA  (525 posts)  [Biography] bio
Date Reply #7 on Fri 09 Jan 2009 10:55 PM (UTC)
Message
Yup, that's what that does. Nick's point was that you can't have an alias to enable the disabled alises, because the enable aliases alias is disabled with all the other aliases. :) So he basically gave you a macro/accelerator that does it.

To make the setting "stick" tho, you'd need to put that code into a script file. Hit CTRL+SHIFT+6, and make sure there's a script file specified. Click the "New..." button if one's not. After clicking OK out of that dialog box, Hit CTRL+SHIFT+H, paste the code in. Save. You should be prompted to reload the script file, but if no, hit CTRL+SHIFT+R.


After that, CTRL+ALT+A will toggle aliases on and off.

That help?
[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.


5,794 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 FutureQuest]