Provide more detailed info when selling

(fixes #6)
This commit is contained in:
Andrew Tomaka 2021-02-21 11:43:23 -05:00
parent f779f20a52
commit 37b991426b
Signed by: atomaka
GPG key ID: 61209BF70A5B18BE

View file

@ -153,15 +153,21 @@ function MyAddon.needsRepair()
end end
function MyAddon.sellGrayItems() function MyAddon.sellGrayItems()
sellTotal = 0
for bag = 0, NUM_BAG_SLOTS do for bag = 0, NUM_BAG_SLOTS do
for slot = 1, GetContainerNumSlots(bag) do for slot = 1, GetContainerNumSlots(bag) do
local name = GetContainerItemLink(bag, slot) local _, count, _, quality, _, _, link = GetContainerItemInfo(bag, slot)
if name and string.find(name, "ff9d9d9d") then if quality and quality == 0 then
print("Selling "..name) local price = select(11, GetItemInfo(link))
sellTotal = sellTotal + (price * count)
print("Selling "..count.."x"..link)
UseContainerItem(bag, slot) UseContainerItem(bag, slot)
end end
end end
end end
if sellTotal ~= 0 then
print("Made "..GetCoinTextureString(sellTotal))
end
end end
function MyAddon.amTankInParty() function MyAddon.amTankInParty()