#I would like to compare the cooldowns of two skills.
10 messages · Page 1 of 1 (latest)
what do you want to do after you compare them
Ah, I want to compare the eye light and the sacrifice aura and use the skills accordingly.
I would like to compare the times of the two.
function()
local spell1Start, spell1Duration = GetSpellCooldown(198013)
local spell2Start, spell2Duration = GetSpellCooldown(258920)
local timeDifference = 0
-- If either spell is on cooldown or both are on cooldown
if (spell1Start and spell1Start > 0) or (spell2Start and spell2Start > 0) then
local currentTime = GetTime()
-- Calculate the end times based on start time and duration
local spell1End = spell1Start + spell1Duration
local spell2End = spell2Start + spell2Duration
-- If either spell is not on cooldown anymore
if spell1Start == 0 or spell2Start == 0 then
if spell1Start == 0 then
timeDifference = spell2End - currentTime
else
timeDifference = spell1End - currentTime
end
else
-- Calculate the difference between the expiration times
timeDifference = math.abs(spell1End - spell2End)
end
end
return timeDifference
end
So I tried it like this. Is this correct??
No, you don't need this much code
WA already has cooldown info in Spell->Cooldown Trigger
Oh, is it possible to compare the times there and show the time difference??