Threw together a few lines of code for you:
Code:
local a = CreateFrame("Frame")
a.buffs = setmetatable({}, {__index = function(t,v) t[v]={} return t[v] end})
local guid
a:SetScript("OnEvent", function(self)
guid = UnitGUID("player")
self:SetScript("OnEvent", function(self,event,...)
if (select(6, ...)) == guid and ((select(2, ...)) == "SPELL_AURA_APPLIED" or (select(2,...)) == "SPELL_AURA_REFRESH") and (select(12,...)) == "BUFF" then
local source = (select(4,...))
local spell = (select(10,...))
a.buffs[source][spell] = (a.buffs[source][spell] or 0)+1
a.buffs["_"..spell][source] = (a.buffs["_"..spell][source] or 0)+1
end
end)
self:UnregisterEvent("PLAYER_LOGIN")
self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
end)
a:RegisterEvent("PLAYER_LOGIN")
SlashCmdList["REPORTBUFFS"] = function(input)
local bufftable = a.buffs
if input == "byplayer" then
print("|cff00ff00==BUFF REPORT==|r")
for i,k in pairs(bufftable) do
if i:sub(1,1)~="_" then
local ct = {}
for d,e in pairs(k) do
tinsert(ct, d.." ("..e..")")
end
print("|cffff0000"..i.."|r: "..table.concat(ct, ", "))
end
end
else
print("|cff00ff00==BUFF REPORT==|r")
for i,k in pairs(bufftable) do
if i:sub(1,1) == "_" then
i = i:sub(2)
local ct = {}
for d,e in pairs(k) do
tinsert(ct, d.." ("..e..")")
end
print("|cffff0000"..i.."|r: "..table.concat(ct, ", "))
end
end
end
end
SLASH_REPORTBUFFS1 = "/reportbuffs"
function TEMPTABLE() return a end
function TEMPGUID() return guid end
How do I use this
Usage:
/reportbuffs - Report what buffs you recieved from which players (Buffname: Player1 (1), Player2 (2))
/reportbuffs byplayer - Report what player buffed you which buffs (Playername: Buff (1), Otherbuff (2))