HELP PLX! Spell CD script!

HELP PLX! Spell CD script!

by Irachkom » Thu Nov 05, 2015 2:38 pm

I'm looking for method to get my spell CD and >*number* or <*number*

GetActionCooldown and GetSpellCooldown looks like not working...

Anyone know any idea?
I want to do something like
if GetActionCooldown(1) => 3 then CastSpellbyName("LongCastSpell")




HELP PLX
Image
User avatar
Irachkom
Senior Sergeant
Senior Sergeant
 

Re: HELP PLX! Spell CD script!

by Irachkom » Fri Nov 06, 2015 12:52 pm

Watch this one, maybe someone can modify it?

Code: Select all
local function formatTime(duration)
   local outputValue = ""
   if duration > 3600 then
      return math.floor(duration / 3600) .."H"
   elseif duration > 60 then
      return math.floor(duration / 60) .."M"
   else
      return math.floor(duration)
   end
end

local function OnUpdate(self, elapsed)
   waiting = waiting + elapsed
   if waiting > updateInterval then
      for i = 1, 24 do
         local totalI = 0
         if i < 13 then totalI = i
         else totalI = i + 48 end
         
         local start, duration, enable = GetActionCooldown(totalI)
         local timeLeft = ((start + duration) - GetTime())

         if duration > 1 then
            cooldownTimer[i]:SetText(formatTime(timeLeft))
         else
            cooldownTimer[i]:SetText("")
         end
      end
   end
end

local update = CreateFrame("Frame")
update:SetScript("OnUpdate", OnUpdate)
Image
User avatar
Irachkom
Senior Sergeant
Senior Sergeant
 


Return to Addons & macros