Code: Select all
putkick [join [lrange $nlist 0 6] ","] "repeat flood"
Code: Select all
putkick $chan [join [lrange $nlist 0 6] ","] "repeat flood"
![Rolling Eyes :roll:](./images/smilies/icon_rolleyes.gif)
Code: Select all
putkick [join [lrange $nlist 0 6] ","] "repeat flood"
Code: Select all
putkick $chan [join [lrange $nlist 0 6] ","] "repeat flood"
Code: Select all
# multi-host-repeat.tcl v1.0 by SpiKe^^, closely based on
# repeat.tcl v1.1 (9 April 1999) by slennox <slenny@ozemail.com.au>
# Repeat flood, kick-ban on repeats:seconds #
set rp_bflood 3:10
# Repeat flood kick-ban reason #
set rp_breason "repeat flood"
# Length of time in minutes to ban Repeat flooders #
set rp_btime 1
# After a valid Repeat flood, script will continue to #
# kick-ban offenders for an additional 'x' seconds #
set rp_blinger 10
# END OF SETTINGS # Don't edit below unless you know what you're doing #
bind pubm - * rp_pubmsg
set rp_bflood [split $rp_bflood :]
proc rp_pubmsg {nick uhost hand chan text} {
global rp_bcount rp_bflood rp_breason rp_btime rp_blinger
set uhost [string tolower $nick!$uhost]
set chan [string tolower $chan]
set text [string map [list \017 ""] [stripcodes abcgru $text]]
set text [string tolower $text]
if {[isbotnick $nick]} { return 0 }
if {[matchattr $hand f|f $chan]} { return 0 }
set utnow [unixtime]
set target [lindex $rp_bflood 0]
if {[info exists rp_bcount($chan:$text)]} {
set uhlist [lassign $rp_bcount($chan:$text) cnt ut]
set utend [expr {$ut + [lindex $rp_bflood 1]}]
set expire [expr {$utend + $rp_blinger}]
if {$cnt < $target} {
if {$utnow > $utend} { unset rp_bcount($chan:$text) }
} elseif {$utnow > $expire} { unset rp_bcount($chan:$text) }
}
if {![info exists rp_bcount($chan:$text)]} {
set rp_bcount($chan:$text) [list 1 $utnow $uhost]
return 0
}
if {$utnow <= $utend} {
incr cnt
if {[lsearch $uhlist $uhost] == "-1"} { lappend uhlist $uhost }
set rp_bcount($chan:$text) [linsert $uhlist 0 $cnt $ut]
if {$cnt < $target} { return 0 }
if {$cnt == $target} { rp_dobans $chan $uhlist
} else { rp_dobans $chan [list $uhost] }
} elseif {$cnt >= $target} { rp_dobans $chan [list $uhost] }
return 0
}
proc rp_dobans {chan uhlist} {
# if the bot isn't OP there's no point to continue
if {![botisop $chan]} return
set blist ""
set klist ""
# loop through uhosts
foreach uhost $uhlist {
# filter out any duplicates
if {[lsearch $blist $uhost] != -1} continue
# set the ban mask as you want
scan $uhost {%[^@]@%s} user host
# save the list with masks to ban
lappend blist "*!*@$host"
# save the list with masks to get nicks from later on cos we will destroy the $blist
lappend klist $uhost
}
# push 6 ban masks (or change to match how many bans per line the server you are on allows) at a time until the list is empty
while {[llength $blist] != 0} {
puthelp "MODE $chan +bbbbbb [join [lrange $blist 0 6] " "]"
set blist [lrange $blist 6 end]
}
# from the given uhosts we ban make a list of nicks to kick and again filter out duplicates
set nlist ""
set userlist [lreplace [chanlist $chan] 0 0]
foreach u [split $userlist] {
set uhost [getchanhost $user $chan]
scan $uhost {%[^@]@%s} user host
if {[lsearch $klist $uhost] != -1} continue
lappend nlist $u
}
# use putkick to do 6 kicks per a single line sent to server
while {[llength $nlist] != 0} {
putkick [join [lrange $nlist 0 6] ","] "repeat flood"
set nlist [lrange $nlist 6 end]
}
}
proc rp_breset {} {
global rp_bcount rp_bflood rp_blinger
set utnow [unixtime]
set target [lindex $rp_bflood 0]
foreach {key val} [array get rp_bcount] {
lassign $val cnt ut
set utend [expr {$ut + [lindex $rp_bflood 1]}]
set expire [expr {$utend + $rp_blinger}]
if {$cnt < $target} {
if {$utnow > $utend} { unset rp_bcount($key) }
} elseif {$utnow > $expire} { unset rp_bcount($key) }
}
utimer 30 [list rp_breset]
}
if {![info exists rp_running]} {
utimer 30 [list rp_breset]
set rp_running 1
}
putlog "Loaded multi-host-repeat.tcl v1.0 by SpiKe^^"
Code: Select all
# multi-host-repeat.tcl v1.0 by SpiKe^^, closely based on
# repeat.tcl v1.1 (9 April 1999) by slennox <slenny@ozemail.com.au>
# Repeat flood, kick-ban on repeats:seconds #
set rp_bflood 3:10
# Repeat flood kick-ban reason #
set rp_breason "repeat flood"
# Length of time in minutes to ban Repeat flooders #
set rp_btime 1
# After a valid Repeat flood, script will continue to #
# kick-ban offenders for an additional 'x' seconds #
set rp_blinger 10
# END OF SETTINGS # Don't edit below unless you know what you're doing #
bind pubm - * rp_pubmsg
set rp_bflood [split $rp_bflood :]
proc rp_pubmsg {nick uhost hand chan text} {
global rp_bcount rp_bflood rp_breason rp_btime rp_blinger
set uhost [string tolower $nick!$uhost]
set chan [string tolower $chan]
set text [string map [list \017 ""] [stripcodes abcgru $text]]
set text [string tolower $text]
if {[isbotnick $nick]} { return 0 }
if {[matchattr $hand f|f $chan]} { return 0 }
set utnow [unixtime]
set target [lindex $rp_bflood 0]
if {[info exists rp_bcount($chan:$text)]} {
set uhlist [lassign $rp_bcount($chan:$text) cnt ut]
set utend [expr {$ut + [lindex $rp_bflood 1]}]
set expire [expr {$utend + $rp_blinger}]
if {$cnt < $target} {
if {$utnow > $utend} { unset rp_bcount($chan:$text) }
} elseif {$utnow > $expire} { unset rp_bcount($chan:$text) }
}
if {![info exists rp_bcount($chan:$text)]} {
set rp_bcount($chan:$text) [list 1 $utnow $uhost]
return 0
}
if {$utnow <= $utend} {
incr cnt
if {[lsearch $uhlist $uhost] == "-1"} { lappend uhlist $uhost }
set rp_bcount($chan:$text) [linsert $uhlist 0 $cnt $ut]
if {$cnt < $target} { return 0 }
if {$cnt == $target} { rp_dobans $chan $uhlist
} else { rp_dobans $chan [list $uhost] }
} elseif {$cnt >= $target} { rp_dobans $chan [list $uhost] }
return 0
}
proc rp_dobans {chan uhlist} {
# if the bot isn't OP there's no point to continue
if {![botisop $chan]} return
set blist ""
set klist ""
# loop through uhosts
foreach uhost $uhlist {
# filter out any duplicates
if {[lsearch $blist $uhost] != -1} continue
# set the ban mask as you want
scan $uhost {%[^@]@%s} user host
# save the list with masks to ban
lappend blist "*!*@$host"
# save the list with masks to get nicks from later on cos we will destroy the $blist
lappend klist $uhost
}
# push 6 ban masks (or change to match how many bans per line the server you are on allows) at a time until the list is empty
while {[llength $blist] != 0} {
puthelp "MODE $chan +bbbbbb [join [lrange $blist 0 6] " "]"
set blist [lrange $blist 6 end]
}
# from the given uhosts we ban make a list of nicks to kick and again filter out duplicates
set nlist ""
set userlist [lreplace [chanlist $chan] 0 0]
foreach u [split $userlist] {
set uhost [getchanhost $user $chan]
scan $uhost {%[^@]@%s} user host
if {[lsearch $klist $uhost] != -1} continue
lappend nlist $u
}
# use putkick to do 6 kicks per a single line sent to server
while {[llength $nlist] != 0} {
putkick $chan [join [lrange $nlist 0 6] ","] "repeat flood"
set nlist [lrange $nlist 6 end]
}
}
proc rp_breset {} {
global rp_bcount rp_bflood rp_blinger
set utnow [unixtime]
set target [lindex $rp_bflood 0]
foreach {key val} [array get rp_bcount] {
lassign $val cnt ut
set utend [expr {$ut + [lindex $rp_bflood 1]}]
set expire [expr {$utend + $rp_blinger}]
if {$cnt < $target} {
if {$utnow > $utend} { unset rp_bcount($key) }
} elseif {$utnow > $expire} { unset rp_bcount($key) }
}
utimer 30 [list rp_breset]
}
if {![info exists rp_running]} {
utimer 30 [list rp_breset]
set rp_running 1
}
putlog "Loaded multi-host-repeat.tcl v1.0 by SpiKe^^"
Code: Select all
puthelp "MODE $chan +bbbbbb [join [lrange $blist 0 6] " "]"
Code: Select all
puthelp "MODE $chan +b [join [lrange $blist 0 6] " "]"
Code: Select all
/mode #channel +b *!*@one *!*@two *!*@three *!*@four *!*@five *!*@six
This will have your bot removed from the network for flooding.- no queu ( send instant to server )