Quantcast
WoWInterface - View Single Post - Help with using expirationTime
View Single Post
05-05-20, 07:41 AM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 1,961
Originally Posted by Xrystal View Post
Lua Code:
  1. for i=1,40 do
  2.         local name, icon, count, type, maxTime, endTime, caster, isStealable = UnitAura( unit_id, i, filter );
  3.         if name then
  4.             local startTime = GetTime();
  5.             local timeLeft = endTime - startTime
  6.             local timeBufferImminent = 10
  7.             local timeBufferSoon = 60
  8.             C_Timer.After(timeLeft - timeBufferImminent,function() AuraExpireImminent(unit_id,name,i) end)
  9.             C_Timer.After(timeLeft - timeBufferSoon,function() AuraExpireSoon(unit_id, name,i) end)
  10.         end
  11. end

I've added name in there in case there is a glitch and aura i is no longer aura name. How that would occur I don't know. How much of the aura system is accessible I don't know myself either. I recall limits on only seeing your own auras on other players or npcs. But not sure if that was Classic or Retail.
name will be nil when you run out of buffs in your scanning. For example, you're scanning for 40 buffs, but only have 3, when you scan for buff #4, it'll return nil because there is no buff #4.
__________________
ESOUI AddOns | WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote