Quote:
(($1 !isop $comchan($1,%a)) || ($1 !ishop $comchan($1,%a)))


why not use

Code:
$1 isreg $comchan($1,%a)


Code:
alias spamdetect {
  var %i = 1
  if $comchan($nick,0) {
    while $comchan($nick,%i) {
      var %c = $v1
      if $me isop %c && $nick isreg %c { ban -ku600 %c $nick 2  14Private Offensive Language  }
      inc %i
    }
  }
}


learn learn learn