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.

Deop ops on inactivity & Reop on activity

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

Deop ops on inactivity & Reop on activity

Post by Football »

I need a script that will deop the users on one hour of inactivity and reop them once they are active again (hop a channel, change nick, talks..)

Please help!
Idling at #Football, Quakenet.
t
tueb
Halfop
Posts: 76
Joined: Thu Oct 04, 2007 6:09 am
Location: #quiz.de @ irc.gamesurge.net
Contact:

Post by tueb »

i hope this helps:

Code: Select all

#your channel:
variable opchan "#channel"
#idle time in minutes:
variable idletime 60

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"
         }
      }
    }
}
#Quiz.de @ irc.GameSurge.net
JavaChat
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

[20:46:57] * Collina sets mode: -o Xabriel
[20:52:37] <Xabriel> no games on tonight
[20:52:39] <Xabriel> not usedto that
[20:52:40] <Xabriel> hrmm
[20:52:57] * Collina sets mode: +o Xabriel

Works, thanks!
Idling at #Football, Quakenet.
B
Behemoth
Voice
Posts: 20
Joined: Mon May 19, 2008 7:23 am
Location: Mauritius
Contact:

Post by Behemoth »

Hello there..
this script works well

but one more thing i would like to know...
is it possible to add a line where it can exempt some specific ops of specific channels plz ??

thnkx
Last edited by Behemoth on Tue Jul 20, 2010 11:03 am, edited 1 time in total.
Http://optix-pro.labrute.fr/
Http://ircaz.fr/

Losers Always Whine About Their Best, But Winners Go Home And F*** The Prom Queen!
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

tueb, is it possible to edit the script so that when I rehash/restart it, it won't forget who should be opped/deopped on activity/inactivity?
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 »

Football wrote:tueb, is it possible to edit the script so that when I rehash/restart it, it won't forget who should be opped/deopped on activity/inactivity?

Code: Select all

Change this:
variable oplist "" 

To this:
if {![info exists oplist]} { set oplist "" }
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

speechles, it will work only on rehash not on restart right?

Thanks!
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 »

Football wrote:speechles, it will work only on rehash not on restart right?

Thanks!
Correct, to have it "remember" what it knows after a .restart would require using an external file to keep track of your $oplist. Using a bind on pre-rehash/restart to trigger a procedure that saves the $oplist. Then when restarting/rehasing you can use this kind of logic ( if {![info exists oplist]} { ...load $oplist from external file here... } ). The ![info exists] part is used to keep it from affecting rehashing. The $oplist will still exist during rehash.
User avatar
devilsoulblack
Halfop
Posts: 62
Joined: Wed Nov 19, 2003 9:18 pm
Location: Chile
Contact:

Post by devilsoulblack »

thanks for shared
---------
Add [SOLVED] to the thread title if your issue has been.
Search - FAQ
Post Reply