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 Oct 12, 2002 8:22 pm   

Timer
 
Hi again.

I have a problem with a timer.
I want a timer to count how many seconds my shild is up.
Say that I start a timmer when I have casted the magical shield, and
it will count until the shild drop. Then I want to save that time in a
variable. Can someone maybe help me with this?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Oct 12, 2002 9:33 pm   
 
There's only one timer (the tick timer), and it counts down, not up. The way to do this is to record the start time and subtract it from the stop time.
#AL {shield} {cast shield;#VAR shieldstart %secs}
#TR {shield drops} {#MATH shieldtime {(%secs - @shieldstart)/1000};#IF (@shieldtime < 0) {#ADD shieldtime 86400}}

LightBulb
Senior 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