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
fattony
Apprentice


Joined: 27 Dec 2001
Posts: 105
Location: USA

PostPosted: Wed Mar 13, 2002 4:43 am   

Timers & Variables
 
I've been working with the #ALARM command for a couple weeks now, trying to figure out a way to make 4 timers (essentially the same as the tick timer). Basically, I have 4 things that I need to count from 1 to 100 seconds, and store each's current second in a variable that can be displayed in the status window. Is this possible?

Fat Tony
Reply with quote
dracx
Beginner


Joined: 14 Oct 2000
Posts: 26
Location: USA

PostPosted: Wed Mar 13, 2002 4:50 am   
 
Yes, but the commands in the alarm will need to update each variable's value each tick. something like this...

#ADD var1 -1
#ADD var2 -1
#ADD var3 -1
#ADD var4 -1

Each time the alarm goes off, each variable will be decremented, and it should update in the status window just peachily.

Dracx
Reply with quote
fattony
Apprentice


Joined: 27 Dec 2001
Posts: 105
Location: USA

PostPosted: Wed Mar 13, 2002 4:56 am   
 
How would that work though? The commands would only execute when the timer has reached the end, by my understanding.

Fat Tony
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Mar 13, 2002 1:44 pm   
 
Instead of having an alarm that fires every 100 second, you create an alarm that fires every second and a counter variable that is incremented every second. When the counter variable reaches 100, reset it to 0.

Kjata
Reply with quote
dracx
Beginner


Joined: 14 Oct 2000
Posts: 26
Location: USA

PostPosted: Thu Mar 14, 2002 3:18 am   
 
#ALARM * {#SAY this fires every second.}

Dracx
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