mIRC Homepage

Stripping or changing specific color codes

Posted By: Perplexer

Stripping or changing specific color codes - 26/06/19 11:50 PM

I am using a "default" color scheme in my mIRC setup (black text on white background). I know about the color stripping options under IRC/Messages in IRC Options but I am wondering if it is possible to configure mIRC to only strip the color code for white text (since that is the color I would not be able to read on white background)? Is it possible to change the color code on-the-fly ? For example, if the incoming text in the channel is white, replace the color code and make it appear blue. All other color codes should stay untouched. Is something like that possible ?

Posted By: maroon

Re: Stripping or changing specific color codes - 27/06/19 02:49 PM

You could try replacing 0 or 00 following the ctrl-c character, then halting the original display

ON ^*:TEXT:*:#: { echo -ltc normal # $+(<,$nick($chan,$nick).pnick,>) $replacex($eventparms,$chr(3) $+ 00,$chr(3) $+ 02,$chr(3) $+ 0,$chr(3) $+ 2) | haltdef }

This won't preserve consecutive spaces, so if you want to preserve those, you could either use spaces.dll or you can let it have the normal behavior for most lines and instead have your matchtext be *x0* where 'x' is the color code. However this could make for disjointed lines if some preserve spaces and others don't. This also assumes that ALL white text should be changed to blue, even in cases where the background color has been set to something else. Without an identifier that informs the colors properties at any position in the text string, it would be difficult to do this correctly, since background colors can be set following the foreground, or can be inherited from an arbitrary distance in front, but are masked while 'reverse colors' is toggled ON, so it would need to check the foreground/background combo at the position where text follows the color code, instead of checking only at the position where the foreground is defined.
© 2020 mIRC Discussion Forums