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.

Problem with getchanidle in combination with aidle.tcl

Support & discussion of released scripts, and announcements of new releases.
Post Reply
c
cvanmeer
Halfop
Posts: 40
Joined: Tue Dec 02, 2003 1:00 pm
Location: The Netherlands
Contact:

Problem with getchanidle in combination with aidle.tcl

Post by cvanmeer »

Hi all,

I am trying to use the aidle.tcl script.
So I set the maxidle to 2 hours...so after 2 hours of idle time of the user in the channel, the user should be kicked.

But it's not working the way I supposed to.
It seems that the getchanidle is not the same as the WHOIS $nick $nick.

When I restart the bot, the getchanidle timer get's set to 0.
But at the same time, when I check the idle time of a user in my IRC client it says the user is idle for 2hr, 1m, 45s.

So for the script to be affective, the bot should never be restarted...and if it was restarted...it would take up to two hours to build up his own timer and then start kicking, while in that 2 hours...a user could be already idle for more than 2 hours (as seen in the IRC client)

I bet I'm not the first to run into this problem. Could someone tell me how to solve this?

Thx.
Chris
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Well, as you've already noticed, the getchanidle is not related to any WHOIS-info, but merely the difference of the time when the bot last saw any actions from the user, and "now". Thus, as it joins, that point in time becomes the last known time of activity.
WHOIS on the other hand, does not provide channel-specific timestamps, but merely when the user sent any kind of actions. Further, some (most?) networks only send the last action data for local clients, requiring remote server lookups. Add to that, the fact that WHOIS-lokups are generally more expensive than NAMES or WHO (which fetch a set of channel members rather than one nickname at a time), and it becomes rather obvious why eggdrop don't use WHOIS-timestamps for the getchanidle command.

To implement your own solution, you'd have to issue the proper whois-command, and catch the result using raw-bindings (sorry, don't remember the actual codes right now, but you'll find them in rfc1459 and the later updates).

Edit: Had the wrong rfc-document: 1459 is the correct one.
NML_375
c
cvanmeer
Halfop
Posts: 40
Joined: Tue Dec 02, 2003 1:00 pm
Location: The Netherlands
Contact:

Post by cvanmeer »

Thank you.
I've combined my script with a RAW 319 binding to check the 'complete' idle time. It's now working exactly as I planned :)
Post Reply