Trigger matching to color codes

Posted by Jeffrey F. Pia on Wed 03 Mar 2004 05:56 AM — 4 posts, 17,125 views.

#0
Can a trigger be set to go off on a line that is a specific color? For instance when I look at a spell list, spells I am currently affected by are listed in bright green, and all others are dark green.

I looked around a bit and didn't see any documentation on this. If it's not possible via trigs, is it possible via script?
Amended on Wed 03 Mar 2004 05:57 AM by Jeffrey F. Pia
Australia Forum Administrator #1
Triggers can certainly match colours - see the "Match" line after the "trigger" line when you edit one.

However the colour is the colour of the first matching character, which may not be what you want.

If it is, fine, otherwise, make a trigger that matches the line in general, and then use GetLineInfo and GetStyleInfo to "walk" through the styles in the line and see what colour the word in question is.
#2
Yeah, this line has several color codes, the first of which is always the same:
Active spell - @wSpell: @GInvis @wAffects: blah blah
Inactive spell - @wSpell: @gInvis @wAffects: blah blah

I'll play around with GetLineInfo and GetStyleInfo and see if I can get it to do what I want. Thanks!
Australia Forum Administrator #3
It should be pretty easy.

Use the Display menu -> Text Attributes -> Line info to see how many styles there are, and what they contain. In your example the spell name will probably be style 2 and contain (say) "Invis". Just use GetStyleInfo to find what *colour* that style is.