Code: Select all
Tcl error [shortflood]: syntax error in expression " shortflooders($uhost:$chan) == $overkill ": missing close parenthesis at end of function call
Code: Select all
if {$rp_bcount($uhost:$chan:$text) == [lindex $rp_bflood 0]}
System:
eggdrop v1.6.15 (default stable windrop build from windrop.sourceforge.net)
OS: CYGWIN_NT-5.0 1.3.22(0.78/3/2)
Tcl version: 8.4.1 (header version 8.4.1)
since it's a little script I don't mind publishing it:
Code: Select all
# Shortflood kick by De Kus
#
# this script is intended to use as a second flood kick timer. you may
# use it for any timers, but I recommed to use the builtin feature first!
# Don't use it either, if you can use a server flood setting for the channel :)
# lines in seconds before kick
set shortflood 5:2
# exclude flags
set shortfloodexclude fo|fo
# kick cause
set shortfloodkick "\001Flood\001 - limited to \0015\001 lines per \0012\001 seconds"
#
# End of configuration
#
set shortflooders ""
bind pubm -|- * shortflood
bind notc -|- * shortflood_notc
proc shortflood_notc {nick uhost hand text chan} {
if { [validchan [string range $chan [string first # $chan] e]] } { shortflood $nick $uhost $hand $chan "$text" }
return 0
}
proc shortflood {nick uhost hand chan text} {
global shortflooders shortflood shortfloodexclude shortfloodkick
if { [matchattr $hand $shortfloodexclude $chan] } { return 0 }
if {![info exists shortflooders($uhost:$chan)]} {
set shortflooders($uhost:$chan) 0
}
incr shortflooders($uhost:$chan)
set overkill [expr [lindex $shortflood 0] + 3]
if { $shortflooders($uhost:$chan) == [lindex $shortflood 0] } {
putkick $chan $nick $shortfloodkick
} elseif { shortflooders($uhost:$chan) == $overkill } {
newchanban $chan "*!$uhost" shortflood "5m - extrem Flood ($overkill in [lindex $shortflood 1] seconds)" 5
putkick $chan $nick "Killed for extrem Flood ($overkill in [lindex $shortflood 1] seconds) - 5m Tempban"
}
utimer [lindex $shortflood 1] [list incr shortflooders($uhost:$chan) -1]
return 0
}
do you think this much timer could significally use CPU? I mean for each line written one will be created...
is there a better way to detect a string a valid channal then this?
Code: Select all
[validchan [string range $chan [string first # $chan] e]]