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 

Random User checks, if channel has under 5 users leave.

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Ciber
Voice


Joined: 02 Aug 2006
Posts: 3

PostPosted: Thu Aug 03, 2006 1:37 pm    Post subject: Random User checks, if channel has under 5 users leave. Reply with quote

Okay, i'd like a script mainly to prevent abuse and make the bot avalible to others more. I want it to do a check on join, and maybe a check every 20 mins to see if the channel has 5+ users. If under 5 users it will leave the channel.

Thanks Smile!
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Fri Aug 04, 2006 4:00 pm    Post subject: Reply with quote

You can't do a check onjoin since the bot doesn't know how many people are on a channel when it joins, for a simple check (every 10 minutes)

Code:
bind TIME -|- {?0 * * * *} check:stuff

proc check:stuff {args} {
  foreach channel [channels] {
    if {[expr [clock seconds] - [getchanjoin $::botnick $channel]] > 60} {
      # only continue if we joined more than 60 seconds ago
      if {[llength [chanlist $channel]] < 5} {
        channel remove $channel
      }
    }
  }
}


Untested, i'm not exactly sure if the getchanjoin part will work as planned Smile
Back to top
View user's profile Send private message
Ciber
Voice


Joined: 02 Aug 2006
Posts: 3

PostPosted: Fri Aug 04, 2006 4:11 pm    Post subject: Reply with quote

Thanks Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests 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