Following up to this thread where color codes higher than 16 are no longer working...

Here's my problem now: I'm using a simple script to change unreadable colors on a certain background color:

on ^*:text:*:#:{ echo $color(text) -tqlbf $chan < $+ $nick $+ > $visible($1-) }
alias visible {
if ($colour(back) == 1) { return $replace($1-,01,14) }
elseif ($colour(back) == 0) { return $replace($1-,00,14) }
}

So, if people are forcing black text on my black background, I'll see 'em, and inversely on white BG.
But if those people use one character color code, like "1text" ?
If I do a $replace($1-,1,14), then when someone says "12text", then my result will be "142text" (displays "2text" in color 14), which is something I didn't want to.

On my original version, I replaced colors 10 to 15 by colors 42 to 47, then replace color 1 by 14, but 'cause of the way $replace works, I'm currently screwed frown

Any ideas on how this could be done?


Show me the steps to somewhere in the sky...