egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Detecting identical nicks within time frame
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
simo
Owner


Joined: 22 Mar 2015
Posts: 705

PostPosted: Thu Nov 25, 2021 3:38 pm    Post subject: Reply with quote

excellent loaded your latest posted code and it works flawlessly
thanks SpiKe^^ much apreciated
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 705

PostPosted: Fri Nov 26, 2021 5:50 am    Post subject: Reply with quote

I would like to thank CrazyCat as well much appreciated
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 705

PostPosted: Fri Nov 26, 2021 4:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 692
Location: Tennessee, USA

PostPosted: Mon Nov 29, 2021 1:39 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
simo
Owner


Joined: 22 Mar 2015
Posts: 705

PostPosted: Yesterday at 3:30 pm    Post subject: Reply with quote

That explains it very well thanks SpiKe^^
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber