| View previous topic :: View next topic |
| Author |
Message |
Football Master
Joined: 26 Dec 2008 Posts: 205 Location: Quakenet, #Football
|
Posted: Fri Jan 28, 2011 4:00 am Post subject: Help with a deop script |
|
|
Can anyone please modify the following script so it will not deop certain hosts?
i.e. if I add *!*@*.users.quakenet.org, it won't deop anyone matching that.
Thanks
| Code: | # Channel
variable opchan "#EPL"
# Idle time in minutes
variable idletime 60
bind time - "* * * *" deop_user
if {![info exists oplist]} { set 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]} {
# Oprotate exemption: check if the user is a qualified op. If he/she is then check if without them there
# would be any qualified ops left. If not, then do not deop the user (requires oprotate.tcl to be loaded)
if {[namespace exists oprotate] && [channel get $opchan oprotate] && [oprotate::user_is_qualified_op $opchan $user] && [oprotate::find_best_qualified_op $opchan $user] == ""} {
# You can remove the line below (the putlog, not the return!) if this message is too spammy ;)
putlog "oprotate/deop: Not going to deop $user in $opchan because they are the only qualified op left."
return
}
pushmode $opchan "-o" $user
lappend oplist [getchanhost $user $opchan]
} elseif {[getchanidle $user $opchan] < $idletime && ![isop $user $opchan] && [lsearch -exact $oplist [getchanhost $user $opchan]] != -1} {
pushmode $opchan "+o" $user
}
}
}
|
_________________ Idling at #Football, Quakenet. |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Fri Jan 28, 2011 3:47 pm Post subject: |
|
|
hi,
won't it be easier to have a 'excepts' user where you will be adding what hosts you wish rather than having to edit the tcl file every time you want to make a change? _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
Football Master
Joined: 26 Dec 2008 Posts: 205 Location: Quakenet, #Football
|
Posted: Mon Jan 31, 2011 4:10 am Post subject: |
|
|
yeah thats true, that would be better.. _________________ Idling at #Football, Quakenet. |
|
| Back to top |
|
 |
|