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.

Help with a deop script

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Help with a deop script

Post by Football »

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

# 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.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

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.
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

yeah thats true, that would be better..
Idling at #Football, Quakenet.
Post Reply