All pastes #363137 Raw Edit

Untitled

public lua v1 · immutable
·published 2007-02-19 06:46 UTC
rendered paste body
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                elseif unitBuffs[name] == 0 then			--Buff still on from last cycle			                        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	endend