Trigger groups enabled by one button press

Have a question about which MUD client works best with SI? Looking for a free app that lets you log in from your phone? Need help with a complicated script? This is the place.
Post Reply
User avatar
Kody_Oakborne
Citizen of Archai
Posts: 209
Joined: Tue Apr 22, 2014 1:35 am

Trigger groups enabled by one button press

Post by Kody_Oakborne »

Hey folks, I'm trying to create an alias to enable/disable triggers/aliases of the same group. Say I've got a set of triggers for fletching, they're all grouped as "Fletching." I want to be able to type the alias Fletching and if the triggers are on, turn them off, if the triggers are off, turn them on. I'm having a hard time finding how to call the value of a trigger group, and how to formulate an if/then properly. I used to be good at this stuff, but maybe some of you guys with some more experience could help me out? Thanks!
May the trees guard you, and house you, and guide you.
Kody
User avatar
RPGer
Citizen of Archai
Posts: 175
Joined: Sat Aug 15, 2015 4:40 pm
Location: USA

Re: Trigger groups enabled by one button press

Post by RPGer »

You might look over this one: http://www.gammon.com.au/forum/?id=11338
I may try it out if I have time (and my brain starts working) myself.
User avatar
Kody_Oakborne
Citizen of Archai
Posts: 209
Joined: Tue Apr 22, 2014 1:35 am

Re: Trigger groups enabled by one button press

Post by Kody_Oakborne »

RPGer wrote:You might look over this one: http://www.gammon.com.au/forum/?id=11338
I may try it out if I have time (and my brain starts working) myself.
Eabo! My hero!
I had all but given up and just made an ON and OFF alias. But now this solves my problems! Thanks so much!

Code: Select all

<aliases>
  <alias
   match="Hunting"
   enabled="y"
   expand_variables="y"
   group="Triggers"
   variable="Hunting"
   send_to="12"
   ignore_case="y"
   sequence="100"
  >
  <send>
if Hunting == "true" then
SetVariable("Hunting","false")
Hunting = "false"
EnableGroup ("Combat", false)  -- enable the group
Note("Hunting Group is Off.")
else
SetVariable("Hunting","true")
Hunting = "true"
EnableGroup ("Combat", true)  -- disable the group
Note("Hunting Group is On.")
end--if</send>
  </alias>
</aliases>
May the trees guard you, and house you, and guide you.
Kody
Visyn
Conclave Representative
Posts: 115
Joined: Sun Dec 01, 2013 4:25 pm
Location: Illinois

Re: Trigger groups enabled by one button press

Post by Visyn »

I would recommend the 2 following aliases that I made. This allows you to turn groups on/off by name without having to create extra aliases for each group. This does not check whether or not they are currently turned on like the other ones but you could easily do that.

Usage: /<groupname> on|off

Code: Select all

<aliases>
  <alias
   match="/* off"
   enabled="y"
   group="GROUP_CONTROL"
   send_to="12"
   sequence="100"
  >
  <send>Send ("q c")
EnableGroup ("%1", false)
Note ("%1 OFF")</send>
  </alias>
  <alias
   match="/* on"
   enabled="y"
   group="GROUP_CONTROL"
   send_to="12"
   sequence="100"
  >
  <send>EnableGroup ("%1", true)
Note ("%1 ON")</send>
  </alias>
</aliases>
Post Reply