View Single Post
05-12-17, 02:30 AM   #24
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 358
Originally Posted by lightspark View Post
-- edit #1

I should get some coffee...



Do exactly that Just use `break`s to stop the for-loop if you need...
Hi lightspark ,

I was considering something like...

Lua Code:
  1. function UpdateDebuff(self)
  2.     self:ReleaseAll();
  3.  
  4.     local prevButton;
  5.     for i, auraID in pairs(auraIDList) do
  6.         for j = 1, 40 do
  7.             local _, _, icon, count, _, duration, expires, _, _, _, spellID = UnitDebuff("target", j, "PLAYER");
  8.            
  9.             if auraID == spellID then
  10.                 -- blah blah blah
  11.  
  12.                 break;
  13.             end
  14.         end
  15.     end
  16. end

But...

(1) What if my spell doesn't get included within those 40 debuffs?

(2) Would there be a variable that stores number of unit's (not only target's, but for others' as well) buff/debuff?

I mean something like BUFF_ACTUAL_DISPLAY/DEBUFF_ACTUAL_DISPLAY for player.

(3) I tried to refer aura element of oUF, but.............. meh... guess it's too complex for me

Last edited by Layback_ : 05-12-17 at 04:01 AM.
  Reply With Quote