mIRC Home    About    Download    Register    News    Help

Print Thread
#146838 09/04/06 01:47 PM
Joined: Apr 2006
Posts: 4
R
Self-satisified door
OP Offline
Self-satisified door
R
Joined: Apr 2006
Posts: 4
is it possible to do a badword filter check on my own text?
lets say i type "my ass", but on the channel it says "my ***".

#146839 09/04/06 05:50 PM
Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
Edit only what is in red. Any words contained there will be replaced by *'s. The words in the list should be separated by a period as shown.

Code:
on *:INPUT:*:{
  if (/* !iswm $1 && !$ctrlenter) {
    haltdef
    var %text = $1-
    var %badtok = [color:red]word1.word2.wordN[/color]
    var %i = 1, %l = $numtok(%badtok,46)
    while (%i <= %l) {
      if ($istok(%text,$gettok(%badtok,%i,46),32)) {
        var %target = $gettok(%badtok,%i,46), %targlen = $len(%target)
        var %occurs = $findtok(%text,%target,0,32), %j = 1
        while (%j <= %occurs) {
          %text = $reptok(%text,%target,$str(*,%targlen),1,32)
          inc %j
        }
      }
      inc %i
    }
    msg $target %text
  }
}


Link Copied to Clipboard