View previous topic :: View next topic |
Author |
Message |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3767 Location: Mint Factory
|
Posted: Wed Mar 25, 2015 8:58 am Post subject: |
|
|
Crap. Replace:
Code: |
putkick [join [lrange $nlist 0 6] ","] "repeat flood"
|
with:
Code: |
putkick $chan [join [lrange $nlist 0 6] ","] "repeat flood"
|
Why is Chanserv in the list? Should we add an exception list or somethng? _________________ Once the game is over, the king and the pawn go back in the same box. |
|
Back to top |
|
 |
simo Revered One
Joined: 22 Mar 2015 Posts: 1027
|
Posted: Wed Mar 25, 2015 9:03 am Post subject: |
|
|
this is what i have so far
Code: | # 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^^" |
|
|
Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3767 Location: Mint Factory
|
Posted: Wed Mar 25, 2015 9:05 am Post subject: |
|
|
See my previous post that I edited while you where posting.
Oh, you can remove my comments line cos added them there to allow anyone easily follow the logic I had in mind. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
Back to top |
|
 |
simo Revered One
Joined: 22 Mar 2015 Posts: 1027
|
Posted: Wed Mar 25, 2015 9:08 am Post subject: |
|
|
i used that in the code if i did it correct |
|
Back to top |
|
 |
simo Revered One
Joined: 22 Mar 2015 Posts: 1027
|
Posted: Wed Mar 25, 2015 9:13 am Post subject: |
|
|
this is what i have atm
for some reason ir kicks me 2 and i didnt even flood
Code: | # 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^^" |
|
|
Back to top |
|
 |
simo Revered One
Joined: 22 Mar 2015 Posts: 1027
|
Posted: Wed Mar 25, 2015 9:19 am Post subject: |
|
|
it seems to ban everyone in the channel and it doesnt send instant its queud
wich takes it for ever to finish banning and kicking |
|
Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3767 Location: Mint Factory
|
Posted: Wed Mar 25, 2015 9:20 am Post subject: |
|
|
At least dose it push 6 bans per line? How about kicks?
Need to test this out.
Well, it uses puthelp that's a slower queue. Switch to putquick if needed. The kick also goes with a slower queue to have multiple kicks in the same line, but if needed can switch to putquick and have a single kick per line, but I wouldn't opt for this too, but rather quickly moderate the channel to stop the flooding and remove the moderation after finished with the kicks.
Haven't looked at the code Spike did to follow his logic, so I get all nicks in channel and see if they are banned and kick them no matter if they flooded or not. _________________ Once the game is over, the king and the pawn go back in the same box.
Last edited by caesar on Wed Mar 25, 2015 9:25 am; edited 1 time in total |
|
Back to top |
|
 |
simo Revered One
Joined: 22 Mar 2015 Posts: 1027
|
Posted: Wed Mar 25, 2015 9:24 am Post subject: |
|
|
no it doesnt push modes in one line |
|
Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3767 Location: Mint Factory
|
Posted: Wed Mar 25, 2015 9:29 am Post subject: |
|
|
If you are on Dalnet then from what I see in the documentation I guess it should be a single b, so replace the +bbbbbb with a single one +b. From:
Code: |
puthelp "MODE $chan +bbbbbb [join [lrange $blist 0 6] " "]"
|
to
Code: |
puthelp "MODE $chan +b [join [lrange $blist 0 6] " "]"
|
if that still doesn't work then I guess +b+b+b+b+b+b will. Just test with your IRC client to do:
Code: |
/mode #channel +b *!*@one *!*@two *!*@three *!*@four *!*@five *!*@six
|
and see if you set all 6 bans in one line. If not try with multiple +b like I said above. _________________ Once the game is over, the king and the pawn go back in the same box.
Last edited by caesar on Wed Mar 25, 2015 9:34 am; edited 1 time in total |
|
Back to top |
|
 |
simo Revered One
Joined: 22 Mar 2015 Posts: 1027
|
Posted: Wed Mar 25, 2015 9:32 am Post subject: |
|
|
im on a inspircd server wich has 15 mode settings in 1 line max
doesnt eggdrop support like mircs $modespl wich gets it from server |
|
Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 826 Location: Tennessee, USA
|
Posted: Wed Mar 25, 2015 9:42 am Post subject: |
|
|
It may be worth mentioning, the uhosts in uhlist are like this: nick!user@host _________________ SpiKe^^
Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
. |
|
Back to top |
|
 |
simo Revered One
Joined: 22 Mar 2015 Posts: 1027
|
Posted: Wed Mar 25, 2015 9:50 am Post subject: |
|
|
all that remains is:
- for it to excempt !~@%& from beeing effected
- no queu ( send instant to server )
- send modes as much as possible in one line ( i tried pushmode but pt sends 4 modes per line )
- and to lock channel (temporary)
if this could be integrated its perfect for my needs and would be apreciated |
|
Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 826 Location: Tennessee, USA
|
Posted: Wed Mar 25, 2015 9:56 am Post subject: |
|
|
Quote: | - no queu ( send instant to server ) |
This will have your bot removed from the network for flooding.
wtf is everyones issue with a reasonable queueing of lines to the server? _________________ SpiKe^^
Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
. |
|
Back to top |
|
 |
simo Revered One
Joined: 22 Mar 2015 Posts: 1027
|
Posted: Wed Mar 25, 2015 9:57 am Post subject: |
|
|
as i mentioned its running on my own network and its opered and has no limits
cause waiting like minutes for it to finish kicking and banning is annoying for the rest of the users in the channel |
|
Back to top |
|
 |
simo Revered One
Joined: 22 Mar 2015 Posts: 1027
|
Posted: Wed Mar 25, 2015 10:07 am Post subject: |
|
|
tnx SpiKe^^ and caesar for the fine job much apreciated |
|
Back to top |
|
 |
|