|
chris_c300 Newbie
Joined: 19 Dec 2008 Posts: 7
|
Posted: 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: &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. |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: 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! |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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. |
|
|
|
chris_c300 Newbie
Joined: 19 Dec 2008 Posts: 7
|
Posted: Mon Feb 09, 2009 7:38 am |
Oh okay, thanks!
|
|
|
|
|
|