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.
Help for those learning Tcl or writing their own scripts.
cannot_delete
Voice
Posts: 31 Joined: Fri Nov 24, 2006 5:31 am
Post
by cannot_delete » Mon Feb 19, 2007 10:44 am
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
cannot_delete
Voice
Posts: 31 Joined: Fri Nov 24, 2006 5:31 am
Post
by cannot_delete » Tue Feb 20, 2007 12:04 pm
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
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Tue Feb 20, 2007 2:16 pm
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.
cannot_delete
Voice
Posts: 31 Joined: Fri Nov 24, 2006 5:31 am
Post
by cannot_delete » Tue Feb 20, 2007 4:26 pm
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-
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Tue Feb 20, 2007 8:08 pm
Try the edited code above.
cannot_delete
Voice
Posts: 31 Joined: Fri Nov 24, 2006 5:31 am
Post
by cannot_delete » Wed Feb 21, 2007 6:58 am
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-
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Wed Feb 21, 2007 8:12 am
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.
cannot_delete
Voice
Posts: 31 Joined: Fri Nov 24, 2006 5:31 am
Post
by cannot_delete » Wed Feb 21, 2007 9:34 am
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-