| View previous topic :: View next topic |
| Author |
Message |
GeneticBro Voice
Joined: 06 Jan 2011 Posts: 3
|
Posted: Thu Jan 06, 2011 2:37 am Post subject: Deop on inactive/Reop on active modification |
|
|
Hello,
Can you tell me how to modify this script, to make it WORKING only with the users who are in the bot userlist with +o flag, and not to work (except the users) who have +mn?
| Code: |
variable opchan "#test"
variable idletime 480
bind time - "* * * *" deop_user
variable oplist ""
proc deop_user {a b c d e} {
global opchan idletime oplist
set users [lrange [chanlist $opchan] 1 end]
foreach user $users {
if {[getchanidle $user $opchan] >= $idletime && [isop $user $opchan] && ![isbotnick $user]} {
putserv "MODE $opchan -o $user"
lappend oplist [getchanhost $user $opchan]
} elseif {[getchanidle $user $opchan] < $idletime && ![isop $user $opchan]} {
if {[lsearch -exact $oplist [getchanhost $user $opchan]] != -1} {
putserv "MODE $opchan +o $user"
}
}
}
}
|
Big thanks in advance! |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Thu Jan 06, 2011 6:51 am Post subject: |
|
|
| Code: | foreach user $users {
if {[getchanidle $user $opchan] >= $idletime && [isop $user $opchan] && ![isbotnick $user]} { |
Change the above to look like it does below...
| Code: | foreach user $users {
if {[matchattr [nick2hand $user] mn|mn $chan]} { continue }
if {[getchanidle $user $opchan] >= $idletime && [isop $user $opchan] && ![isbotnick $user]} { |
_________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
GeneticBro Voice
Joined: 06 Jan 2011 Posts: 3
|
Posted: Thu Jan 06, 2011 10:02 am Post subject: |
|
|
| Thanks, it works. |
|
| Back to top |
|
 |
|