| View previous topic :: View next topic |
| Author |
Message |
sarius Voice
Joined: 05 Aug 2005 Posts: 20
|
Posted: Sat Aug 06, 2005 9:47 am Post subject: Channel Limit Mod Help |
|
|
Hihi
I'm currently using chanlimit1.5.tcl by slennox and I think it's a fab script. But I would like to modify it a little and I need help to do it.
Basically I just want my bot to set the total channel limit to:
(Number of ops) + (Number of Voice) + (variable setting)
Can anyone provide some advice as to how to do this?
Thanks alot and much appreciated.  |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sat Aug 06, 2005 11:32 am Post subject: |
|
|
| Code: |
set numops 0; set numvoices 0
foreach n [chanlist $chan] {
if [isop $n $chan] {incr numops}
if [isvoice $n $chan] {incr numvoices}
}
set limit [expr $numops + $numvoices + $somevar]
|
|
|
| Back to top |
|
 |
sarius Voice
Joined: 05 Aug 2005 Posts: 20
|
Posted: Sat Aug 06, 2005 11:48 am Post subject: |
|
|
| Awesome! Thanks heaps! |
|
| Back to top |
|
 |
sarius Voice
Joined: 05 Aug 2005 Posts: 20
|
Posted: Sat Aug 06, 2005 1:37 pm Post subject: |
|
|
Think I must have coded it wrong. Didn't work. Can you help me check if I edited it right? Thnks.
| Code: |
proc cl_dolimit {} {
global cl_chans cl_limit cl_grace cl_timer
timer $cl_timer cl_dolimit
foreach chan [string tolower [channels]] {
if {$cl_chans != ""} {
if {[lsearch -exact [split $cl_chans] [string tolower $chan]] == -1} {continue}
}
if {![botisop $chan]} {continue}
set numops 0; set numvoices 0
foreach n [chanlist $chan] {
if [isop $n $chan] {incr numops}
if [isvoice $n $chan] {incr numvoices}
}
set newlimit [expr $numops + $numvoices + $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
}
|
|
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sat Aug 06, 2005 9:17 pm Post subject: |
|
|
it's not wrong, but what's the meaning of cl_limit? normally, the chanlimit, if being enforced automatically, needs to be the number of total channel users (ops & voices included) + some slack constant (usually in the 5-10 range), so calculating ops & voices for that purpose dosn't really make much sense
if you are pretty new to eggdrop and Tcl, I'd suggest you stick with popular scripts by respected authors for now, without trying to patch these (they've been known to be working pretty well for quite some time now) |
|
| Back to top |
|
 |
sarius Voice
Joined: 05 Aug 2005 Posts: 20
|
Posted: Sun Aug 07, 2005 1:42 am Post subject: |
|
|
Dude it works!
I'm such a dumbass! LOL
I forgot to change the #channel.
You're a genius!!!
Thanks again.
The reason is because I have set the bot to auto-notice everyone who joins to type /msg botnick voiceme. When a non-clone sees that he will type it and get autovoice. Then my bot will check every minute to see if the limit needs to be increased.
Oh and cl_limit is actually that slack variable. Which is your somevar. Now if only I can figure out how to change that in irc.
Cheersss! |
|
| Back to top |
|
 |
|