egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Deop ops on inactivity & Reop on activity

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Football
Master


Joined: 26 Dec 2008
Posts: 205
Location: Quakenet, #Football

PostPosted: Fri Jun 04, 2010 2:49 pm    Post subject: Deop ops on inactivity & Reop on activity Reply with quote

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.
Back to top
View user's profile Send private message
tueb
Halfop


Joined: 04 Oct 2007
Posts: 76
Location: #quiz.de @ irc.gamesurge.net

PostPosted: Sun Jun 06, 2010 5:43 am    Post subject: Reply with quote

i hope this helps:

Code:
#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
Back to top
View user's profile Send private message Visit poster's website
Football
Master


Joined: 26 Dec 2008
Posts: 205
Location: Quakenet, #Football

PostPosted: Sun Jun 06, 2010 1:53 pm    Post subject: Reply with quote

[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.
Back to top
View user's profile Send private message
Behemoth
Voice


Joined: 19 May 2008
Posts: 20
Location: Mauritius

PostPosted: Sat Jun 26, 2010 10:35 am    Post subject: Reply with quote

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
_________________
Http://optix-pro.labrute.fr/
Http://ircaz.fr/

Losers Always Whine About Their Best, But Winners Go Home And F*** The Prom Queen!


Last edited by Behemoth on Tue Jul 20, 2010 11:03 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Football
Master


Joined: 26 Dec 2008
Posts: 205
Location: Quakenet, #Football

PostPosted: Wed Jul 14, 2010 12:52 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Wed Jul 14, 2010 2:36 pm    Post subject: Reply with quote

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:
Change this:
variable oplist ""

To this:
if {![info exists oplist]} { set oplist "" }

_________________
speechles' eggdrop tcl archive
Back to top
View user's profile Send private message
Football
Master


Joined: 26 Dec 2008
Posts: 205
Location: Quakenet, #Football

PostPosted: Thu Jul 15, 2010 8:08 am    Post subject: Reply with quote

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

Thanks!
_________________
Idling at #Football, Quakenet.
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Thu Jul 15, 2010 5:41 pm    Post subject: Reply with quote

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.
_________________
speechles' eggdrop tcl archive
Back to top
View user's profile Send private message
devilsoulblack
Halfop


Joined: 19 Nov 2003
Posts: 62
Location: Chile

PostPosted: Fri Sep 17, 2010 11:40 pm    Post subject: Reply with quote

thanks for shared
_________________
---------
Add [SOLVED] to the thread title if your issue has been.
Search - FAQ
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber