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 on inactive/Reop on active modification

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


Joined: 06 Jan 2011
Posts: 3

PostPosted: Thu Jan 06, 2011 2:37 am    Post subject: Deop on inactive/Reop on active modification Reply with quote

Hello,

Can you tell me how to modify this script, to make it WORKING only with the users who are in the bot userlist with +o flag, and not to work (except the users) who have +mn?
Code:

variable opchan "#test"
variable idletime 480

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"
         }
      }
    }
}


Big thanks in advance!
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 Jan 06, 2011 6:51 am    Post subject: Reply with quote

Code:
foreach user $users {
      if {[getchanidle $user $opchan] >= $idletime && [isop $user $opchan] && ![isbotnick $user]} {

Change the above to look like it does below...
Code:
    foreach user $users {
      if {[matchattr [nick2hand $user] mn|mn $chan]} { continue }
      if {[getchanidle $user $opchan] >= $idletime && [isop $user $opchan] && ![isbotnick $user]} {

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


Joined: 06 Jan 2011
Posts: 3

PostPosted: Thu Jan 06, 2011 10:02 am    Post subject: Reply with quote

Thanks, it works.
Back to top
View user's profile Send private message
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