Trigger groups enabled by one button press
- Kody_Oakborne
- Citizen of Archai
- Posts: 209
- Joined: Tue Apr 22, 2014 1:35 am
Trigger groups enabled by one button press
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
Kody
Re: Trigger groups enabled by one button press
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.
I may try it out if I have time (and my brain starts working) myself.
- Kody_Oakborne
- Citizen of Archai
- Posts: 209
- Joined: Tue Apr 22, 2014 1:35 am
Re: Trigger groups enabled by one button press
Eabo! My hero!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.
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
Kody
Re: Trigger groups enabled by one button press
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
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>