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.

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

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
C
Ciber
Voice
Posts: 3
Joined: Wed Aug 02, 2006 8:22 pm

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

Post by Ciber »

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 :)!
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

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: Select all

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 :)
C
Ciber
Voice
Posts: 3
Joined: Wed Aug 02, 2006 8:22 pm

Post by Ciber »

Thanks :D
Post Reply