View previous topic :: View next topic |
Author |
Message |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Tue Oct 04, 2005 1:37 am Post subject: RAW 317 Idle response |
|
|
Code: | # 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.  _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
Back to top |
|
 |
spock Master
Joined: 12 Dec 2002 Posts: 319
|
Posted: Tue Oct 04, 2005 3:00 pm Post subject: |
|
|
Code: |
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? |
|
Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Tue Oct 04, 2005 8:26 pm Post subject: |
|
|
Thank you spock. It appears to have worked.
Here's the code snippet. I am testing it in xchat before moving it to eggdrop.
Code: | # 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:
Quote: | 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 |
|
Back to top |
|
 |
|