Excess Flood/Akilled Ban & JoinQuit Ban

By Get_A_Fix on Mar 06, 2009

DALNet - Basic tcl someone asked me for.
This simply bans users who are killed/akilled and quit from an Excess Flood.
It also monitors those who join/quit really fast, and is currently set to match/ban anyone that joins, quits, all within 5seconds.

Default trigger set to "!"

Enable Events

PUB: !quitcheck on
MSG: /msg botnick quitcheck #channel on

PUB: !joinquit on
MSG: /msg botnick joinquit #channel on

Disable Events

PUB: !quitcheck off
MSG: /msg botnick quitcheck #channel off

PUB: !joinquit off
MSG: /msg botnick joinquit #channel off

# Excess Flood/Akill & JoinQuit Module

# Set global trigger here
set trigger "!"

# Set time in sec for how long someone should have stayed joined, before they quit.
set jointime "5"

# Set your quit match pattern below
set quitwords {
  "*excess flood*"
  "*k-line*"
  "*killed*"
  "*k-banned*"
  "*a-banned*"
  "*join #*"
  "*/server*"
}

# Set your exempt match pattern below
set exemptwords {
  "*dontbanme*"
  "*i live on dalnet and all i got was this lousy k-line*"
}

# -----DONT EDIT BELOW-----
bind pub - ${trigger}quitcheck quitcheck:pub
bind pub - ${trigger}joinquit joinquit:pub
bind msg - quitcheck quitcheck:msg
bind msg - joinquit joinquit:msg
bind sign - * join:quit
bind sign - * quit:check

setudef flag quitcheck
setudef flag joinquit

proc getTrigger {} {
  global trigger
  return $trigger
}

proc quitcheck:pub {nick uhost hand chan text} {
  global botnick
  if {![matchattr [nick2hand $nick] o|m $chan]} {return}
  if {([lindex [split $text] 0] == "") && (![regexp c [getchanmode $chan]]} {putquick "PRIVMSG $chan :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: [getTrigger]quitcheck on/off"; return}
  if {([lindex [split $text] 0] == "") && ([regexp c [getchanmode $chan]]} {putquick "PRIVMSG $chan :ERROR: Incorrect Parameters. SYNTAX: [getTrigger]quitcheck on/off"; return}

  if {[lindex [split $text] 0] == "on"} {
    if {[channel get $chan quitcheck] && ![regexp c [getchanmode $chan]]} {putquick "PRIVMSG $chan :\037ERROR\037: This setting is already enabled."; return}
    if {[channel get $chan quitcheck] && [regexp c [getchanmode $chan]]} {putquick "PRIVMSG $chan :ERROR: This setting is already enabled."; return}
    channel set $chan +quitcheck
    puthelp "PRIVMSG $chan :Enabled QuitCheck Protection for $chan"
  }

  if {[lindex [split $text] 0] == "off"} {
    if {![channel get $chan quitcheck] && ![regexp c [getchanmode $chan]]} {putquick "PRIVMSG $chan :\037ERROR\037: This setting is already disabled."; return}
    if {![channel get $chan quitcheck] && [regexp c [getchanmode $chan]]} {putquick "PRIVMSG $chan :ERROR: This setting is already disabled."; return}
    channel set $chan -quitcheck
    puthelp "PRIVMSG $chan :Disabled QuitCheck Protection for $chan"
  }
}

proc quitcheck:msg {nick uhost hand arg} {
  global botnick
  set chan [strlwr [lindex [split $arg] 0]]
  if {![matchattr [nick2hand $nick] o|m $chan]} {return}
  if {[lindex [split $arg] 0] == ""} {putquick "NOTICE $nick :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: /msg $botnick quitcheck #channel on/off"; return}
  if {([lindex [split $arg] 1] == "") && ([string match "*#*" $chan])} {putquick "NOTICE $nick :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: /msg $botnick quitcheck $chan on/off"; return}

  if {([lindex [split $arg] 1] == "on") && ([string match "*#*" $chan])} {
    if {[channel get $chan quitcheck]} {putquick "NOTICE $nick :\037ERROR\037: This setting is already enabled."; return}
    channel set $chan +quitcheck
    putquick "NOTICE $nick :Enabled QuitCheck Protection for $chan"
  }

  if {([lindex [split $arg] 1] == "off") && ([string match "*#*" $chan])} {
    if {![channel get $chan quitcheck]} {putquick "NOTICE $nick :\037ERROR\037: This setting is already disabled."; return}
    channel set $chan -quitcheck
    putquick "NOTICE $nick :Disabled QuitCheck Protection for $chan"
  }
}

proc joinquit:pub {nick uhost hand chan text} {
  global botnick
  if {![matchattr [nick2hand $nick] o|m $chan]} {return}
  if {([lindex [split $text] 0] == "") && (![regexp c [getchanmode $chan]]} {putquick "PRIVMSG $chan :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: [getTrigger]joinquit on/off"; return}
  if {([lindex [split $text] 0] == "") && ([regexp c [getchanmode $chan]]} {putquick "PRIVMSG $chan :ERROR: Incorrect Parameters. SYNTAX: [getTrigger]joinquit on/off"; return}

  if {[lindex [split $text] 0] == "on"} {
    if {[channel get $chan joinquit] && ![regexp c [getchanmode $chan]]} {putquick "PRIVMSG $chan :\037ERROR\037: This setting is already enabled."; return}
    if {[channel get $chan joinquit] && [regexp c [getchanmode $chan]]} {putquick "PRIVMSG $chan :ERROR: This setting is already enabled."; return}
    channel set $chan +joinquit
    puthelp "PRIVMSG $chan :Enabled JoinQuit Protection for $chan"
  }

  if {[lindex [split $text] 0] == "off"} {
    if {![channel get $chan joinquit] && ![regexp c [getchanmode $chan]]} {putquick "PRIVMSG $chan :\037ERROR\037: This setting is already disabled."; return}
    if {![channel get $chan joinquit] && [regexp c [getchanmode $chan]]} {putquick "PRIVMSG $chan :ERROR: This setting is already disabled."; return}
    channel set $chan -joinquit
    puthelp "PRIVMSG $chan :Disabled JoinQuit Protection for $chan"
  }
}

proc joinquit:msg {nick uhost hand arg} {
  global botnick
  set chan [strlwr [lindex $arg 0]]
  if {![matchattr [nick2hand $nick] o|m $chan]} {return}
  if {[lindex [split $arg] 0] == ""} {putquick "NOTICE $nick :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: /msg $botnick joinquit #channel on/off"; return}
  if {([lindex [split $arg] 1] == "") && ([string match "*#*" $chan])} {putquick "NOTICE $nick :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: /msg $botnick joinquit $chan on/off"; return}

  if {([lindex [split $arg] 1] == "on") && ([string match "*#*" $chan])} {
    if {[channel get $chan joinquit]} {putquick "NOTICE $nick :\037ERROR\037: This setting is already enabled."; return}
    channel set $chan +joinquit
    putquick "NOTICE $nick :Enabled JoinQuit Protection for $chan"
  }

  if {([lindex [split $arg] 1] == "off") && ([string match "*#*" $chan])} {
    if {![channel get $chan joinquit]} {putquick "NOTICE $nick :\037ERROR\037: This setting is already disabled."; return}
    channel set $chan -joinquit
    putquick "NOTICE $nick :Disabled JoinQuit Protection for $chan"
  }
}

proc quit:check {nick uhost hand chan reason} {
  global quitwords exemptwords
  if {[channel get $chan quitcheck]} {
    foreach exempt $exemptwords {
      if {[string match -nocase $exempt $reason]} {return}
    }
    foreach quitmatch $quitwords {
      if {([botisop $chan]) && (![validuser [nick2hand $nick]]) && (![isop $nick $chan]) && (![isvoice $nick $chan])} {
        if {([string match -nocase $quitmatch $reason]) && (![string match -nocase "*ghost*" $reason]) && (![string match -nocase "*collision*" $reason]) && (![string match -nocase "*svskill*" $reason])} {
          set mask *!*@[lindex [split [getchanhost $nick $chan] @] 1]
          pushmode $chan +b $mask
        }
      }
    }
    flushmode $chan
  }
}

proc join:quit {nick uhost hand chan reason} {
  global jointime
  if {[channel get $chan joinquit] && [botisop $chan] && ![isop $nick $chan] && ![isvoice $nick $chan] && ![validuser [nick2hand $nick]]} {
    set mask *!*@[lindex [split [getchanhost $nick $chan] @] 1]
    set join [getchanjoin $nick $chan]
    set quit [unixtime]
    set joinquit [expr $quit - $join]
    if {$joinquit <= $jointime} {
      pushmode $chan +b $mask
    }
  }
  flushmode $chan
}

putlog "Loaded: Excess Flood/Akill & JoinQuit Module."

Comments

Sign in to comment.
Get_A_Fix   -  Apr 16, 2011

AB, sure, I even think people have made and released an eggdrop based proxy monitor (for an Oper Bot checking connection notices). However, I haven't made one.

 Respond  
AB   -  Apr 15, 2011

is there anyway to find real ip behind proxy tor proxy? at dalnet!

 Respond  
Dark|   -  Nov 04, 2010

it should work. :)

 Respond  
amd86   -  Nov 04, 2010

thx dark ... i try it now

 Respond  
Dark|   -  Nov 03, 2010

amd86...Google TCL4MIRC

 Respond  
amd86   -  Nov 03, 2010

can someone convert this tcl to mirc addon?? i need this ban protection thx

 Respond  
PuNkTuReD   -  Mar 06, 2009

i have no idea about TCL, but its gd to see some popping up here.
gd work Get_A_Fix

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.