Here is the code:
Code: Select all
# flood.tcl
# Channel
set flood(chan) "#Finlanda"
# Numbers of flood's in X second's
set flood(nr) 5:2
# Channel Lock Modes
set flood(clm) "m"
# Channel Lock Time
set flood(clt) 30
### END CFG ###
bind ctcp - * s:flood
bind NOTC - * s:flood
proc s:flood {nick host hand text chan key} {
global botnick flood flood_host_count
if {![validchan $chan] || [matchattr $hand of|of $chan] || [isop $nick $chan] || [isvoice $nick $chan]} { return 0 }
if {(([lsearch -exact [string tolower $flood(chan)] [string tolower $chan]] != -1) || ($flood(chan) == "*")) && (![matchat$
if {[lsearch -exact $flood(chan) $chan] == -1} {
return 0
}
if {![info exists flood_host_count($host:$chan)]} {
set flood_host_count($host:$chan) 1
} else {
incr flood_host_count($host:$chan)
}
utimer [lindex $flood(nr) 1] "s:expire flood_host_count($host:$chan)"
if {$flood_host_count($host:$chan) > [lindex $flood(nr) 0]} {
putquick "MODE $chan +$flood(clm)"
utimer $flood(clt) [list putquick "MODE $chan -$flood(clm)"]
return 0
}
}
}
proc s:expire var_exp {
upvar $var_exp var_pointer
if {$var_pointer > 1} {
incr var_pointer -1
} else {
unset var_pointer
}
}
set flood(chan) [string tolower $flood(chan)]
set flood(nr) [split $flood(nr) :]
# clear variables and timers on rehash
if {[array exists flood_host_count]} {unset flood_host_count}
foreach check_utimer [utimers] {
if {[string match flood_host_count [lindex $check_utimer 1]]} {
killutimer [lindex $check_utimer 2]
}
}
putlog "TCL Loaded: flood.tcl"
Code: Select all
<|R0B0T> [04:15] Tcl error [s:flood]: wrong # args: should be "s:flood nick host hand text chan key"
Any suggestion ?!