Page 1 of 1
Trigger groups enabled by one button press
Posted: Sun Jan 24, 2016 3:27 pm
by
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!
Re: Trigger groups enabled by one button press
Posted: Sun Jan 24, 2016 3:44 pm
by
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.
Re: Trigger groups enabled by one button press
Posted: Sun Jan 24, 2016 3:59 pm
by
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>
Re: Trigger groups enabled by one button press
Posted: Sat Jan 30, 2016 2:08 pm
by
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>