| View previous topic :: View next topic |
| Author |
Message |
Ciber Voice
Joined: 02 Aug 2006 Posts: 3
|
Posted: Thu Aug 03, 2006 1:37 pm Post subject: Random User checks, if channel has under 5 users leave. |
|
|
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 ! |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Fri Aug 04, 2006 4:00 pm Post subject: |
|
|
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  |
|
| Back to top |
|
 |
Ciber Voice
Joined: 02 Aug 2006 Posts: 3
|
Posted: Fri Aug 04, 2006 4:11 pm Post subject: |
|
|
Thanks  |
|
| Back to top |
|
 |
|