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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Suggestions
. . -> [Subject]  Enable/disable trigger groups from the configuration window

Enable/disable trigger groups from the configuration window

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


Posted by Kahenraz   (75 posts)  [Biography] bio
Date Thu 12 Apr 2018 11:08 PM (UTC)
Message
I would really like to be able to enable/disable entire trigger groups from the Configuration -> Triggers window. Yes, I can make an alias to do this but I don't want to make an alias for every group. Then I have to remember the aliases too.
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Fri 13 Apr 2018 12:16 AM (UTC)

Amended on Fri 13 Apr 2018 12:17 AM (UTC) by Nick Gammon

Message
What you can do is make an alias to do this for any group. Try this:


<aliases>
  <alias
   match="enablegroup"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>

  local triggers = GetTriggerList ()
  if not triggers then
    utils.msgbox ("No triggers were found", "Warning")
    return
  end -- if
 
  groups = { }

  for k, trigger in ipairs (triggers) do
    group = GetTriggerInfo (trigger, 26)
    if #group &gt; 0 then
      groups [group] = group
    end -- if has a group
  end -- for each trigger

  result = utils.listbox ("Choose a group", "Group?", groups)
  
  if result then
    enable = utils.msgbox ("Enable this group?", "Action", "yesnocancel", "?")
    print (enable)
    if enable == "cancel" then
      return
    end -- if cancelled
    EnableTriggerGroup (result, enable == "yes")
  end

</send>
  </alias>
</aliases>


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


This finds all of your groups and then shows a listbox with all their names. At this stage you can cancel to do nothing. Otherwise, choose a group and hit OK. You then see "Enable this group?" with Yes / No / Cancel buttons.

Choosing Yes enables the entire group. Choosing No disables the entire group. Choosing Cancel does not change the group.

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


9,730 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]