greetings , i use this channel limiter wich seems to work well only when using in multi channels and the bot is restarted it doesnt calculate users currently in channel and adding channel limit instead it sets +l 3 wich is channel limit
locking channel leaving no space for anyone to join
would it be possible to make it calculate for all channels where the script is active the correct chan limit so channel is not locked
##############################
## ------------------------ ##
## 10. Channel Limit Script ##
## ------------------------ ##
##############################
#Channels in which to activate limiting, this should be a list like
#"#elephants #wildlife #etc". Leave it set to "" if you wish to activate
#limiting on all channels the bot is on.
set cl_chans ""
#Limit to set (number of users on the channel + this setting)
set cl_limit "3"
#Limit grace (if the limit doesn't need to be changed by more than this,
#don't bother setting a new limit)
set cl_grace "1"
# Frequency of checking whether a new limit needs to be set (in seconds)
set cl_utimer "8"
bind join - "*" limit:chng:on:bot:join
proc limit:chng:on:bot:join {nick uhost hand chan} {
global cl_chans limit_delay
if {[isbotnick $nick] && ([lsearch -exact [split [string tolower $cl_chans]] [string tolower $chan]] != -1)} {
set limit_delay([string tolower $chan]) 1
utimer 3 [list unset limit_delay([string tolower $chan])]
}
}
proc cl_dolimit {} {
global cl_chans cl_limit cl_grace cl_utimer limit_delay
utimer $cl_utimer cl_dolimit
foreach chan [string tolower [channels]] {
if {$cl_chans != ""} {
if {([lsearch -exact [split [string tolower $cl_chans]] [string tolower $chan]] == -1)} { continue }
}
if {[info exists limit_delay($chan)]} { continue }
if {![botisop $chan]} { continue }
set numusers [llength [chanlist $chan]]
set newlimit [expr $numusers + $cl_limit]
if {[string match "*l*" [lindex [getchanmode $chan] 0]]} {
set currlimit [string range [getchanmode $chan] [expr [string last " " [getchanmode $chan]] + 1] end]
} else {
set currlimit 0
}
if {$newlimit == $currlimit} { continue }
if {$newlimit > $currlimit} {
set difference [expr $newlimit - $currlimit]
} elseif {$currlimit > $newlimit} {
set difference [expr $currlimit - $newlimit]
}
if {$difference <= $cl_grace} { continue }
putquick "MODE $chan +l $newlimit" -next
}
}
proc cl_startlimit {} {
global cl_utimer
if {[string match "*cl_dolimit*" [utimers]]} { return 0 }
utimer $cl_utimer cl_dolimit
}
cl_startlimit
if {$cl_chans == ""} {
putlog "Loaded chanlimit.tcl v1.5 by slennox (active on all channels)"
} else {
putlog "Loaded chanlimit.tcl v1.5 by slennox (active on: [join $cl_chans ", "])"
}
this is what happens and bear in mind at that time there are no joins parts quits :
22:05:34 22:05:34 Join : EagleEye eagle@168.235.76.154
22:05:34 ChanServ Sets Mode on #ChatHeaven to: +o EagleEye
22:05:49 @EagleEye Sets Mode on #ChatHeaven to: +l 6
22:06:30 @EagleEye Sets Mode on #ChatHeaven to: +l 78
22:06:39 @EagleEye Sets Mode on #ChatHeaven to: +l 78
22:06:48 @EagleEye Sets Mode on #ChatHeaven to: +l 78
22:06:53 @EagleEye Sets Mode on #ChatHeaven to: +l 78
22:07:04 @EagleEye Sets Mode on #ChatHeaven to: +l 78
22:36] * sedition sets mode: -l
[22:36] <sedition> :P
[22:36] * JulieTh sets mode: +l 7
##############################
## ------------------------ ##
## 10. Channel Limit Script ##
## ------------------------ ##
##############################
#Channels in which to activate limiting, this should be a list like
#"#elephants #wildlife #etc". Leave it set to "" if you wish to activate
#limiting on all channels the bot is on.
set cl_chans "#tcls #eggdrop"
#Limit to set (number of users on the channel + this setting)
set cl_limit "5"
#Limit grace (if the limit doesn't need to be changed by more than this,
#don't bother setting a new limit)
set cl_grace "2"
# Frequency of checking whether a new limit needs to be set (in seconds)
set cl_utimer "8"
bind join - "*" limit:chng:on:bot:join
proc limit:chng:on:bot:join {nick uhost hand chan} {
global cl_chans limit_delay
if {[isbotnick $nick] && ([lsearch -exact [split [string tolower $cl_chans]] [string tolower $chan]] != -1)} {
set limit_delay([string tolower $chan]) 1
utimer 3 [list unset limit_delay([string tolower $chan])]
}
}
proc cl_dolimit {} {
global cl_chans cl_limit cl_grace cl_utimer limit_delay
utimer $cl_utimer cl_dolimit
foreach chan [string tolower [channels]] {
if {$cl_chans != ""} {
if {([lsearch -exact [split [string tolower $cl_chans]] [string tolower $chan]] == -1)} { continue }
}
if {[info exists limit_delay($chan)]} { continue }
if {![botisop $chan]} { continue }
set numusers [llength [chanlist $chan]]
set newlimit [expr $numusers + $cl_limit]
if {[string match "*l*" [lindex [getchanmode $chan] 0]]} {
set currlimit [string range [getchanmode $chan] [expr [string last " " [getchanmode $chan]] + 1] end]
} else {
set currlimit 0
}
if {$newlimit == $currlimit} { continue }
if {$newlimit > $currlimit} {
set difference [expr $newlimit - $currlimit]
} elseif {$currlimit > $newlimit} {
set difference [expr $currlimit - $newlimit]
}
if {$difference <= $cl_grace} { continue }
putserv "MODE $chan +l $newlimit" -next
}
}
proc cl_startlimit {} {
global cl_utimer
if {[string match "*cl_dolimit*" [utimers]]} { return 0 }
utimer $cl_utimer cl_dolimit
}
cl_startlimit
if {$cl_chans == ""} {
putlog "Loaded chanlimit.tcl v1.5 by slennox (active on all channels)"
} else {
putlog "Loaded chanlimit.tcl v1.5 by slennox (active on: [join $cl_chans ", "])"
}
Ive been having a similar issue, but I think it may be a combined issue...
I run bots on undernet, all are eggdrop1.6.21
I tried using just about all TCL scripts involving Channel Limiting, this includes single channel scripts and multi channel scripts. The same issue exist with all of them in the same manner.
Even have a similar issue with getops3.0c.tcl and older versions...
I am begining to think it could be an eggdrop issue?
Right now I use both of slennox's scripts, chanlimit1.5.tcl and the above mentioned getops.
The channel limit seams to correctly set for one or two channels, but it seams as if a couple others set lower than the amount of users in the channel. ex: 20 users, bot sets limit to +l 10
Sometimes if I rehash, it corrects itself, but later reverts to the above mentioned issue. .restart starts the issue instantly...
If a bot or shell restarts, then bot tries to rejoin, the getops script tries to raise the limit above the users, but some bots set it lower causing a flood of +l mode changes each with a different amount.
I have seen a few comments about a simple change to the limit script, but the same issue exist, and yet still have the issue with getops... getops is the least of my worries, but the limit issue is aggravating...
Im focussed at the scripts by slennox...
I used to use mc.limit.tcl, but it dissapeared sometime ago and would love to have it back if someone has a copy floating around so I can try it... Would be greatly appreciated..
I will be recompiling with 1.3.28 on one of my shells to see if it makes a difference later today.
I have noticed other issues too with other certain scripts, bots not properly setting channel specific flags for users through sharing. I could go on, but its all small stuff, not trying to make this look like a huge ordeal...
SpiKe^^ wrote:
I have done quite a bit of testing on this deal and agree with you that it is an Eggdrop issue.
Edit: er maybe not:)
Maybe not? Tried with 1.3.28 and scripts relevant to the version (which is most), not having the same issue until eggdrop 1.6... Even 1.5.4 yielded same as 1.3.28, all working...
Unfortunately, My shells will not 'make' older versions of eggdrop, so I tested on FreeBSD 9.3 on my own box and all went well...
So now to figure out what the issue is between the script and eggdrop1.6.21