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
if GetActionCooldown(1) => 3 then CastSpellbyName("LongCastSpell")
|
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)
|