excellent loaded your latest posted code and it works flawlessly
thanks SpiKe^^ much apreciated
Code: Select all
#### pushkick.tcl ver 0.1 by SpiKe^^ (27Nov2021) ####
##### ??? New Eggdrop Tcl Command ??? #####
# I believe that Eggdrop should have a new tcl command called pushkick.
# It should operate much like the existing pushmode command.
# Use this pushkick command as you would use pushmode, but for kicks.
# pushkick <chan> <nick>
# pushkick <chan> <nick> [reason]
# pushkick <chan> <nick,nick,nick,...> [reason]
# Description:
# Sends out a kick nick or nick,nick,... command
# (ex: pushkick #lame goober "go away") through a custom queuing system.
# All kicks will be combined into one line as much as possible.
proc pushkick {chan nicks {reason ""} } {
# start the custom queue timer if it isn't running #
if {![info exists ::pushkickq($chan)]} {
after 800 [list dopushkicks $chan] ;# <= set queue timing (in ms) <= #
}
# add the provided nick(s) to the queue variable #
lappend ::pushkickq($chan) $nicks $reason
}
proc dopushkicks {chan} {
if {![info exists ::pushkickq($chan)]} { return }
if {![botisop $chan]} { unset ::pushkickq($chan) ; return }
set max 4 ;# <= set maximum number of kicks per command <= #
set defreason "" ;# <= set default kick reason ("" for none) <= #
# prepare a list of nicks to kick and save the last command's reason #
foreach {nicks reason} $::pushkickq($chan) {
foreach {nk} [split $nicks ","] {
lappend knicks $nk
}
}
if {$reason eq ""} { set reason $defreason }
# chunk up the queued nicks as much as possible...#
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 ""
}
# ...and send each chunk of nicks to the server #
if {$reason eq ""} { putquick "KICK $chan $nicks"
} else { putquick "KICK $chan $nicks :$reason" }
}
# delete the custom queue variable #
unset ::pushkickq($chan)
}