Jump to content


Photo

Starting DBM pull timer via 3rd party lua


  • Please log in to reply
2 replies to this topic

#1 10leej

10leej

    Glass Joe

  • Members
  • 2 posts

Posted 15 May 2013 - 05:58 PM

I'm making essentially a Pull Timer addon and would like to incorporate a method to addon a auto start for a DBM pull timer

Now I'm not brilliant at .lua so staring at the DBM-Core.lua I'm a bit lost in it but I think the function for starting the timer off the /pull commands is at line 1015

here's my code
--Pull countdown

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!", "SAY")
        self:Hide()
    elseif onesec <= 0 then
        SendChatMessage(seconds, "SAY")
        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"


#2 Tandanu

Tandanu

    Von Kaiser

  • Members
  • 59 posts

Posted 15 May 2013 - 10:06 PM

The pull command sends an addon message and our addon message handler does the actual work. This part of the API is not accessible from the outside.

However, you can simply invoke the slash command handler:

This will have the same effect as typing /pull 10 in the game
SlashCmdList["DEADLYBOSSMODS"]("pull 10")


#3 10leej

10leej

    Glass Joe

  • Members
  • 2 posts

Posted 15 May 2013 - 10:45 PM

Ah why thank you sir




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users