mIRC Home    About    Download    Register    News    Help

Print Thread
#138713 05/01/06 07:57 PM
Joined: Feb 2005
Posts: 344
B
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Feb 2005
Posts: 344
I working on a script that responds on text.
Not very hard to make but when someone is using acronyms there are colors with it.
My script doesn't respond to that.
How do I strip the colors?
here is a example of the code I use:
Code:
 On 1:text:.cola*:*: {
   if ($2 == light) { $read(bar\colalight.txt,t) }
else $read(bar\cola.txt,t)
}
 

#138714 05/01/06 08:05 PM
Joined: Nov 2003
Posts: 227
H
Fjord artisan
Offline
Fjord artisan
H
Joined: Nov 2003
Posts: 227
I think $strip is what you're looking for.

read /help $strip

It can strip bold, underline and reverse too, and does by default.

Something like if ($strip($2) == light) might be what you need.

#138715 05/01/06 09:59 PM
Joined: Mar 2005
Posts: 212
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
example
Code:
#brb on
on @*:text:*:#:{
  if (($(% $+ brb $+ $nick,2) != on) &&[color:red] (*brb* iswm $strip($1-))) {[/color] 
    set % $+ brb $+ $nick on
    msg $chan 4,1Hurry back $nick
  }
  elseif ($(% $+ brb $+ $nick,2) == on) {
    msg $chan 11,1Welcome back $nick
    unset % $+ brb $+ $nick  
  }
}

#brb end


Link Copied to Clipboard