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.

Chanlimit

Support & discussion of released scripts, and announcements of new releases.
Post Reply
r
ranny
Halfop
Posts: 49
Joined: Wed Jun 22, 2005 2:00 pm
Location: switzerland

Chanlimit

Post by ranny »

Hello,

i have chanlimit.tcl

Code: Select all

#  ChanLimit.tcl by Nils Ostbjerg <shorty@business.auc.dk>
#  (C) Copyright (1999)
#
#  This script will limit a channel to the current number of users plus
#  5 once every min.
#
#  This version of the ChanLimit script is useable with Eggdrop version
#  1.3.x
#
#  Please report any bugs to me at shorty@business.auc.dk.
#  Idea and suggestion to new features are also welcome.
#
#                                 - Nils Ostbjerg <shorty@business.auc.dk>
#
#  Version 1.3.2 - 19 Jun 2000  Made a grademargin so if the limit only 
#                               needs to be change by 1 then it wont get 
#                               changed. Thanks to Harvey for this idea.
#                                 - Nils Ostbjerg <shorty@business.auc.dk>
#
#  Version 1.3.1 - 30 Nov 1999  Minor cosmetic changes, so that all my 
#                               scripts follow the same scheme. 
#                                 - Nils Ostbjerg <shorty@business.auc.dk>
#
#  Version 1.3.0 - 30 Mar 1999  First version and should work ok
#                                 - Nils Ostbjerg <shorty@business.auc.dk>
# 

##########################################################################
# Binds                                                                  #
##########################################################################

bind time - "* * * * *" time:ChanLimit

##########################################################################
# time:ChanLimit start                                                   #
##########################################################################

proc time:ChanLimit {min hour day month year} {
    foreach chan [channels] {
	set newlimit [expr [llength [chanlist $chan]] + 5]
	set currentlimit [currentlimit $chan]
	if {$currentlimit < [expr $newlimit - 0] || $currentlimit > [expr $newlimit + 0]} {
	    putserv "mode $chan +l $newlimit"
	}
    }    
}

##########################################################################
# time:ChanLimit end                                                     #
##########################################################################

##########################################################################
# currentlimit start                                                     #
##########################################################################

proc currentlimit {chan} {
    set currentmodes [getchanmode $chan]
    if {[string match "*l*" [lindex $currentmodes 0]]} {
	return [lindex $currentmodes end] 
    }
    return 0
}

##########################################################################
# currentlimit end                                                       #
##########################################################################

##########################################################################
# putlog                                                                 #
##########################################################################
 
putlog "Loaded ChanLimit (DLF)"
and i have this error in partyline
<Eggy> [23:59] (!) timer drift -- spun 58 minutes
<Eggy> [00:00] --- Wed Dec 28 2005
<Eggy> [00:00] Backing up channel file...
<Eggy> [00:00] #team: mode change '+l 94' by Eggy!~teambot@d83-180-88-184.bluewin.ch
<Eggy> [00:00] #team: mode change '+l 94' by Eggy!~teambot@d83-180-88-184.bluewin.ch
<Eggy> [00:00] #team: mode change '+l 94' by Eggy!~teambot@d83-180-88-184.bluewin.ch
<Eggy> [00:00] #team: mode change '+l 94' by Eggy!~teambot@d83-180-88-184.bluewin.ch
<Eggy> [00:00] #team: mode change '+l 94' by Eggy!~teambot@d83-180-88-184.bluewin.ch
....
....
And i must restart eggdrop for stop this :?:

:?: :?:
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Use another chanlimit script, for example slennox's.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

ranny wrote:<Eggy> [23:59] (!) timer drift -- spun 58 minutes
It appears it has nothing to do with the script. I have used that particular one since late 2000; error free to date. :D
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

Alchera wrote:
ranny wrote:<Eggy> [23:59] (!) timer drift -- spun 58 minutes
It appears it has nothing to do with the script. I have used that particular one since late 2000; error free to date. :D
it has severe flaws, namely failing to account for channel dynamics by join/part/quit/kick and working by timer only

for correct limiter implementation (that should come as no surprise for you :P) see xchannel (SirFz's should also be properly coded by now)
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

I must be blessed. It's been faultless for almost 5 yrs ... no error recorded to date; lucky me. :wink:
--> Professional_Killer (~Shooter@202.142.152.3) has joined #ballarat
* Enfield sets channel limit to 46
The limit is adjusted only as channel numbers increase/decrease. It's short, simple and it works. Try it.

Either way, beside the point. The information posted references 'timer drift' and that is the actual problem encountered, not the script.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

Alchera wrote:I must be blessed. It's been faultless for almost 5 yrs ... no error recorded to date; lucky me. :wink:
you've been blessed with pretty quiet channel; if your users' average join rate was more than 5/min, this thing wouldn't be able to cope with that since it only adjusts +l once a minute with a slack of 5
The limit is adjusted only as channel numbers increase/decrease. It's short, simple and it works. Try it.
it works for you, for the above reason; nevertheless, it's naively implemented and won't work well on fast-paced channels

btw that line is amusing:

Code: Select all

if {$currentlimit < [expr $newlimit - 0] || $currentlimit > [expr $newlimit + 0]} { 
even Tosser would have written simply:

Code: Select all

if {$currentlimit != $newlimit} {
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Nothing is perfect demond, and nothing you've written is either. Is a brave person that poses as infallible. 8)
<Eggy> [23:59] (!) timer drift -- spun 58 minutes
The above was his problem; not the script.

@ ranny: http://forum.egghelp.org/viewtopic.php? ... ight=drift
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Post Reply