bnickmodule {
var %chan = $active | if (%chan !ischan) { echo -stac own This command can only be used on a channel. | halt }
if (!$1) { echo -a *********** no valid entry was given ************* Syntax : /nban SomeBadNickHere | halt }
if (!$nick(%chan,$me,@%) && o !isin $usermode) { halt }
var %i = 1 | tokenize 32 $replace($1-,$chr(44),$chr(32)) | while ($gettok($1-,%i,32)) {
var %user = $gettok($gettok($1-,1,46),%i,32)
if (. isin $1-) { var %kickmsg = $gettok($1-,-1,46) - «-Inappropriate-NICK-» } | else { var %kickmsg «-Inappropriate-NICK-» }
if (!$nick(%chan, %user ,@%) && !$istok( $me , %user ,32) && %user ison %chan) { var %kick = $addtok(%kick,%user,44) , %nm = $addtok(%nm,$nickbanregex( %user ),32) }
if (%user !ison %chan) { var %nm = $addtok(%nm,$nickbanregex( %user ),32) }
if ($numtok(%kick,44) == 4) { kick %chan %kick %kickmsg | unset %kick }
if ($numtok(%nm,32) == 6) { mode %chan + $+ $str(b,$numtok(%nm,32)) %nm | unset %nm }
inc %i
}
if (%kick) { kick %chan %kick %kickmsg }
if (%nm) { mode %chan + $+ $str(b,$numtok(%nm,32)) %nm }
}
nickbanregex {
var %badnickregex $regsubex($remdupl($1),/([aieuo|0-9|\{\}\[\]\|\\\\`\-\_\`\^]+)/gi,$null)
var %badnickregexONE $regsubex($remdupl($1),/([0-9|\{\}\[\]\|\\\\`\-\_\`\^]+)/gi,$null)
if ($len(%badnickregex) < 5) { return $regsubex($remdupl(%badnickregexONE),//g,*) $+ !*@* }
else { return $regsubex(%badnickregex,//g,*) $+ !*@* }
}