Originally Posted by cokedrivers
I was wondering if there is a way to add a count down timer to the frame that you click enter dungeon on to show exactly how long you have. Lately ive qued for ramdoms and been in the middle of a quest and would like to lnow how long I have u ntill the window closes.
I am on my phone right now but with /fstack I was able to get the frame name. I would something like
Code:
countdowntimer = CreateFrame ("Frame", nil, (the frames name))
countdowntimer:SetPoint ("BOTTOM", (the frame name), 0, 0)
to create a frame to put the count down in.
Ive seen DBM have a count down stays bar show. But I'm just looking for a numeric count down nothing dance.
Ill look threw DBM maybe I can find how they get the timer info.
Coke
|
The basic function is simple enough. I use this for a pull timer, though it uses a chat output
Lua Code:
local pull, seconds, onesec
local frame = CreateFrame("Frame")
frame:Hide()
frame:SetScript("OnUpdate", function(self, elapsed)
--Start DBM pull timer
onesec = onesec - elapsed
pull = pull - elapsed
if pull <= 0 then
SendChatMessage("Pulling!", cfg.channelannounce)
self:Hide()
elseif onesec <= 0 then
SendChatMessage(seconds, cfg.channelannounce)
seconds = seconds - 1
onesec = 1
end
end)
SlashCmdList["COUNTDOWN"] = function(t)
t = tonumber(t) or 6
pull = t + 1
seconds = t
onesec = 1
frame:Show()
end
SLASH_COUNTDOWN1 = "/inc"
just replace SendChatMessage and a few other things with a status bar fill I imagine.