;; Trys to find the best "banmask" or for whatever you need it
;; Usage: $bestmask(<nick>)
bestmask {
var %x = $ial($$1),%y = $gettok(%x,2,64)
if ($gettok(%y,1,46) !isalnum) {
if ($ial($address($1,4),0) < 20) {
%x = $address($1,3)
}
else { %x = $address($1,0) }
}
else { %x = $address($1,0) }
return $replace(%x,~,?)
}