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.

A small adjustment

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

A small adjustment

Post by Football »

Hey, need a small adjustment for this script.

Need an exception for someone using the nick 'ZoD' i.e. the bot won't deop him no matter how long he's idle. please help.

Code: Select all

# Channel
variable opchan "#Football" 

# 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
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Code: Select all

# Channel
variable opchan "#Football"

# build your exempt list here, use lowercase for matching purposes.
variable exempted_from_deop [list "nick1" "nick2" "nick3" "etc"]

# 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 exempted_from_deop
	set users [lrange [chanlist $opchan] 1 end]

	foreach user $users {
		if {[getchanidle $user $opchan] >= $idletime && [isop $user $opchan] && ![isbotnick $user] && [lsearch -exact $exempted_from_deop [string tolower $user]] == -1} {

			# 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 Wink
				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
		}
	}
}
########################################################################################defeatWordWrap########################################################################################
Last edited by speechles on Thu Jun 16, 2011 9:33 pm, edited 2 times in total.
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

Works great! thanks speechless!
Idling at #Football, Quakenet.
Post Reply