Triggers reacting to colors only

Posted by Vercalos on Sun 11 Dec 2011 08:10 AM — 3 posts, 13,554 views.

#0
I'm trying to make a trigger so that I can take anything that is

<black foreground> <black background>
into
<custom color foreground> <black background>

without changing the entire line, just the bits where the foreground color and background color are identical. So far, I can make it change the entire line, or none of it, but solely the black on black parts.
This one doesn't work at all
<triggers>
  <trigger
   back_colour="8"
   custom_colour="17"
   enabled="y"
   keep_evaluating="y"
   match=".*?"
   match_back_colour="y"
   match_bold="y"
   match_text_colour="y"
   regexp="y"
   sequence="100"
   text_colour="8"
   other_text_colour="dimgray"
  >
  </trigger>
</triggers>

and this one changes the entire line
<triggers>
  <trigger
   back_colour="8"
   custom_colour="17"
   enabled="y"
   keep_evaluating="y"
   match=".*"
   match_back_colour="y"
   match_bold="y"
   match_text_colour="y"
   regexp="y"
   sequence="100"
   text_colour="8"
   other_text_colour="dimgray"
  >
  </trigger>
</triggers>

Australia Forum Administrator #1
The first one doesn't work because the test for the colour is done second. That is, it tests for a match first, and then sees if the colour also matches (in other words it scans for text, not colours).

Thus it matches the very start of the line, and if that is not black-on-black it won't pass the colour test.

Does this (rather bizarre) problem of black-on-black occur on any line? Or just some lines like chats? If we could narrow down the line type we could make a trigger that matched that type of line, and then omitted it, and replaced it with a line where you checked each style run, and if it is black-on-black replaced the black text with something else.
#2
It mostly happens when some wag decides to deliberately use ANSI tags to put black on black. I managed a work-around for people who put black as the foreground without setting a background, but if someone decides to put black on black, I won't be able to read it.