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 

Channel Limit Mod Help

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
sarius
Voice


Joined: 05 Aug 2005
Posts: 20

PostPosted: Sat Aug 06, 2005 9:47 am    Post subject: Channel Limit Mod Help Reply with quote

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. Very Happy
Back to top
View user's profile Send private message
demond
Revered One


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

PostPosted: Sat Aug 06, 2005 11:32 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
sarius
Voice


Joined: 05 Aug 2005
Posts: 20

PostPosted: Sat Aug 06, 2005 11:48 am    Post subject: Reply with quote

Awesome! Thanks heaps!
Back to top
View user's profile Send private message
sarius
Voice


Joined: 05 Aug 2005
Posts: 20

PostPosted: Sat Aug 06, 2005 1:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
demond
Revered One


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

PostPosted: Sat Aug 06, 2005 9:17 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
sarius
Voice


Joined: 05 Aug 2005
Posts: 20

PostPosted: Sun Aug 07, 2005 1:42 am    Post subject: Reply with quote

Dude it works!

I'm such a dumbass! LOL

I forgot to change the #channel. Embarassed

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive 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