#Count Up Timer

16 messages · Page 1 of 1 (latest)

lucid robin
#

I'd like to create a timer that starts counting up each time I case one of two spells. I think I have that working so far with (first screenshot).

however I'm not quite sure how to display the timer correctly.

I found an existing weak aura (https://wago.io/m7b4fnvch)from long ago that did this, but its timer function is outputting huge numbers ```function()

local timer = aura_env.timestamp - GetTime()
timer = tonumber(timer) * -1
timer = string.format("%.1f", timer)

return timer

end```

Is there a simple way to make a count up timer?

red lotus
#

if you only have two trigger then your custom activation isn't necessary. You can use Any Trigger as Required for Activation.

As for your custom text the numbers are huge because GetTime() returns the length of time that your computer has been online in seconds.

#

you'll want to normalize that by getting the current time + the duration you want your timer to be. Then calculate how much time is left until your timer expires and get the inverse of that.

lucid robin
#

So it's more I just want to see how long it's been since I last cast one of the spells I'm tracking. So I just want it to count up from 0 and then reset once I cast the spell again

red lotus
#

Then you want to mark the time you casted the spell and then compare that to the current time

lucid robin
#

Although I may just make things easier and just use the hides option of the trigger and set the timer to the time I want to cast it to

red lotus
#

those timers will probably be counting down

lucid robin
#

but I'll take a look at yours!

red lotus
#

it's the same idea as the one you posted

#

you changed the trigger in that aura you can't do that.

red lotus
lucid robin
#

❤️

#

ah, I didn't update to spellname2 in the 2nd OR clause

#

was close...thanks again