Hmm.. Hard to give an example, but say you are coloring text from a channel called gossip. However, you also want to color anything from 'Fred' a different color, so they stand out. You might do:
<triggers>
<trigger
custom_colour="17"
enabled="y"
group="channels"
match="^([gossip]) Fred:(.*)"
regexp="y"
sequence="5"
other_text_colour="orange"
other_back_colour="black"
>
</trigger>
<trigger
custom_colour="17"
enabled="y"
group="channels"
keep_evaluating="y"
match="^([gossip])(.*)"
regexp="y"
sequence="6"
other_text_colour="blue"
other_back_colour="black"
>
</trigger>
</triggers>
Now, as to why. Triggers don't fire in any specific order, though they may execute in more or less the order created. It isn't predictable. So, lets say all of the ones above where set to sequence 100 and all used 'keep_evaluating="y"'. Lets call them 1 and 2 to make it easier. You could have any one of the following happen:
#1 is tested, it matches Fred, turns the line orange.
#2 matches and changes the color again to blue.
#2 matches, line becomes blue
#1 matches, line turns orange
Obviously only one of these works. By leaving the first trigger as the default setting of off of 'keep_evaluating', the first instance above would stop the line from instead turning blue. By changing the sequence so #1 will *always* happen first, you eliminate the cases where it may match on #2 first, then #1.
But this is not a major issue. Lets say you had a third trigger that turned all instances with the word 'poison' in them green or something.
<triggers>
<trigger
custom_colour="17"
enabled="y"
keep_evaluating="y"
match="poison"
regexp="y"
sequence="7"
other_text_colour="green"
other_back_colour="black"
>
</trigger>
</triggers>
In this case if it matches *before* either the Fred trigger or the main channel trigger, then the word poison would never be colored. As soon as the Fred or main trigger hit, everything on the line would instantly turn orange or blue, including the word 'poison'. Now sequences become critical. Both of the prior triggers *must* allow the text to pass through 'keep_evaluating="y"', but the main gossip trigger *must* happen first. Why?
Fred matches (sequence 5) - turns orange.
Main matches (sequence 6) - turns blue.
Poison matches (sequence 7) - colors the word poison.
I this case while it would be nice to use a 'stopper', like the original Fred trigger above. Now you need the new poison trigger to work with both. Thus you have to change the sequences to work like:
Main matches (sequence 5) - turns blue.
Fred matches (sequence 6) - turns orange.
Poison matches (sequence 7) - colors the word poison.
It all depends on what you actually need to do. There are times when you want a specific line to stop any further triggers, scripting, coloring, etc. from happening once detected. Other times the specific order they happen in is critical. Occationally things need to both happen in a specific order *and* have one of them stop anything else happening. I don't often use triggers that don't have keep evaluating set on, with the exception of maybe one case I actually need it. Most of the time, simply forcing things to happen in the proper order solves most issues. |