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
takke
Beginner


Joined: 11 Oct 2002
Posts: 29
Location: Sweden

PostPosted: Sat May 24, 2003 1:34 am   

Timer problems
 
Hi
I just this trigger to calculate the duration of a skill/spell. I works just fine in zmud 6.16 but now I have upgraded to 6.62 and now it's fucked up. For some reason the counter starts over at 60 sec or earlier and I can figure out why. Can someone plz help me with this problem.

Here is the trigger:
#math current %time( hhmm)*60-%time( hh)*2400+%time( ss)
#if (@wctime <> "OFF") {#math wctime @current-@wc}
#if (@denttime <> "OFF") {#math denttime @current-@dentt}
#if (@iwtime <> "OFF") {#math iwtime @current-@iw}
#if (@paintime <> "OFF") {#math paintime @current-@pain}
#if (@phystime <> "OFF") {#math phystime @current-@phys}
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat May 24, 2003 4:18 am   
 
Why this particular formula? You're trying to figure the number of seconds since midnight?
%time(hhmm) * 60 = 60*hh*100 + 60*mm = 6000hh + 60mm
-%time(hh)*2400 = -2400hh
so, that's
6000-2400hh + 60mm = 3600hh + 60mm?

But why not just compute it directly?
(%time( hh) * 3600) + (%time( mm) * 60) + %time( ss)

Anyway, whichever formula you use be sure to evaluate it.
#MATH current %eval((%time( hh) * 3600) + (%time( mm) * 60) + %time( ss))

It would appear that something changed between 6.16 and 6.62 so that #MATH no longer automatically evaluates the %time function.

LightBulb
Advanced Member
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