[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  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] Refresh page


Posted by Vercalos   (23 posts)  [Biography] 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>

[Go to top] top

Posted by Nick Gammon   Australia  (23,016 posts)  [Biography] 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
[Go to top] top

Posted by Vercalos   (23 posts)  [Biography] 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.
[Go to top] 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.


9,410 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]