View Single Post
05-15-13, 11:30 AM   #7
10leej
A Molten Giant
 
10leej's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2011
Posts: 583
Well gosh, glad you guys took to helping me optimize it

Also looks like
Code:
SlashCmdList["DEADLYBOSSMODS"]("pull ".. seconds)
Will simulate the /pull command for DBM

So the current script stands at
Lua Code:
  1. local pull, seconds, onesec
  2. local frame = CreateFrame("Frame")
  3.  
  4. frame:Hide()
  5. frame:SetScript("OnUpdate", function(self, elapsed)
  6.     --Start DBM pull timer
  7.     onesec = onesec - elapsed
  8.     pull = pull - elapsed
  9.     if pull <= 0 then
  10.         SendChatMessage("Pulling!", "SAY")
  11.         self:Hide()
  12.     elseif onesec <= 0 then
  13.         SendChatMessage(seconds, "SAY")
  14.         seconds = seconds - 1
  15.         onesec = 1
  16.     end
  17.     if IsAddOnLoaded("DBM-Core") then
  18.         SlashCmdList["DEADLYBOSSMODS"]("pull ".. seconds)
  19.     end
  20. end)
  21.  
  22. SlashCmdList["COUNTDOWN"] = function(t)
  23.     t = tonumber(t) or 6
  24.     pull = t + 1
  25.     seconds = t
  26.     onesec = 1
  27.     frame:Show()
  28. end
  29.  
  30. SLASH_COUNTDOWN1 = "/inc"

course running that will cause 50 million DBM timer bars
__________________
Tweets YouTube Website

Last edited by 10leej : 05-15-13 at 04:53 PM.
  Reply With Quote