I'm trying to make a short little ON TEXT command to do something if someone posts a line in, for example, red background with white text... is there an easy way to do this I'm missing?
Yes, but I'm not sure how complex you want it.
on 1:TEXT:*:#: {
var %badcolor1 = / $+ $chr(3) $+ 4,0/ig
if $regex($1-,%badcolor1) > 0 {
echo -a Red Text on White Background!!
}
}
That will echo to the active window "Red Text on White Background!!" when some uses those two colors (assuming they use both foregroud AND background). You can edit that line to do whatever you like, though.
If you know Regex, its pretty easy to go from there. If not, well, LEARN REGEX, its damn helpful.
Until then, I'll check back and see if you need further help.
Edit: RusselB has a very good idea, but his won't catch the color code if they use it anywhere except for the first character. While it IS possible to do it using $pos, it becomes kind of painful.