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 

Flag except on idle-deop doesn't work.
Goto page Previous  1, 2
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
speechles
Revered One


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

PostPosted: Fri May 23, 2008 11:26 am    Post subject: Reply with quote

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


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Fri May 23, 2008 11:32 am    Post subject: Reply with quote

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



.+user Otherbotnick *!*@userbot.users.undernet.org
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
eXtremer
Op


Joined: 07 May 2008
Posts: 138

PostPosted: Sat May 24, 2008 6:03 am    Post subject: Reply with quote

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.... Laughing


No, I need it for Undernet (X)
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Sun May 25, 2008 5:33 pm    Post subject: Reply with quote

I took the liberty to completely rewrite that script.


Code:
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]
Back to top
View user's profile Send private message
eXtremer
Op


Joined: 07 May 2008
Posts: 138

PostPosted: Mon May 26, 2008 2:31 am    Post subject: Reply with quote

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


Code:
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 Wink

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

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

?
Back to top
View user's profile Send private message
eXtremer
Op


Joined: 07 May 2008
Posts: 138

PostPosted: Mon May 26, 2008 2:54 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Mon May 26, 2008 12:53 pm    Post subject: Reply with quote

That's because getchanidle is not the same result as what the ircd server may report.
Back to top
View user's profile Send private message
eXtremer
Op


Joined: 07 May 2008
Posts: 138

PostPosted: Tue May 27, 2008 1:45 am    Post subject: Reply with quote

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


Joined: 07 May 2008
Posts: 138

PostPosted: Wed May 28, 2008 4:30 am    Post subject: Reply with quote

It seems that there is no good idle-deop script Sad
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 -> Scripting Help All times are GMT - 4 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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