Thread Tools Display Modes
Prev Previous Post   Next Post Next
09-20-23, 06:20 AM   #1
Benalish
A Flamescale Wyrmkin
 
Benalish's Avatar
Join Date: Dec 2012
Posts: 122
Updated: GCD proof cooldown tracking

There are some cooldowns that can decrease their remaining time thanks to talents or set bonuses.
My intent is to keep track of the remaining cooldown time so that any change in the remaining time is not attributable to the global cooldown.
Does this script have any weaknesses? Are there any points where it could be improved?

Lua Code:
  1. f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
  2.     f:SetScript("OnEvent", function(self,event,...)
  3.     if arg4 == UnitName("player") then
  4.         local start, duration = GetSpellCooldown(arg9)     
  5.         if arg10 == "Riptide" then
  6.             self.start = start
  7.             self.duration = duration
  8.             self.endtime = start + duration
  9.             self.id = arg9
  10.         end
  11.             -- This is the crucial part: is it right? Does this part actually ensure that the change in the
  12.             -- remaining cooldown duration is not attributable to the global cooldown?
  13.         if select(2,GetSpellCooldown(self.id)) > 1.5 then                          
  14.             self.endtime = self.start + select(2,GetSpellCooldown(self.id))
  15.         end
  16.     end
  17. end)
  18.            
  19. f:SetScript("OnUpdate", function(self)
  20.     self.timer = self.endtime - GetTime()
  21.     if (self.timer > 0) then
  22.         -- Hide frame
  23.     else
  24.         -- Show frame
  25.     end
  26. end)

Last edited by Benalish : 09-20-23 at 06:24 AM.
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Updated: GCD proof cooldown tracking

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off