|
Kamian Beginner
Joined: 25 Oct 2000 Posts: 11 Location: USA
|
Posted: Sat Dec 04, 2010 7:53 pm
%time |
how would one go about adding time to the %time?
time format is: Sat Dec 4 14:52:52 2010
I would want to add, say.. 45 mins to that.. put that in a variable, and display the new time variable |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Mon Dec 06, 2010 12:51 am |
You don't change the %time. It is a fixed (built-in) function. What you can do is use the %secs variable and store the result in a variable. Then you can write your own function to covert it into time. If you search the forums I'm sure some variations have been posted in the past.
|
|
_________________ Asati di tempari! |
|
|
|
Kamian Beginner
Joined: 25 Oct 2000 Posts: 11 Location: USA
|
Posted: Mon Dec 06, 2010 4:18 pm |
I've looked a bit, didn't see much (could be wrong)..
so basically, read in the time into @seconds variable using the %secs, add in 2700 (in the above example, 45 mins), then convert it back to hh:mm format?
I'm wanting to recieve in a repop message from the mud, mark that time, add the amount of time until the next repop, and display it all in the status bar:
Area: The Forgotten Woods Repop time: 14:45 Estimated next repop: 15:30 |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Mon Dec 06, 2010 6:20 pm |
Yes you can do that.
Here's a simple function to do what you want.
Code: |
#function SecondsToLongTime {%if( %isnum( %1), %eval( %1/86400) days %mod( %1/3600, 24) hours %mod( %1/60, 60) minutes %mod( %1, 60) seconds, ERROR: argument passed must be a number)} |
|
|
_________________ Asati di tempari! |
|
|
|
|
|