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

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
G
GeneticBro
Voice
Posts: 3
Joined: Thu Jan 06, 2011 2:34 am

Deop on inactive/Reop on active modification

Post by GeneticBro »

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

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

foreach user $users {
      if {[getchanidle $user $opchan] >= $idletime && [isop $user $opchan] && ![isbotnick $user]} { 
Change the above to look like it does below...

Code: Select all

    foreach user $users {
      if {[matchattr [nick2hand $user] mn|mn $chan]} { continue }
      if {[getchanidle $user $opchan] >= $idletime && [isop $user $opchan] && ![isbotnick $user]} { 
G
GeneticBro
Voice
Posts: 3
Joined: Thu Jan 06, 2011 2:34 am

Post by GeneticBro »

Thanks, it works.
Post Reply