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 

Chanlimit

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
ranny
Halfop


Joined: 22 Jun 2005
Posts: 49
Location: switzerland

PostPosted: Tue Dec 27, 2005 7:16 pm    Post subject: Chanlimit Reply with quote

Hello,

i have chanlimit.tcl

Code:
#  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
Quote:
<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 Question

Question Question
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Dec 27, 2005 7:19 pm    Post subject: Reply with quote

Use another chanlimit script, for example slennox's.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Tue Dec 27, 2005 7:34 pm    Post subject: Reply with quote

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. Very Happy
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Wed Dec 28, 2005 1:05 am    Post subject: Reply with quote

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. Very Happy


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 Razz) 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] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Wed Dec 28, 2005 2:46 am    Post subject: Reply with quote

I must be blessed. It's been faultless for almost 5 yrs ... no error recorded to date; lucky me. Wink

Quote:
--> 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
Back to top
View user's profile Send private message Visit poster's website
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Wed Dec 28, 2005 3:30 am    Post subject: Reply with quote

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

Quote:
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:

if {$currentlimit < [expr $newlimit - 0] || $currentlimit > [expr $newlimit + 0]} {

even Tosser would have written simply:
Code:

if {$currentlimit != $newlimit} {

_________________
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Wed Dec 28, 2005 9:10 am    Post subject: Reply with quote

Nothing is perfect demond, and nothing you've written is either. Is a brave person that poses as infallible. Cool

Quote:
<Eggy> [23:59] (!) timer drift -- spun 58 minutes

The above was his problem; not the script.

@ ranny: http://forum.egghelp.org/viewtopic.php?t=4067&highlight=drift
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Page 1 of 1

 
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