View Single Post
05-08-14, 10:47 PM   #2
10leej
A Molten Giant
 
10leej's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2011
Posts: 583
Originally Posted by cokedrivers View Post
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:
  1. local pull, seconds, onesec
  2. local frame = CreateFrame("Frame")
  3. frame:Hide()
  4. frame:SetScript("OnUpdate", function(self, elapsed)
  5.     --Start DBM pull timer
  6.     onesec = onesec - elapsed
  7.     pull = pull - elapsed
  8.     if pull <= 0 then
  9.         SendChatMessage("Pulling!", cfg.channelannounce)
  10.         self:Hide()
  11.     elseif onesec <= 0 then
  12.         SendChatMessage(seconds, cfg.channelannounce)
  13.         seconds = seconds - 1
  14.         onesec = 1
  15.     end
  16. end)
  17. SlashCmdList["COUNTDOWN"] = function(t)
  18.     t = tonumber(t) or 6
  19.     pull = t + 1
  20.     seconds = t
  21.     onesec = 1
  22.     frame:Show()
  23. end
  24. SLASH_COUNTDOWN1 = "/inc"

just replace SendChatMessage and a few other things with a status bar fill I imagine.
__________________
Tweets YouTube Website
  Reply With Quote