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.

RAW 317 Idle response

Old posts that have not been replied to for several years.
Locked
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

RAW 317 Idle response

Post by Alchera »

Code: Select all

# RPL_WHOISIDLE
set idle [clock format [expr 25200+[lindex $whodata 1]] -format "%T"]
The above line to calculate the idle time of a user in the whois response is incorrect and every effort I have tried to correct this has failed. I am definitely missing something. Any assistance with getting the correct formula will be greatly appreciated. :D
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

Code: Select all

bind raw - 317 raw:idle
proc raw:idle { f k a } {
  putlog [bla [lindex [split $a] 2]]
  return 0
}
proc bla s {return "[expr $s/3600]:[expr $s/60%60]:[expr $s%60]"}
dont know if this is what you were trying to do (im assuming your $whodata == $a in the example code above, in which case you would be adding 25200 to the target nickname of your whois.)
care to explain what that 25200 is for?
photon?
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Thank you spock. It appears to have worked. :D

Here's the code snippet. I am testing it in xchat before moving it to eggdrop.

Code: Select all

# RPL_WHOISIDLE
on 317 mywhois {
      set whodata [split $_rest " "]
      set idle [idle [lindex [split $whodata] 1]]
      print ([network]-whois) "---\t\002      Idle\017: $idle, \002Signon\017: [clock format [lindex $whodata 2] -format "%a, %b %d %T"]"
  complete EAT_ALL
}

proc idle s {return "[expr $s/3600]:[expr $s/60%60]:[expr $s%60]"}
The resultant output:
Idle: 0:10:31, Signon: Tue, Oct 04 05:28:34
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Locked