Thanks to all the tips and help on this thread, I was finally able to finish my addon using the following. If you think it can be improved (i.e. made more efficient), please let me know.
Lua Code:
LootLog = {}
local f = CreateFrame("Frame")
f:RegisterEvent("CHAT_MSG_LOOT")
function Log_Loot(self, event, message, _, _, _, player, _, _, _, _, _, _, ...)
if player == "Eommus" then
local itemId = message:match("item:(%d+):")
LootLog[itemId] = {}
end
end
f:SetScript('OnEvent', Log_Loot)
Such a simple thing, taking so long to come up with.
Food for thought: What if I was in a group with a player from another realm with the same name? The (if player == "Eommus") check won't be enough then.