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.

GLOBAL idle time

Old posts that have not been replied to for several years.
Locked
j
jamesp0tter
Voice
Posts: 10
Joined: Wed Jan 29, 2003 7:23 pm

GLOBAL idle time

Post by jamesp0tter »

well, how do i get that exactly?
too bad 'getchanidle' only workz 4 messages for that chan, i need it to get the global idle, the one that appears when you whois the nick..
as (in my irc network) that kind of info only appears if you're connected in the same server as the 'whoised', what doesn't really happen at all & i need it always :|

any way to do this or am i just asking too much? :)

tkx in advance

**P.S: yes, i did search the forum, lots of times.. if i missed 'it' pls reply with the link :) tkx
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Usually you can type "/whois somenick somenick" (twice like that) and then it shows you the idle time. If that doesn't work, then you're out of luck I think.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

From RFC 1459:

WHOIS <nick> - This is a local request. Only the information cached on the server this is sent to, will return data.

WHOIS <nick> <nick> - This is a remote request. This request will traverse IRC server, until it reaches the server, on which <nick> is connected. This server will send the reply with it's cached data.

Only the server on which <nick> is connected, caches IDLE time information.

Eggdrops getchanidle is done using a internal caching functions. It works out when the last time <nick> performed a action. AT no point, does eggdrop make a request for such information from the IRC server.

To extract global information like idle time, from the server, you will need to make a script, that requests the WHOIS information, and extracts the details from the reply.

This can only be done in an asycronous way. Meaning you can't pause in a script, until you get the reply.
j
jamesp0tter
Voice
Posts: 10
Joined: Wed Jan 29, 2003 7:23 pm

Post by jamesp0tter »

hum tks!
that won't do for what i need, i can't be whois'ing 60+ people each minute to get their idle.. i'll keep it as chan idle.

i didn't know 'bout that 2 nick trick.. ehe, tks 4 your reply :p []
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Code: Select all

proc getlowidle {nick} {
  set idle 999999
  foreach chan [channels] {
    if {([set t [getchanidle $nick $chan]] < $idle)  && [getchanidle $nick $chan] != 0)} {  set idle $t }
  }
  return $idle
}
There is a quick jimmy of code that will look at each channel, and work out the users lowest idle time.

It uses a fake 999999 idle time, to start the countdown. While not likely, if there idle time is greater, then the fake 999999 is returned, plus, if they are not on any channels the bot monitors, it will also return 999999.

There are far more smarter ways to do this, including working out the highest idle time, then the lowest (produces a better base idle time), returning -1 if the user isn't on channels.
E
EwarWoo

Post by EwarWoo »

Theres a script called onlinetime.tcl that upon a trigger will strip a users idle time/online time from info it gains with a .whois nick nick.
Maybe a read of that one would help you :)
Locked