Here is a version that throttles the amount of processing:
Code:
local FaithfulDeleteList = {
[ 1 ] = true, -- <unknown>
[ 9 ] = true, -- <unknown>
[ 2455 ] = true, -- Minor Mana Potion
[ 6289 ] = true, -- Raw Longjaw Mud Snapper
[ 6308 ] = true, -- Raw Bristle Whisker Catfish
[ 6309 ] = true, -- 17 Pound Catfish
[ 17057 ] = true -- Shiny Fish Scales
}
local frame = CreateFrame("Frame")
frame:Hide()
frame:SetScript("OnEvent", frame.Show)
frame:RegisterEvent("BAG_UPDATE")
frame:SetScript("OnUpdate", function(self)
self:Hide()
for bag = 0, NUM_BAG_SLOTS do
for slot = 1, GetContainerNumSlots(bag) do
local itemID = GetContainerItemID(bag, slot)
if itemID and FaithfulDeleteList[itemID] then
print(("Item found: %s [bag: %s, slot: %s]"):format(itemID, bag, slot))
end
end
end
end)