i am trying to create some eePanels for player and pet debuffs
How do i have to change the following code in order to get the debuffs instead of the buffs:
Quote from Evil Elvis »
There isn't really a shorter way, but this would probably use less resources:
local buffs = 1, onlyShowCastableBuffs = false;
local buff,_,_,_,_,_ = UnitBuff("player", buffs, onlyShowCastableBuffs);
while buff do
buffs = buffs + 1;
buff,_,_,_,_,_ = UnitBuff("player", buffs, onlyShowCastableBuffs);
buffs = buffs - 1;
-- 'buffs' should now contain the number of buffs on the player
The same script on the previous page, you just use UnitBuff("pet", ...) instead of UnitBuff("player", ...).
This is not the whole story, because the pet eePanel just resizes when a player buff changes because PLAYER_AURA_HAS_CHANGED is only fired when there is a change on the PLAYER buffs. It resizes correctly using UnitBuff("pet") but it is simple not refreshing at the right time.