Coluring words in triggers differently

Posted by Brothfeder on Fri 17 Jul 2015 12:16 PM — 2 posts, 10,942 views.

#0
I'm trying to get the following to statement to trigger with the first part one color, and the 2nd another color.

You can use another Battlerage ability again. Available abilities: (Dilation|Disintegrate|Squeeze|Firefall|windlash)

So "You can use another Battlerage ability again. Available abilities:" would be one color.

And any of the abilities that are available will be another colour.

Been trying to capture the abilities as wildcards and use custom_colour, however it just wont work out for me.
<triggers

<trigger
enabled="y"
match="^You can use another Battlerage ability again. Available abilities\:$"
custom_colour="9"
regexp="y"
keep_evaluating="y"
sequence="100"
>
</trigger>


<trigger
enabled="y"
match="^You can use another Battlerage ability again. Available abilities\: +(*|*|*|*|*)$"
regexp="y"
keep_evaluating="y"
sequence="110"
>
</trigger>

<triggers>
<trigger
enabled="y"
match="^(%1|%2|%3|%4|%5)$"
custom_colour="15"
regexp="y"
keep_evaluating="y"
sequence="120"
>
</trigger>

</triggers>

So the first trigger colours the first part of the text. The 2nd says capture these wildcards in the context of the statement. And the 3rd colours the wildcards.

Its not working. :(
Amended on Fri 17 Jul 2015 08:14 PM by Brothfeder
Australia Forum Administrator #1

 match="^(%1|%2|%3|%4|%5)$"


I'm not sure what this is doing. For one thing, colouring words needs to be done word-by-word, not the whole line. So lose the ^ and the $.

Second, what is %1? You can't carry a wildcard from one trigger into the next one, it doesn't work like that.

You are probably best off making a single trigger (like your second one), omit it from output, and then break it up in a small script, using ColourNote?ColourTell to draw the trigger, and the new abilities, in different colours.

So basically you drop the original line, and redraw it in whatever way you want.