| View previous topic :: View next topic |
| Author |
Message |
cannot_delete Voice
Joined: 24 Nov 2006 Posts: 31
|
Posted: Mon Feb 19, 2007 10:44 am Post subject: simple anti idle |
|
|
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 |
|
 |
cannot_delete Voice
Joined: 24 Nov 2006 Posts: 31
|
Posted: Tue Feb 20, 2007 12:04 pm Post subject: |
|
|
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 |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Tue Feb 20, 2007 2:16 pm Post subject: |
|
|
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 |
|
 |
cannot_delete Voice
Joined: 24 Nov 2006 Posts: 31
|
Posted: Tue Feb 20, 2007 4:26 pm Post subject: |
|
|
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 |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
|
| Back to top |
|
 |
cannot_delete Voice
Joined: 24 Nov 2006 Posts: 31
|
Posted: Wed Feb 21, 2007 6:58 am Post subject: |
|
|
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 |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Wed Feb 21, 2007 8:12 am Post subject: |
|
|
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 |
|
 |
cannot_delete Voice
Joined: 24 Nov 2006 Posts: 31
|
Posted: Wed Feb 21, 2007 9:34 am Post subject: |
|
|
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 |
|
 |
|