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
Iccor
Newbie


Joined: 21 Dec 2002
Posts: 9
Location: USA

PostPosted: Mon Dec 23, 2002 11:14 pm   

countdown
 
anyone know a good way to count down from a set number of seconds to zero?
don't want to reinvent the wheel


Iccor
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Dec 23, 2002 11:26 pm   
 
If you want to perform some specific action after a set number of seconds, then you could do this, for example:
#ALARM {+5} {Commands to execute after 5 seconds}

Otherwise, if what you want is just the countdown, then you need an alarm that goes off every second and disable it once the countdown stops:
#ALARM "countdown" {*1} {#ADD counter -1;#IF (@counter < 1) {#T- countdown}}

To start the countdown, just set the value of @counter to whatever you want and enable the alarm.

Kjata
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