non wilcard badwords protection

By [|Red-X|] on Aug 29, 2004

this snippet is to check bad words in channel including nick/id which will check non wilcard text or nick/id, for example you add cock as bad words then if some one type 'cockcroach' in channel it will not kick him/her, only if it find text 'cock' then the script will reject the user..same format u can use for different non wilcard scan texts. you can use the aliases to put into different events. use mIRC v6.16

;bad text protection
alias matchword {
  if ($hfind($1,$2,1,n)) { set %reason $hget($1,$v1) | return 1 }
  return 0
}
alias checktext {
  var %n = $numtok($strip($2-),32)
  while (%n) {
    if ($matchword($1,$gettok($strip($2-),%n,32))) { return $true }
    dec %n
  }
  return $false
}
alias badnickid if (!$hget(badnick&id)) .hmake badnick&id 10 | hadd badnick&id $1 $2-
alias addswear if (!$hget(swear)) .hmake swear 10 | hadd swear $1 $2-

on !@*:text:*:#: {  
  if ($nick !isop $chan) && ($checktext(swear,$1-)) { ban -ku60 $chan $nick %reason }
}
on !@*:join:#: {
  if  ($checktext(badnick&id,$nick)) || ($checktext(badnick&id,$remove($deltok($gettok($fulladdress,2,33),2,64),~))) { ban -ku60 $chan $nick %reason }
}
;to add swear words :/addswear <sweartext> <reason>  ex: /addswear cock dont say that word again plz....
;to add badnick or id : /badnickid <banick|id> <reason> ex: /badnickid pussy pls change your nick/id be4 joined this channel 

;you can create other aliases with the same format to match a non wilcard text ..like alias spam if (!$hget(spamwords)) .hmake spamwords 10 | hadd spamwords $1 $2-
;and then use if ($checktext(spamwords,$1-)) { blablbalbla..... etc 

Comments

Sign in to comment.
[|Red-X|]   -  Sep 06, 2004

thanks zach...

 Respond  
Zach   -  Sep 04, 2004

Nice... you post some good stuff on here, unlike the majority of people.

 Respond  
[|Red-X|]   -  Aug 29, 2004

just give your comment about his snippet...lol

 Respond  
[|Red-X|]   -  Aug 29, 2004

just give your comment about his snippet...lol

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.