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.
Old posts that have not been replied to for several years.
^DooM^
Owner
Posts: 772 Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:
Post
by ^DooM^ » Fri Sep 05, 2003 3:30 pm
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
Any help would be greatly appreciated. Thanks again
^DooM^
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Fri Sep 05, 2003 3:55 pm
There's a command called 'duration' in eggdrop (check doc/tcl-commands.doc)
^DooM^
Owner
Posts: 772 Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:
Post
by ^DooM^ » Fri Sep 05, 2003 4:03 pm
I did read that but it converts from seconds rather than minutes and i dont know how to convert minutes to seconds either.
GodOfSuicide
Master
Posts: 463 Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria
Post
by GodOfSuicide » Fri Sep 05, 2003 4:12 pm
^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
^DooM^
Owner
Posts: 772 Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:
Post
by ^DooM^ » Fri Sep 05, 2003 4:36 pm
lol i know how many seconds are in a minute
What i meant was i dont know how in code to transform 1 minute into seconds
GodOfSuicide
Master
Posts: 463 Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria
Post
by GodOfSuicide » Fri Sep 05, 2003 7:03 pm
^DooM^ wrote: lol i know how many seconds are in a minute
What i meant was i dont know how in code to transform 1 minute into seconds
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*
^DooM^
Owner
Posts: 772 Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:
Post
by ^DooM^ » Sat Sep 06, 2003 2:10 am
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^
GodOfSuicide
Master
Posts: 463 Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria
Post
by GodOfSuicide » Sat Sep 06, 2003 4:36 am
^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"]
^DooM^
Owner
Posts: 772 Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:
Post
by ^DooM^ » Sat Sep 06, 2003 6:22 am
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