Code Library
Home Submit Free Hosting Link To Us Contacts

TCL Clone Kicker

TCL Clone Kicker TCL TCL Clone Kicker Download (.zip)



# The channels you want this active on
set cp_chans "#channel1 #channel2"

# Number of *@host joins in how many seconds, joins:seconds
set cp_j_flood 2:5

# Number of *user@host join/part cycles in how many seconds, j/p_cycles:seconds
set cp_jp_flood 3:10

# Period in minutes to ban *!*@host for multiple joins or join/part floods
set cp_btime 60
# Handle of the bot user that shoud be sent a note
set cp_notify "nick"

##### DON'T edit anything below this line unless you know what you're doing #####

bind join - * clone_pro_join
bind rejn - * clone_pro_join
bind part - * clone_pro_leave
bind sign - * clone_pro_leave
bind splt - * clone_pro_leave

proc clone_pro_join {nick uhost handl chan} {
        global cp_chans cp_j_flood cp_jp_flood cp_btime cp_host_count cp_uh_count cp_notify
        set uhost [string tolower $uhost]
        set host [lindex [split $uhost @] 1]
        set chan [string tolower $chan]
        if {[lsearch -exact $cp_chans $chan] == -1} {return 0}

        if {![info exists cp_host_count($host:$chan)]} {
                set cp_host_count($host:$chan) 1
        } else {
                incr cp_host_count($host:$chan)
        }
        utimer [lindex $cp_j_flood 1] "cp_expire cp_host_count($host:$chan)"

        if {$cp_host_count($host:$chan) > [lindex $cp_j_flood 0]} {
                newchanban $chan *!*@$host ClonePro "Not so fast" $cp_btime
          sendnote ClonePro $cp_notify "÷ banned *!*@$host (massjoin) on $chan, [ctime [unixtime]] ÷"
                if {[botisop $chan] && [onchan $nick $chan]} {
                        putserv "KICK $chan $nick :Not so fast"
                }
    }

        if {![info exists cp_uh_count($uhost:$chan)]} {
                set cp_uh_count($uhost:$chan) 1
        } else {
                incr cp_uh_count($uhost:$chan)
        }
        utimer [lindex $cp_jp_flood 1] "cp_expire cp_uh_count($uhost:$chan)"
        if {$cp_uh_count($uhost:$chan) >= [expr [lindex $cp_jp_flood 0]*2]} {
                newchanban $chan *!*@$host ClonePro "Are you coming or going?" $cp_btime
          sendnote ClonePro $cp_notify "÷ banned *!*@$host (join/part flood) on $chan, [ctime [unixtime]] ÷"
                if {[botisop $chan] && [onchan $nick $chan]} {
                        putserv "KICK $chan $nick :Are you coming or going?"
                }
    }
}

proc clone_pro_leave {nick uhost handl chan {reason "Left channel"}} {
        global cp_chans cp_jp_flood cp_btime cp_uh_count cp_notify
        set uhost [string tolower $uhost]
        set host [lindex [split $uhost @] 1]
        set chan [string tolower $chan]
        if {[lsearch -exact $cp_chans $chan] == -1} {return 0}
        if {![info exists cp_uh_count($uhost:$chan)]} {
                set cp_uh_count($uhost:$chan) 1
        } else {
                incr cp_uh_count($uhost:$chan)
        }
        utimer [lindex $cp_jp_flood 1] "cp_expire cp_uh_count($uhost:$chan)"
        if {$cp_uh_count($uhost:$chan) >= [expr [lindex $cp_jp_flood 0]*2]} {
                newchanban $chan *!*@$host ClonePro "Are you coming or going?" $cp_btime
          sendnote ClonePro $cp_notify "÷ banned *!*@$host (join/part flood) on $chan, [ctime [unixtime]] ÷"
                if {[botisop $chan] && [onchan $nick $chan]} {
                        putserv "KICK $chan $nick :Are you coming or going?"
                }
    }
}

proc cp_expire var_exp {
        upvar $var_exp var_pointer
  
        if {$var_pointer > 1} {
                incr var_pointer -1
        } else {
                unset var_pointer
        }
}



set cp_chans [string tolower $cp_chans]
set cp_j_flood [split $cp_j_flood :]
set cp_jp_flood [split $cp_jp_flood :]


# clear variables and timers on rehash
if {[array exists cp_host_count]} {unset cp_host_count}
if {[array exists cp_uh_count]} {unset cp_uh_count}
foreach check_utimer [utimers] {
        if {[string match cp_*_count* [lindex $check_utimer 1]]} {
                killutimer [lindex $check_utimer 2]
        }
}




  • TCLClone Kicker Long text kicker


Tatet