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
cachew
Novice


Joined: 10 May 2001
Posts: 39
Location: USA

PostPosted: Wed Oct 08, 2003 5:31 pm   

Math on a clock
 
I am displaying a clock on a button. I am using the script from "Making a clock" post, by Kjata. I am also inputing time from the mud to initialize the variables with the correct system time.

I can't seem to figure out where, or in which manner to apply the math to convert the clock from a system time to a game time. The ratio of time is 3:2 3 game hours per 2 real hours. The MUD is on a 16 hour day. 8 morning 8 night. Should I just be multiplying one of the clock values by .66 ? Is that the best or only way ?

I have read a few posts that refer to this same issue buy try as I might I cant get it to work properly. I know this isn't diffucult but its escaping me. Thanks for whatever help you can provide.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Oct 08, 2003 9:25 pm   
 
Kjata's script

To do a 3:2 ratio, add 3 to gametime for every 2 realtime.
For 16 hours instead of 24, change the max hours.

#VAR hours 0
#VAR mins 0
#VAR secs 0
#ALARM {*2} {#ADD secs 3;#IF (@secs >= 60) {#ADD mins 1;#VAR secs 0};#IF (@mins >= 60) {#ADD hours 1;#VAR mins 0};#IF (@hours >= 16) {#VAR hours 0}}
#STATUS {MUD Time: @hours:@mins}
#ALIAS settime {#VAR hours %1;#VAR mins %2;#VAR secs 0}
Reply with quote
cachew
Novice


Joined: 10 May 2001
Posts: 39
Location: USA

PostPosted: Wed Oct 08, 2003 10:23 pm   
 
Thanks alot lightbulb. I really appreciate it.
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