Trigger Subgroups?

Posted by VBMeireles on Mon 08 Feb 2016 02:41 PM — 2 posts, 11,362 views.

Brazil #0
Is it possible to create groups of triggers which contain whole groups of triggers?

E.g:

char1_triggergroup
  char1_farmingtriggers
    trig1
    trig2
  char1_pvptriggers
    trig3
    trig4
char2_triggergroup
  char2_farmingtriggers
    trig5
    trig6
  char2_pvptriggers
    trig7
    trig8


From what I've seen only first level trigger groups can be created, but I was wondering if there is some kind of workaround where I'd name my trigger groups with a common prefix and be able to, through scripting, manipulate (turn on and off) all groups starting with, say, "char1_" or "char2_".

Help? :)
Australia Forum Administrator #1
You could certainly do that in a script. After all, a trigger group is really just a name that EnableTriggerGroup uses to decide whether or not to enable/disable a particular trigger.

You could make your own version in a few lines of code that could use a regular expression to break the name into parts.

Use GetTriggerList to find all triggers, and then GetTriggerInfo to find its group name. Use whatever tests you want on the group, and then call EnableTrigger as required.