View Single Post
08-08-18, 08:32 AM   #6
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
Drycoded (copy and pasted from one of my addons) because I cant log into wow to test it atm ...

Lua Code:
  1. local FaithfulDeleteList = {
  2.     [1] = true,
  3.     [6289] = true,
  4.     [6308] = true,
  5.     [6309] = true,
  6.     [17057] = true,
  7.     [9] = true,
  8.     [2455] = true,
  9. }
  10. local function getItemId(link)
  11.     if(link) then
  12.         local _, _, itemString = string.find(link, "^|c%x+|H(.+)|h%[.*%]")
  13.         local _,id,_ = strsplit(":",itemString)
  14.         return tonumber(id)
  15.     end
  16. end
  17. local function BAG_UPDATE()
  18.     local a = 0
  19.     while(a<=NUM_BAG_SLOTS) do
  20.         local b = 1
  21.         while(b<=GetContainerNumSlots(a)) do
  22.             local link = GetContainerItemLink(a, b)
  23.             if(link) then
  24.                 local bagItemID = getItemId(link)
  25.                 if(bagItemID and FaithfulDeleteList[bagItemID]) then
  26.                     print("is this thing on?")
  27.                 end
  28.             end
  29.             b = b + 1
  30.         end
  31.         a = a + 1
  32.     end
  33. end
  34. local f = CreateFrame("FRAME")
  35. f:SetScript("OnEvent", BAG_UPDATE)
  36. f:RegisterEvent("BAG_UPDATE")
__________________
The cataclysm broke the world ... and the pandas could not fix it!

Last edited by Rilgamon : 08-08-18 at 11:14 AM.
  Reply With Quote