This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Detecting identical nicks within time frame

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
s
simo
Revered One
Posts: 1072
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

excellent loaded your latest posted code and it works flawlessly
thanks SpiKe^^ much apreciated
s
simo
Revered One
Posts: 1072
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

I would like to thank CrazyCat as well much appreciated
s
simo
Revered One
Posts: 1072
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

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
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

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: 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)
}

SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
s
simo
Revered One
Posts: 1072
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

That explains it very well thanks SpiKe^^
Post Reply