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


Joined: 30 May 2002
Posts: 25
Location: USA

PostPosted: Sat Sep 28, 2002 2:31 am   

Help with a countdown timer?
 
Yeah, me again. Another bout of personal stupidity. I feel as if the answer to this problem is within my grasp, yet still elusive. It would seem straightforward enough...

The MOO outputs a estimated time of arrival in a format similar to "XX minutes and XX seconds" or just "XX minutes" if you catch it on an even 60 seconds or sometimes "XX seconds" if you're within 60 seconds of your destination. So the first hurdle is getting one trigger to capture three different outputs, similar outputs. Or do I use three similar triggers?

Next, I want to have a simple countdown timer in a seperate window or perhaps in a gauge of some sort. It doesn't need to execute a command at 0 or anything fancy, just tell me how long until I get to my destination.

I could use the #MESSage window, but to use it as a countdown timer causes some funky things to happen with other windows (flashing and such). Is there some other way to do this? Should I just use a gauge, then?

And by what method do I get it to display the time? Preferably in a (min):(sec) format.

-McGravin
Non plaudite, modo pecuniam jacite.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Sep 28, 2002 5:16 am   
 
#CLASS {ETACapture} {"enable"}
#VAR ETA {} {0}
#VAR ETAStart {0} {0}
#TRIGGER {(%d) ({minutes|seconds})(*)$} {ETA=0;#IF ("%2"="minutes") {#ADD ETA %eval(%1*60);#IF ("%3"!=%null) { #ADD ETA %word(%trim("%3"),2)}} { ETA=%1};ETAStart=%ctime;#ADD ETA @ETAStart;#T+ ETAGuage}
#CLASS 0

#CLASS {ETACapture|ETAGuage} {"disable"}
#BUTTON 1 {ETA: %eval((@ETA-%ctime)/60) min %mod(%eval(@ETA-%ctime),60) sec} {} {} {} {@ETA-%ctime} {} {} {} {} {} {} {} {} {} {} {Gauge|9|12|@ETA-@ETAStart|0} {} "" {"Explore"|"Inset"} {} {}
#CLASS 0

I put the guage in a sperate class so it can be hidden when not in use. I am assuming that your MOO tells you when you have actually arrived so you can turn the class off and get rid of the button. The colors make it a little hard to read, but I would expect those would have to be adjusted in any case.
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