################################
##   Quit Banned TCL by CrC   ##
################################

# Specify the list of quit messages to ban on. Use lower case characters
# only. You can use standard wildcards (? and *) in the list.
set qb_quitmsgs {
  "excess flood"
  "*#*"
  "*akill id*"
}

# Channels in which to enable the script. This can be one channel like
# "#red", a list of channels like "#red #green #blue", or "" for all
# channels.
set qb_chans "#amboncity #modern-GanK #tegalku #sate #tarsat #wac^aMp #cuek"

# Don't edit below unless you know what you're doing.

proc qb_quit {nick uhost hand chan reason} {
  global qb_chans qb_quitmsgs
  if {(($qb_chans != "") && ([lsearch -exact $qb_chans [string tolower $chan]] == -1))} {return 0}
  if {[matchattr $hand fo|fo $chan]} {return 0}
  set reason [string tolower $reason]
  foreach quitmsg $qb_quitmsgs {
    if {[string match $quitmsg $reason]} {
      set bmask *!*[string tolower [string range $uhost [string first "@" $uhost] end]]
      putserv "MODE $chan +b $bmask"
      return 0
    }
  }
  return 0
}

set qb_chans [split [string tolower $qb_chans]]

bind sign - * qb_quit

putlog "Loaded Quitban.Tcl By CrC"

return

