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.

Channel Limit Mod Help

Old posts that have not been replied to for several years.
Locked
s
sarius
Voice
Posts: 20
Joined: Fri Aug 05, 2005 10:30 am

Channel Limit Mod Help

Post by sarius »

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. :D
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

Code: Select all

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]
s
sarius
Voice
Posts: 20
Joined: Fri Aug 05, 2005 10:30 am

Post by sarius »

Awesome! Thanks heaps!
s
sarius
Voice
Posts: 20
Joined: Fri Aug 05, 2005 10:30 am

Post by sarius »

Think I must have coded it wrong. Didn't work. Can you help me check if I edited it right? Thnks.

Code: Select all

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
    }
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

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)
s
sarius
Voice
Posts: 20
Joined: Fri Aug 05, 2005 10:30 am

Post by sarius »

Dude it works!

I'm such a dumbass! LOL

I forgot to change the #channel. :oops:

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!
Locked