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.
Entire forum
➜ MUSHclient
➜ General
➜ Pause/Unpause all triggers with 1 alias
Pause/Unpause all triggers with 1 alias
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Gymosphere
(2 posts) 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? | Top |
|
Posted by
| Nick Gammon
Australia (23,102 posts) 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 | Top |
|
Posted by
| WillFa
USA (525 posts) 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>
| Top |
|
Posted by
| Gymosphere
(2 posts) 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!
| Top |
|
Posted by
| Azoroth
(31 posts) 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? | Top |
|
Posted by
| Nick Gammon
Australia (23,102 posts) 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 | Top |
|
Posted by
| Azoroth
(31 posts) 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. | Top |
|
Posted by
| WillFa
USA (525 posts) 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? | 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.
25,003 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top