function UB_UnitAura(arg1) if not ubuffs[arg1] then ubuffs[arg1] = {} end local unitBuffs = ubuffs[arg1] -- Decrement all counts for k,v in pairs(unitBuffs) do DEFAULT_CHAT_FRAME:AddMessage(k) DEFAULT_CHAT_FRAME:AddMessage(v) unitBuffs[k] = v - 1 end local i = 1 while true do local name,rank,count = UnitBuff(arg1, i) if not name then break end if not unitBuffs[name] then -- New buff unitBuffs[name] = 1 end i = i + 1 end -- Clean up any buffs with 0 for k,v in pairs(unitBuffs) do if v == 0 then unitBuffs[k] = nil -- Buff expired end end end