Code: Select all
##putserv "KICK $ch $nicks :!!! Indentical nicks !!!"
putserv "KICK $chan $nicks :!!! Indentical nicks !!!"
Oh infact i already corrected that and tested with if opered it set the bans and kicks instantly but un-opered it freezes and takes 10sec to react and i limited to 10 identical nicks wich isn't muchSpiKe^^ wrote:FIXED a variable naming issue from some reused code in proc dobans:clonednicks in the script post above.Download the edited ver 0.1 script and try your tests again.Code: Select all
##putserv "KICK $ch $nicks :!!! Indentical nicks !!!" putserv "KICK $chan $nicks :!!! Indentical nicks !!!"
Oh yea sorry was doing some testing was gonna tell ya about the varSpiKe^^ wrote:Thanks for not bothering to tell me about the variable name issue.
What's the difference between if opered and not?
Are you changing the putquck to putnow?
Explain what you are doing to make it speed up and slow down.
That wouldn't be anything the script could change there?
Try speeding up the queue after or maybe even slowing it some (it is one second now = 1000ms)
15:13:15 Join: clonedyuuppqaqv [ident: Mibbit] *!*@Cloacked-so0.bww.957.408.IP
15:13:15 Join: clonedzt [ident: Mibbit] *!*@Cloacked-yt3.urd.878.658.IP
15:13:15 Join: clonedgx [ident: Mibbit] *!*@Cloacked-721.395.971.995.IP
15:13:15 Join: clonedop [ident: Mibbit] *!*@Cloacked-7au.fcq.288.663.IP
15:13:15 Join: clonedyy [ident: Mibbit] *!*@Cloacked-j4e.jve.633.765.IP
15:13:15 Join: clonedjxltq [ident: Mibbit] *!*@Cloacked-2ep.625.174.499.IP
15:13:15 Join: clonedminfhm [ident: Mibbit] *!*@Cloacked-959.t5y.346.423.IP
15:13:15 Join: clonedeuqlei [ident: Mibbit] *!*@Cloacked-rm0.kyf.428.744.IP
15:13:15 Join: clonedrqyoiliw [ident: Mibbit] *!*@Cloacked-5zp.n83.075.093.IP
15:13:33 @Hawk Sets Mode on #test to: +bbbbbbbbb *!*@Cloacked-so0.bww.957.408.IP *!*@Cloacked-yt3.urd.878.658.IP *!*@Cloacked-721.395.971.995.IP *!*@Cloacked-7au.fcq.288.663.IP *!*@Cloacked-j4e.jve.633.765.IP *!*@Cloacked-2ep.625.174.499.IP *!*@Cloacked-959.t5y.346.423.IP *!*@Cloacked-rm0.kyf.428.744.IP *!*@Cloacked-5zp.n83.075.093.IP
15:13:33 clonedyuuppqaqv Kicked from #test By @Hawk ( !!! Indentical nicks !!! )
15:13:33 clonedzt Kicked from #test By @Hawk ( !!! Indentical nicks !!! )
15:13:34 clonedgx Kicked from #test By @Hawk ( !!! Indentical nicks !!! )
15:13:34 clonedop Kicked from #test By @Hawk ( !!! Indentical nicks !!! )
15:13:34 clonedyy Kicked from #test By @Hawk ( !!! Indentical nicks !!! )
15:13:34 clonedjxltq Kicked from #test By @Hawk ( !!! Indentical nicks !!! )
15:13:34 clonedminfhm Kicked from #test By @Hawk ( !!! Indentical nicks !!! )
15:13:34 clonedeuqlei Kicked from #test By @Hawk ( !!! Indentical nicks !!! )
15:13:34 clonedrqyoiliw Kicked from #test By @Hawk ( !!! Indentical nicks !!! )
Code: Select all
#### clonednicks.tcl ver 0.1 by SpiKe^^ (24Nov2021) ####
bind join - * join:clonednicks
proc join:clonednicks {nick uhost hand chan} {
global cnicks cnickq
if {[isbotnick $nick] || ([string length $nick] < 6)} { return 0 }
if {[matchattr $hand f|f $chan]} { return 0 }
set chan [string tolower $chan]
set key [string tolower [string range $nick 0 4]]
set now [clock milliseconds]
if {[info exists cnicks(${key},$chan)]} {
## just expire any old entries ##
set old [expr {$now - (3 * 1000)}]
set newls [list]
foreach joined $cnicks(${key},$chan) {
if {[lindex [split $joined ","] 1] > $old} { lappend newls $joined }
}
if {![llength $newls]} { unset cnicks(${key},$chan)
} else { set cnicks(${key},$chan) $newls }
}
if {![info exists cnicks(${key},$chan)]} {
set cnicks(${key},$chan) [list "0,${now},${nick}!$uhost"]
return 0
}
if {![info exists cnickq($chan)]} {
lock:chanz $chan
after 500 [list dobans:clonednicks $chan]
}
if {[string match "0,*" [set first [lindex $cnicks(${key},$chan) 0]]]} {
set cnicks(${key},$chan) [list "1,[string range $first 2 end]"]
lappend cnickq($chan) [lindex [split $first ","] 2]
}
lappend cnicks(${key},$chan) "1,${now},${nick}!$uhost"
lappend cnickq($chan) "${nick}!$uhost"
return 0
}
proc dobans:clonednicks {chan} {
global cnickq
if {![info exists cnickq($chan)]} { return 0 }
if {![llength $cnickq($chan)] || ![botisop $chan]} {
unset cnickq($chan) ; return 0
}
set bmasks [list] ; set knicks [list]
foreach nkuhost $cnickq($chan) {
lassign [split $nkuhost "!@"] n u h
lappend knicks $n
lappend bmasks *!*@$h
}
set max 12
while {[set len [llength $bmasks]] > 0} {
if {$len > $max} {
set mode [string repeat "b" $max]
set masks [join [lrange $bmasks 0 [expr {$max - 1}]]]
set bmasks [lrange $bmasks $max end]
} else {
set mode [string repeat "b" $len]
set masks [join $bmasks]
set bmasks ""
}
putserv "mode $chan +$mode $masks"
}
set max 20
while {[set len [llength $knicks]] > 0} {
if {$len > $max} {
set nicks [join [lrange $knicks 0 [expr {$max - 1}]] ","]
set knicks [lrange $knicks $max end]
} else {
set nicks [join $knicks ","]
set knicks ""
}
putquick "kick $chan $nicks :!!! Indentical nicks !!!"
}
unset cnickq($chan) ; return 0
}
bind cron - {* * * * *} cleanup:clonednicks
proc cleanup:clonednicks {mn hr da mo wd} {
global cnicks
set old [expr {[clock milliseconds] - (3 * 1000)}]
foreach {key val} [array get cnicks] {
set newls [list]
foreach joined $val {
if {[lindex [split $joined ","] 1] > $old} { lappend newls $joined }
}
if {![llength $newls]} { unset cnicks($key)
} else { set cnicks($key) $newls }
}
}
proc lock:chanz {chan} {
global botnick chan_flooded
if {![info exists chan_flooded($chan)]} {
set chan_flooded($chan) 1
putquick "MODE $chan +Rb $::key*!*@*"
utimer 5 [list putquick MODE $chan -R]
utimer 5 [list unset -nocomplain chan_flooded($chan)]
}
}
putlog "clonednicks.tcl ver 0.1 by SpiKe^^ Loaded."
Code: Select all
#### clonednicks.tcl ver 0.2 by SpiKe^^ (25Nov2021) ####
bind join - * join:clonednicks
proc join:clonednicks {nick uhost hand chan} {
global cnicks cnickq
if {[isbotnick $nick] || ([string length $nick] < 6)} { return 0 }
if {[matchattr $hand f|f $chan]} { return 0 }
set chan [string tolower $chan]
set key [string tolower [string range $nick 0 4]]
set now [clock milliseconds]
if {[info exists cnicks(${key},$chan)]} {
## just expire any old entries ##
set old [expr {$now - (3 * 1000)}]
set newls [list]
foreach joined $cnicks(${key},$chan) {
if {[lindex [split $joined ","] 1] > $old} { lappend newls $joined }
}
if {![llength $newls]} { unset cnicks(${key},$chan)
} else { set cnicks(${key},$chan) $newls }
}
if {![info exists cnicks(${key},$chan)]} {
set cnicks(${key},$chan) [list "0,${now},${nick}!$uhost"]
return 0
}
if {![info exists cnickq($chan)]} {
after 1000 [list dobans:clonednicks $chan]
dobans:lockchan $chan $key
}
if {[string match "0,*" [set first [lindex $cnicks(${key},$chan) 0]]]} {
set cnicks(${key},$chan) [list "1,[string range $first 2 end]"]
lappend cnickq($chan) [lindex [split $first ","] 2]
}
lappend cnicks(${key},$chan) "1,${now},${nick}!$uhost"
lappend cnickq($chan) "${nick}!$uhost"
return 0
}
proc dobans:clonednicks {chan} {
global cnickq
if {![info exists cnickq($chan)]} { return 0 }
if {![llength $cnickq($chan)] || ![botisop $chan]} {
unset cnickq($chan) ; return 0
}
set bmasks [list] ; set knicks [list]
foreach nkuhost $cnickq($chan) {
lassign [split $nkuhost "!@"] n u h
lappend knicks $n
lappend bmasks *!*@$h
}
set max 10
while {[set len [llength $bmasks]] > 0} {
if {$len > $max} {
set mode [string repeat "b" $max]
set masks [join [lrange $bmasks 0 [expr {$max - 1}]]]
set bmasks [lrange $bmasks $max end]
} else {
set mode [string repeat "b" $len]
set masks [join $bmasks]
set bmasks ""
}
putquick "MODE $chan +$mode $masks"
}
set max 4
while {[set len [llength $knicks]] > 0} {
if {$len > $max} {
set nicks [join [lrange $knicks 0 [expr {$max - 1}]] ","]
set knicks [lrange $knicks $max end]
} else {
set nicks [join $knicks ","]
set knicks ""
}
putserv "KICK $chan $nicks :!!! Indentical nicks !!!"
}
unset cnickq($chan) ; return 0
}
bind cron - {*/10 * * * *} cleanup:clonednicks
proc cleanup:clonednicks {mn hr da mo wd} {
global cnicks
set old [expr {[clock milliseconds] - (3 * 1000)}]
foreach {key val} [array get cnicks] {
set newls [list]
foreach joined $val {
if {[lindex [split $joined ","] 1] > $old} { lappend newls $joined }
}
if {![llength $newls]} { unset cnicks($key)
} else { set cnicks($key) $newls }
}
}
proc dobans:lockchan {chan key} {
global cnick_flooded
if {![info exists cnick_flooded($chan)]} {
set cnick_flooded($chan) 1
putquick "MODE $chan +Rb ${key}*!*@*"
utimer 10 [list putquick "MODE $chan -R"]
utimer 10 [list unset -nocomplain ::cnick_flooded($chan)]
}
}
putlog "clonednicks.tcl ver 0.2 by SpiKe^^ Loaded."