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.

GetChanIdle Help

Old posts that have not been replied to for several years.
Locked
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

GetChanIdle Help

Post by ^DooM^ »

Hello again :)

I need Some help transforming the idle minutes stored by getchanidle to "months weeks days hours minutes seconds". rather than having it bring back something silly like 10324 minutes idle :P

Any help would be greatly appreciated. Thanks again

^DooM^
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

There's a command called 'duration' in eggdrop (check doc/tcl-commands.doc)
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

duration

Post by ^DooM^ »

I did read that but it converts from seconds rather than minutes and i dont know how to convert minutes to seconds either. :cry:
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Re: duration

Post by GodOfSuicide »

^DooM^ wrote:i dont know how to convert minutes to seconds either.
ok, here comes the math teacher again...

1 minute = 60 secs
1 sec = 1/60 min

so what makes 5 minutes in seconds ? -> 5 * 60

and if you want to do it with the "clock format" function you may have a look at the docs or see http://forum.egghelp.org/viewtopic.php?t=5499 for an example
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

lol i know how many seconds are in a minute :D What i meant was i dont know how in code to transform 1 minute into seconds :P
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

^DooM^ wrote:lol i know how many seconds are in a minute :D What i meant was i dont know how in code to transform 1 minute into seconds :P
i'm sorry if i dont really get what you mean...

Code: Select all

proc makesec { mins } {
return [expr $mins *60]
}
is this what you ment ? the TCL code for this mathematic idea ? *confused*
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

That is what i wanted to know thanks. Can i use -format "%m %w %d %H %M %S" with "expr" ?

Sorry if you dont understand me im still a n00b at scripting really.

Thanks again

^DooM^
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

^DooM^ wrote:-format "%m %w %d %H %M %S" with "expr" ?
this -format is a parameter of the clock format command

Code: Select all

This would be the current date + time:
[clock format [clock seconds] -format "%m %w %d %H %M %S"]

This would be the current date + time + 8 minutes
[clock format [expr [clock seconds] + 8 * 60] -format "%m %w %d %H %M %S"]
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

Ill give it a try and get back to you. Thanks again
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
Locked