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 

simple anti idle

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
cannot_delete
Voice


Joined: 24 Nov 2006
Posts: 31

PostPosted: Mon Feb 19, 2007 10:44 am    Post subject: simple anti idle Reply with quote

Hi,

I extracted the following script from an anti-idle script. Unfortunally it also exectutes when the bot hasn't idled but every 30 min. I could use some help on how to change that.

thx,

-typ-



Code:
timer 30 moxquiz_pub_allstarstyp


proc moxquiz_pub_allstarstyp {} {


        set arg 10
        set mirror "#Quiz.de"

    mx_spit_allstars "PRIVMSG" $mirror $arg
timer 30 moxquiz_pub_allstarstyp
}



/edit:

could I use "getchanidle"?

I tried:

Code:
set idle_1 "1"
set mainchan "#channel"
set idlebot "Botnick"
set idle_idle "[getchanidle $idlebot $mainchan]"


if {$idle_idle > $idle_1} {idle_bind}



proc idle_bind {handle idx arg} { ... }




but it didn't work
Back to top
View user's profile Send private message
cannot_delete
Voice


Joined: 24 Nov 2006
Posts: 31

PostPosted: Tue Feb 20, 2007 12:04 pm    Post subject: Reply with quote

I changed the whole thing to this:

Code:
bind time - * check:idle

proc check:idle {args} {

set idle_1 "1"
set mainchan "#Quiz.de"
set idlebot "MowlBot"
set idle_idle "[getchanidle $idlebot $mainchan]"


if {$idle_idle > $idle_1} {moxquiz_pub_allstarstyp}
}

proc moxquiz_pub_allstarstyp {args} {



putquick "PRIVMSG #Quiz.de :tescht"
}



But the PRIVMSG is shown if the bot doesn't idles as well. =/

Any input is welcome.

thx,

typ
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Feb 20, 2007 2:16 pm    Post subject: Reply with quote

Try
Code:
bind time - * check:idle

proc check:idle args {
 set mainchan "#Quiz.de"
 set idlebot "MowlBot"
 if {[getchanidle $idlebot $mainchan] >= 10} {
   putquick "PRIVMSG $mainchan :tescht"
 }
}

This checks if idle is equal or greater than 10 minutes.

Edit: Fixed the code.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts


Last edited by Sir_Fz on Tue Feb 20, 2007 8:07 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
cannot_delete
Voice


Joined: 24 Nov 2006
Posts: 31

PostPosted: Tue Feb 20, 2007 4:26 pm    Post subject: Reply with quote

hi,

thx. but I have the same problem with your code. it seems like the problem exists because the bot checks its own ilde-time.

-typ-
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Feb 20, 2007 8:08 pm    Post subject: Reply with quote

Try the edited code above.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
cannot_delete
Voice


Joined: 24 Nov 2006
Posts: 31

PostPosted: Wed Feb 21, 2007 6:58 am    Post subject: Reply with quote

same thing


I still think the problem is the bot checking itslef for beeing idle. another bot checking it gives me the actual idle-time. my bot checking itself gives me the uptime.

-typ-
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Feb 21, 2007 8:12 am    Post subject: Reply with quote

You just don't understand what getchanidle does. It returns the time in minutes how much the bot has been idle on that channel and has nothing to do with the idle info in the whois reply.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
cannot_delete
Voice


Joined: 24 Nov 2006
Posts: 31

PostPosted: Wed Feb 21, 2007 9:34 am    Post subject: Reply with quote

thx for clearing that up. I should have been more precise. here's the corrected version:

Quote:
same thing

I still think the problem is the bot checking itslef for beeing idle on that chan. another bot checking it gives me the actual idle-time on that chan. my bot checking itself gives me the uptime.

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