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.

Flag except on idle-deop doesn't work.

Help for those learning Tcl or writing their own scripts.
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

If your trying to do this on a network with services.....
http://forum.egghelp.org/viewtopic.php?t=13262&start=2
it's already been realized.... :lol:
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

Code: Select all

-Bot- Sorry, but I can't adduser myself.

.+user Otherbotnick *!*@userbot.users.undernet.org
e
eXtremer
Op
Posts: 138
Joined: Wed May 07, 2008 5:33 am

Post by eXtremer »

speechles wrote:If your trying to do this on a network with services.....
http://forum.egghelp.org/viewtopic.php?t=13262&start=2
it's already been realized.... :lol:
No, I need it for Undernet (X)
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

I took the liberty to completely rewrite that script.

Code: Select all

namespace eval idle {
    variable author    "metroid"
    variable version   "1.0"
    
    variable activechans [list #chan1 #chan2 #chan3];
      
    # Idle time in minutes for ops. (set this to 0 to disable)
    variable idletime    30
    
    # Idle time in minutes for voiced users. (set this to 0 to disable)
    variable idletime_v  10
    
    # Nicknames that should always be excluded (the bot itself is always excluded)
    variable exempt_nick [list somenick someother_nick]
    
    # Botusers with these flags are also exempted
    variable exempt_flag "f|f"
    
    bind TIME -|- {* * * * *} [namespace current]::check
}

proc idle::check {args} {
    foreach channel $idle::activechans {
        if {!([validchan $channel] && [botonchan $channel] && [botisop $channel])} {
            continue;
        }
        
        foreach user [chanlist $channel] {
            if {[isbotnick $user]} {
                continue;
            }

            if {[lsearch -exact $idle::exempt_nick $user]} {
                continue;
            }
            
            set handle [nick2hand $user];
            
            if {[validuser $handle] && [matchattr $handle $idle::exempt_flag $channel]} {
                continue;
            }
            
            if {([isop $user $channel] && $idle::idletime && ([getchanidle $user $channel] > $idle::idletime))} {
                pushmode $channel -o $user
            } elseif {([isvoice $user $channel] && $idle::idletime_v && ([getchanidle $user $channel] > $idle::idletime_v))} {
                pushmode $channel -v $user
            }
        }
        
        flushmode $channel
    }
}

putlog "Inactive op/voice remover loaded."
[untested]
e
eXtremer
Op
Posts: 138
Joined: Wed May 07, 2008 5:33 am

Post by eXtremer »

metroid wrote:I took the liberty to completely rewrite that script.

Code: Select all

namespace eval idle {
    variable author    "metroid"
    variable version   "1.0"
    
    variable activechans [list #chan1 #chan2 #chan3];
      
    # Idle time in minutes for ops. (set this to 0 to disable)
    variable idletime    30
    
    # Idle time in minutes for voiced users. (set this to 0 to disable)
    variable idletime_v  10
    
    # Nicknames that should always be excluded (the bot itself is always excluded)
    variable exempt_nick [list somenick someother_nick]
    
    # Botusers with these flags are also exempted
    variable exempt_flag "f|f"
    
    bind TIME -|- {* * * * *} [namespace current]::check
}

proc idle::check {args} {
    foreach channel $idle::activechans {
        if {!([validchan $channel] && [botonchan $channel] && [botisop $channel])} {
            continue;
        }
        
        foreach user [chanlist $channel] {
            if {[isbotnick $user]} {
                continue;
            }

            if {[lsearch -exact $idle::exempt_nick $user]} {
                continue;
            }
            
            set handle [nick2hand $user];
            
            if {[validuser $handle] && [matchattr $handle $idle::exempt_flag $channel]} {
                continue;
            }
            
            if {([isop $user $channel] && $idle::idletime && ([getchanidle $user $channel] > $idle::idletime))} {
                pushmode $channel -o $user
            } elseif {([isvoice $user $channel] && $idle::idletime_v && ([getchanidle $user $channel] > $idle::idletime_v))} {
                pushmode $channel -v $user
            }
        }
        
        flushmode $channel
    }
}

putlog "Inactive op/voice remover loaded."
[untested]
good job metroid ;)

Is it possible to notice the user why he was deoped ?

-Bot- You $nick was deoped because...bla bla bla

?
e
eXtremer
Op
Posts: 138
Joined: Wed May 07, 2008 5:33 am

Post by eXtremer »

I'm testing now the script & it seems that is not working

# Idle time in minutes for ops. (set this to 0 to disable)
variable idletime 2

*** Idle time for Lr_test (~test@???.8.41.74): 14mins 3secs
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

That's because getchanidle is not the same result as what the ircd server may report.
e
eXtremer
Op
Posts: 138
Joined: Wed May 07, 2008 5:33 am

Post by eXtremer »

metroid wrote:That's because getchanidle is not the same result as what the ircd server may report.
I don't kow about the getchanidle, but the script is not working, the user
did not say something on the chan for about 10 minutes, still no deop comes..
e
eXtremer
Op
Posts: 138
Joined: Wed May 07, 2008 5:33 am

Post by eXtremer »

It seems that there is no good idle-deop script :(
Post Reply