View Single Post
05-05-20, 03:01 PM   #8
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
UNIT_AURA tells you when you gain/loose an aura (you might be waiting a while for this to fire). To update the time left on an aura you need to use an OnUpdate script (which happens every time the frame is updated ie. lots)

Lua Code:
  1. frame.TimeToCheck = 1 -- check buff timers every second
  2. frame:SetScript("OnUpdate", function(self, elapsed)
  3.     self.TimeToCheck = self.TimeToCheck - elapsed
  4.     if self.TimeToCheck > 0 then
  5.         return -- We haven't counted down to zero yet so do nothing
  6.     end
  7.     self.TimeToCheck = 1 -- We've waited a second so reset the timer
  8.     for i=1, 40 do
  9.         -- check your buff/debuff times
  10.     end
  11. end)

Or a C_Timer as mentioned above but you need to check more often or at a known time rather than when a random event fires.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 05-05-20 at 03:50 PM.
  Reply With Quote