Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
chris_c300
Newbie


Joined: 19 Dec 2008
Posts: 7

PostPosted: Mon Feb 09, 2009 3:20 am   

Eq or Balance Timer
 
Hi, I have been trying to make a gauge button that depletes over time to tell me graphically how much longer my Equilibrium or Balance time is left. Here is my trigger:

Code:

<trigger priority="590120" id="59019">
  <pattern>^Equilibrium Used: &amp;eq_add seconds$</pattern>
  <value>#add eq_time @eq_add
#alarm eq {*0.25} {#add eq_time -0.25;#if (@eq_time<=0) {#alarm eq {+0.1} {eq_time=0}}}</value>
</trigger>


I now have a gauge button set to @eq_time and it works, sort of, just a bit choppy. I am wondering if there is another way of doing it, making it more efficient, instead of firing a trigger every 0.25 seconds. Thanks in advance.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Mon Feb 09, 2009 6:05 am   
 
The choppiness may be because the max precision on a repeating alarm is half a second. It's a pretty good approach and you should be set.
_________________
Asati di tempari!
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Feb 09, 2009 7:18 am   
 
Actually, that's not true. A repeating alarm can repeat as quickly as you like, but a quarter of a second (which this alarm uses) still isn't fast enough to look smooth. Unfortunately there's no easy way to set up a gauge like that for a smooth transition in CMUD, and reducing the interval between updates just means you'll be running more script more often and updating the screen more, which will cause some serious slowdown unless your computer is Chuck Norris. So, basically, that's the best you can do.

It's non-repeating alarms that have the limit, and then it's that the minimum time between creation and execution is 0.5 seconds. They can still be 0.75 seconds, or whatever.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
chris_c300
Newbie


Joined: 19 Dec 2008
Posts: 7

PostPosted: Mon Feb 09, 2009 7:38 am   
 
Oh okay, thanks! Very Happy
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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