#I would like to compare the cooldowns of two skills.

10 messages · Page 1 of 1 (latest)

south void
#

For example, when skill 1 is 40 seconds and skill 2 is 1 minute,
I would like to compare the remaining cooldowns of the two after pressing each other.
What should I do??
Great experts, can you tell me the correct answer??
I don't know how to handle the weak aura well... 😭

ripe trout
#

what do you want to do after you compare them

south void
#

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??

ripe trout
#

No, you don't need this much code

#

WA already has cooldown info in Spell->Cooldown Trigger

south void
#

Oh, is it possible to compare the times there and show the time difference??

ripe trout
#

you can compare the times in a custom condition

#

![help] Open the expanded code block for a custom condition and click help

rotund siloBOT
#

Click [help] on any expanded code block to get information specific to that block's usage, including any args sent in, and any expected returns.