Preventing ops from being kicked would probably require a timer. Immediately after any user joins your channel, they are NOT an op. The reply from the /whois will probably be so quick that the person still won't be op'd by chanserv or another op.
To have multiple channels in a "bad list" there would have to be a loop to check a variable/file/etc.
Try this:
; Bad Channel list: comma separated list of channels
alias -l badchans return #badchan1,#badchan2,#badchan3
;
alias isonbadchan {
var %c = 0, %cc = $numtok($badchans,44)
while (%c < %cc) {
inc %c
if ($wildtok($1-,* $+ $gettok($badchans,%c,44),0,32)) return 1
}
return 0
}
alias -l badchankick if ($1 !isop #yourchan) ban -ku300 #yourchan $2 1 You are banned
on @*:JOIN:#yourchan:{
.enable #whoisscan
whois $nick
}
#whoisscan off
raw 319:*:if (($2 ison #yourchan) && ($isonbadchan($3-))) .timer 1 5 badchankick $2
raw 311:*:haltdef
raw 307:*:haltdef
raw 312:*:haltdef
raw 313:*:haltdef
raw 310:*:haltdef
raw 320:*:haltdef
raw 318:*:{ .disable #whoisscan | haltdef }
#whoisscan end
*Note: code is untested
Change the #yourchan 's to the name of your channel. On the second line of the script, you add the bad channels to the list as shown, separated by a comma. The bad channels list is tested using a *wildcard, so if you put "badchan" into the list, it will match #badchan #thisisabadchan #iamonabadchan, etc..
-genius_at_work