The prob is that the channels of the $3- reply may or may not have a leading status prefix like "@". But isin won't help you here as for example "#b" is in "@#banned_from_Q".

Give this a try (untested):
Code:
raw 319:*: {
  if ($2 ison #q) {

    ; put blacklisted channel names here, separated by space, WITHOUT the chantype prefix
    var %ban = a b c 2m-clan

    ; this part sets a variable which has the status prefix (e.g. @) and the chantype-char (e.g. #) removed from $3-
    var %regex = $+(/,(?<=^|\40),$chr(40),[,$prefix,]?,[,$chantypes,],$chr(41),(?=\S+),/g)
    var %cleaned = $regsubex($3-,%regex,$null)

    ; loop the words of %cleaned...
    var %n = 1
    while ($gettok(%cleaned,%n,32)) {
      ; ...and check if the current word is a blacklisted channel of "%ban"
      ; if it is: kickban the user out of #q, stop the loop
      if ($istok(%ban,$v1,32)) {
        ban -k #q $2 You're on a banned channel 
        return
      }
      ; if not: continue with next word
      inc %n
    }
  }
}

Last edited by Horstl; 29/06/09 03:17 AM.