LibItemPrice

Needs some more work
This commit is contained in:
Crum
2018-02-20 15:28:17 -06:00
parent b6f18c6823
commit 5df31cd2dc
9 changed files with 350 additions and 18 deletions
+21
View File
@@ -399,4 +399,25 @@ function GetItemInfoByName(itemName)
if not itemInfoDB[itemName] then return end
return GetItemInfo(itemInfoDB[itemName])
end
function GetItemCount(itemName)
local count = 0
for bag = 4, 0, -1 do
for slot = 1, GetContainerNumSlots(bag) do
local _, itemCount = GetContainerItemInfo(bag, slot);
if itemCount then
local itemLink = GetContainerItemLink(bag,slot)
local _, _, itemParse = strfind(itemLink, "(%d+):")
local queryName, _, _, _, _, _ = GetItemInfo(itemParse)
if queryName and queryName ~= "" then
if queryName == itemName then
count = count + itemCount;
end
end
end
end
end
return count
end