| View previous topic :: View next topic |
| Author |
Message |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Thu Nov 25, 2021 3:38 pm Post subject: |
|
|
excellent loaded your latest posted code and it works flawlessly
thanks SpiKe^^ much apreciated |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Fri Nov 26, 2021 5:50 am Post subject: |
|
|
| I would like to thank CrazyCat as well much appreciated |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Fri Nov 26, 2021 4:26 pm Post subject: |
|
|
i studied the code and couldnt really figure what u used spike^^
i seen u used time but couldnt figure why and how and what u checked with it
would you care to elaborate on the various functions in the code spike^^
thanks |
|
| Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
Posted: Mon Nov 29, 2021 1:39 am Post subject: |
|
|
simo: This script separates out the custom queue part of the clonednicks.tcl
Look this over and see if it helps explain the custom queue any...
| Code: |
#### 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)
}
|
_________________ 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 Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Tue Nov 30, 2021 3:30 pm Post subject: |
|
|
| That explains it very well thanks SpiKe^^ |
|
| Back to top |
|
 |
|