Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Triggers reacting to colors only

Triggers reacting to colors only

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Vercalos   (23 posts)  Bio
Date Sun 11 Dec 2011 08:10 AM (UTC)
Message
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>

Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Sun 11 Dec 2011 07:42 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Vercalos   (23 posts)  Bio
Date Reply #2 on Sun 11 Dec 2011 07:58 PM (UTC)
Message
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.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


10,139 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.