| View previous topic :: View next topic |
| Author |
Message |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
|
| Back to top |
|
 |
Nor7on Op

Joined: 03 Mar 2007 Posts: 185 Location: Spain - Barcelona
|
Posted: Fri May 23, 2008 11:32 am Post subject: |
|
|
| Code: | | -Bot- Sorry, but I can't adduser myself. |
.+user Otherbotnick *!*@userbot.users.undernet.org |
|
| Back to top |
|
 |
eXtremer Op
Joined: 07 May 2008 Posts: 138
|
Posted: Sat May 24, 2008 6:03 am Post subject: |
|
|
No, I need it for Undernet (X) |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Sun May 25, 2008 5:33 pm Post subject: |
|
|
I took the liberty to completely rewrite that script.
| Code: | namespace eval idle {
variable author "metroid"
variable version "1.0"
variable activechans [list #chan1 #chan2 #chan3];
# Idle time in minutes for ops. (set this to 0 to disable)
variable idletime 30
# Idle time in minutes for voiced users. (set this to 0 to disable)
variable idletime_v 10
# Nicknames that should always be excluded (the bot itself is always excluded)
variable exempt_nick [list somenick someother_nick]
# Botusers with these flags are also exempted
variable exempt_flag "f|f"
bind TIME -|- {* * * * *} [namespace current]::check
}
proc idle::check {args} {
foreach channel $idle::activechans {
if {!([validchan $channel] && [botonchan $channel] && [botisop $channel])} {
continue;
}
foreach user [chanlist $channel] {
if {[isbotnick $user]} {
continue;
}
if {[lsearch -exact $idle::exempt_nick $user]} {
continue;
}
set handle [nick2hand $user];
if {[validuser $handle] && [matchattr $handle $idle::exempt_flag $channel]} {
continue;
}
if {([isop $user $channel] && $idle::idletime && ([getchanidle $user $channel] > $idle::idletime))} {
pushmode $channel -o $user
} elseif {([isvoice $user $channel] && $idle::idletime_v && ([getchanidle $user $channel] > $idle::idletime_v))} {
pushmode $channel -v $user
}
}
flushmode $channel
}
}
putlog "Inactive op/voice remover loaded." |
[untested] |
|
| Back to top |
|
 |
eXtremer Op
Joined: 07 May 2008 Posts: 138
|
Posted: Mon May 26, 2008 2:31 am Post subject: |
|
|
| metroid wrote: | I took the liberty to completely rewrite that script.
| Code: | namespace eval idle {
variable author "metroid"
variable version "1.0"
variable activechans [list #chan1 #chan2 #chan3];
# Idle time in minutes for ops. (set this to 0 to disable)
variable idletime 30
# Idle time in minutes for voiced users. (set this to 0 to disable)
variable idletime_v 10
# Nicknames that should always be excluded (the bot itself is always excluded)
variable exempt_nick [list somenick someother_nick]
# Botusers with these flags are also exempted
variable exempt_flag "f|f"
bind TIME -|- {* * * * *} [namespace current]::check
}
proc idle::check {args} {
foreach channel $idle::activechans {
if {!([validchan $channel] && [botonchan $channel] && [botisop $channel])} {
continue;
}
foreach user [chanlist $channel] {
if {[isbotnick $user]} {
continue;
}
if {[lsearch -exact $idle::exempt_nick $user]} {
continue;
}
set handle [nick2hand $user];
if {[validuser $handle] && [matchattr $handle $idle::exempt_flag $channel]} {
continue;
}
if {([isop $user $channel] && $idle::idletime && ([getchanidle $user $channel] > $idle::idletime))} {
pushmode $channel -o $user
} elseif {([isvoice $user $channel] && $idle::idletime_v && ([getchanidle $user $channel] > $idle::idletime_v))} {
pushmode $channel -v $user
}
}
flushmode $channel
}
}
putlog "Inactive op/voice remover loaded." |
[untested] |
good job metroid
Is it possible to notice the user why he was deoped ?
-Bot- You $nick was deoped because...bla bla bla
? |
|
| Back to top |
|
 |
eXtremer Op
Joined: 07 May 2008 Posts: 138
|
Posted: Mon May 26, 2008 2:54 am Post subject: |
|
|
I'm testing now the script & it seems that is not working
# Idle time in minutes for ops. (set this to 0 to disable)
variable idletime 2
*** Idle time for Lr_test (~test@???.8.41.74): 14mins 3secs |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Mon May 26, 2008 12:53 pm Post subject: |
|
|
| That's because getchanidle is not the same result as what the ircd server may report. |
|
| Back to top |
|
 |
eXtremer Op
Joined: 07 May 2008 Posts: 138
|
Posted: Tue May 27, 2008 1:45 am Post subject: |
|
|
| metroid wrote: | | That's because getchanidle is not the same result as what the ircd server may report. |
I don't kow about the getchanidle, but the script is not working, the user
did not say something on the chan for about 10 minutes, still no deop comes.. |
|
| Back to top |
|
 |
eXtremer Op
Joined: 07 May 2008 Posts: 138
|
Posted: Wed May 28, 2008 4:30 am Post subject: |
|
|
It seems that there is no good idle-deop script  |
|
| Back to top |
|
 |
|