egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

RAW 317 Idle response

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Tue Oct 04, 2005 1:37 am    Post subject: RAW 317 Idle response Reply with quote

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. Very Happy
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
spock
Master


Joined: 12 Dec 2002
Posts: 319

PostPosted: Tue Oct 04, 2005 3:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Tue Oct 04, 2005 8:26 pm    Post subject: Reply with quote

Thank you spock. It appears to have worked. Very Happy

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber