Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Kamian
Beginner


Joined: 25 Oct 2000
Posts: 11
Location: USA

PostPosted: 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
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: 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!
Reply with quote
Kamian
Beginner


Joined: 25 Oct 2000
Posts: 11
Location: USA

PostPosted: 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
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: 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!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
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

© 2009 Zugg Software. Hosted by Wolfpaw.net