Drycoded (copy and pasted from one of my addons) because I cant log into wow to test it atm ...
Lua Code:
local FaithfulDeleteList = {
[1] = true,
[6289] = true,
[6308] = true,
[6309] = true,
[17057] = true,
[9] = true,
[2455] = true,
}
local function getItemId(link)
if(link) then
local _, _, itemString = string.find(link, "^|c%x+|H(.+)|h%[.*%]")
local _,id,_ = strsplit(":",itemString)
return tonumber(id)
end
end
local function BAG_UPDATE()
local a = 0
while(a<=NUM_BAG_SLOTS) do
local b = 1
while(b<=GetContainerNumSlots(a)) do
local link = GetContainerItemLink(a, b)
if(link) then
local bagItemID = getItemId(link)
if(bagItemID and FaithfulDeleteList[bagItemID]) then
print("is this thing on?")
end
end
b = b + 1
end
a = a + 1
end
end
local f = CreateFrame("FRAME")
f:SetScript("OnEvent", BAG_UPDATE)
f:RegisterEvent("BAG_UPDATE")