Page 2 of 3
Re: Animated timers using Geyser
Posted: Mon Mar 04, 2013 10:20 pm
by demonnic
Thanks! I'm always happy to hear the stuff I've written has been found useful by someone. =)
Re: Animated timers using Geyser
Posted: Mon Sep 16, 2013 8:41 am
by Caled
Added a line (the first one) to one of the functions, to prevent errors if the timer hasn't been initialised for the first time yet:
function demonnic.anitimer:getTime(name)
if not demonnic.anitimer.timers[name] then return 0 end
local max = demonnic.anitimer.timers[name].max
local current = getStopWatchTime(demonnic.anitimer.timers[name].watch)
local newValue = max - current
return newValue
end
Edit: incidentally, thanks so much for this script. I'd been trying to create my own version for years, and now that I have it, I'm using them for all sorts of things. I've got my balances, my target's balances, and various other ticks like howls/roars, all synced and stacked on top of each other in prime screen-space.
Re: Animated timers using Geyser
Posted: Mon Sep 16, 2013 10:14 pm
by demonnic
Glad you're finding it useful! Though really, I just found something someone else had done, dusted it off, and bolted some bits on to make it a bit easier to use.
Re: Animated timers using Geyser
Posted: Sun Jan 26, 2014 2:22 pm
by icester
Any way to make this work instead of showing the number count down, just show a word?
otherwise its pretty nice and I've put it into my imperian system
Re: Animated timers using Geyser
Posted: Wed Jun 11, 2014 3:23 am
by demonnic
Updated with a new option for adding words to the text it shows.
it's between the showTime and css options, so if you're using css you'll need to adjust your calls if you update the code.
the code for the demo in the original post therefore becomes:
demonnic.newContainer = demonnic.newContainer or Geyser.Container:new({x=0, y=0, height=400, width = 200})
myCss1 = [[
border-width: 4px;
border-radius: 7;
border-color: red;
background-color: green;
]]
myCss2 = [[
border-width: 4px;
border-radius: 7;
border-color: green;
background-color: red;
]]
demonnic.anitimer:new("Test1", {x=200, y=100, height = 30, width = 300, color="red"}, 5)
demonnic.anitimer:new("Test2", {x = 0, y="50%", height = 20, width = "100%"}, 10, demonnic.newContainer, true,"Test2", myCss1, myCss2)
demonnic.anitimer:new("Test3", {x = 500, y = 300, height = 40, width = 100}, 8, "",false, "Test3", myCss2, myCss1)
demonnic.anitimer:new("Test4", {x=-20, y=0, height = 20, width = "100%"}, 18, demonnic.newContainer, false, "")
Re: Animated timers using Geyser
Posted: Thu Jun 12, 2014 8:40 am
by demonnic
2 quick updates.
2.2 - adds :pause(name), and :start(name) functionality, but leaves the :new() syntax the same
3.0 - adds :pauseAll(), :stopAll(), :startAll(), :destroy(name), and :destoryAll() functions. Also rewrote the constructor to be more like my align() series of functions. This makes it easier to add options to the constructor as needed.
Re: Animated timers using Geyser
Posted: Fri Feb 20, 2015 6:38 am
by baerden
Hi. I'm trying to pass a variable from a trigger to the gauge and its not working.
I have a perl regex trigger to capture the number.
Roundtime: (\d+) seconds.
And here is the rest of the script. Its failing to initialize a timer at all. How do I pass a variable to start a timer?
GuageRoundtime = matches[2]
demonnic.newContainer = demonnic.newContainer or Geyser.Container:new({x=0, y=0, height=400, width = 200})
myCss1 = [[
border-width: 4px;
border-radius: 7;
border-color: red;
background-color: green;
]]
myCss2 = [[
border-width: 4px;
border-radius: 7;
border-color: green;
background-color: red;
]]
demonnic.anitimer:new("Test1", {x=0, y=1337, height = 30, width = 300, color="red"}, GuageRoundtime)
Re: Animated timers using Geyser
Posted: Fri Feb 20, 2015 12:39 pm
by Belgarath
You're passing a string instead of an actual number. Try changing the variable line to:
GaugeRoundTime = tonumber(matches[2])
Re: Animated timers using Geyser
Posted: Fri Feb 20, 2015 7:06 pm
by baerden
Aha! That worked. I knew it had something to do with being a string but I wasn't sure how to deal with it.
Now I know, and knowing, is half the battle.
Go Joe!
Re: Animated timers using Geyser
Posted: Sun Aug 21, 2016 2:46 pm
by Vooku
I'm a real nub when it comes to this stuff so please bare with me....
How would I set up a bar to activate with a sample command? For example, I would like a 90 count down bar to start when I type in command 'X".
I'm sure it's simple, I just don't know where to start.