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.

simple anti idle

Help for those learning Tcl or writing their own scripts.
Post Reply
c
cannot_delete
Voice
Posts: 31
Joined: Fri Nov 24, 2006 5:31 am

simple anti idle

Post by cannot_delete »

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

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

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
c
cannot_delete
Voice
Posts: 31
Joined: Fri Nov 24, 2006 5:31 am

Post by cannot_delete »

I changed the whole thing to this:

Code: Select all

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
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Try

Code: Select all

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.
Last edited by Sir_Fz on Tue Feb 20, 2007 8:07 pm, edited 1 time in total.
c
cannot_delete
Voice
Posts: 31
Joined: Fri Nov 24, 2006 5:31 am

Post by cannot_delete »

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-
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Try the edited code above.
c
cannot_delete
Voice
Posts: 31
Joined: Fri Nov 24, 2006 5:31 am

Post by cannot_delete »

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-
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

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.
c
cannot_delete
Voice
Posts: 31
Joined: Fri Nov 24, 2006 5:31 am

Post by cannot_delete »

thx for clearing that up. I should have been more precise. here's the corrected version:
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-
Post Reply