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
dazed-n-confused999
Wanderer


Joined: 03 Aug 2004
Posts: 79

PostPosted: Sun Dec 16, 2007 12:37 am   

timer with a count down
 
I'm trying to create a timer that starts at 8 seconds and counts back to 0 when I see the message "Hellish flames erupt from your surroundings*".
I would like for a variable to be redefined as the count decends, ie: @flametime = 8 then 7 then 6 ect.
I see this message every 8 seconds provided Im standing in an area with hellflames.
It would be really neat if this countdown would continue independently of the Hellish flames message once inniated, but would be reset if I re-entered a location with hellflames. I hope I have described this problem good enough. What I currently use is this:

Pattern: "Hellish flames erupt from your surroundings*"
Value: flametime = 8 then I use the wait option in states at 1000 ms then flametime = 7 down to 0

If I don't see the pattern again the timer stops, this is the main thing I would like to avoid if possible.
How do I keep the timer going without the pattern?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Dec 16, 2007 4:39 am   
 
Use an alarm:

#alarm "talmHellflames" *1 {#if (@HellFlameArea) {#if (@flametime) {#add flametime -1} {flametime = 8}} {flametime = 8;#T- talmHellflames}}

As long as the session remains open (doesn't matter if you went offline or not), this alarm will never stop. You will need to figure out how to determine if an area is a Hellflame area or not, and in that method you will simply need to set the @HellFlameArea variable to 1 (yes, it is) or 0 (no, it's not).
_________________
EDIT: I didn't like my old signature
Reply with quote
dazed-n-confused999
Wanderer


Joined: 03 Aug 2004
Posts: 79

PostPosted: Sun Dec 16, 2007 5:26 am   
 
Hey Matt, thanks for the reply.
It seems to be functioning, but at an extremely slow rate. It seems to be counting down in minuets perhaps.
I was hoping for the count down to be in seconds: 8 -7 - 6 - 5 - 4 - 3 - 2 - 1 - 0 - 8 - 7 - ect.
I added this to the pattern: "Hellish flames erupt from unseen holes in the ground to envelop your surroundings." is that correct?
How can I speed this up?
Reply with quote
dazed-n-confused999
Wanderer


Joined: 03 Aug 2004
Posts: 79

PostPosted: Sun Dec 16, 2007 6:24 am   
 
Nevermind, I screwed it up the first time.
I pasted it in again, and its working. Thanks.
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