From 13224b547cc4eee5bb8f27b9100b4c6bc5a1335b Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Thu, 17 Nov 2022 21:03:27 -0500 Subject: [PATCH] Update for Dragonflight bag API changes --- ATMe/ATMe.lua | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/ATMe/ATMe.lua b/ATMe/ATMe.lua index 4d44e80..c70a591 100755 --- a/ATMe/ATMe.lua +++ b/ATMe/ATMe.lua @@ -125,11 +125,11 @@ function events:PLAYER_UPDATE_RESTING(...) end function ATMe.announceKey() - for bag = 0, NUM_BAG_SLOTS do - for slot = 1, GetContainerNumSlots(bag)do - itemID = GetContainerItemID(bag, slot) - if GetContainerItemID(bag, slot) == ATMe.keyItemID then - local link = GetContainerItemLink(bag, slot) + for bag = BACKPACK_CONTAINER, NUM_TOTAL_EQUIPPED_BAG_SLOTS do + for slot = 1, C_ContainerGetContainerNumSlots(bag)do + itemID = C_Container.GetContainerItemID(bag, slot) + if C_Container.GetContainerItemID(bag, slot) == ATMe.keyItemID then + local link = C_Container.GetContainerItemLink(bag, slot) SendChatMessage(link, "PARTY") return @@ -171,14 +171,19 @@ end function ATMe.sellGrayItems() sellTotal = 0 - for bag = 0, NUM_BAG_SLOTS do - for slot = 1, GetContainerNumSlots(bag) do - local _, count, _, quality, _, _, link = GetContainerItemInfo(bag, slot) + for bag = BACKPACK_CONTAINER, NUM_TOTAL_EQUIPPED_BAG_SLOTS do + for slot = 1, C_Container.GetContainerNumSlots(bag) do + local item = C_Container.GetContainerItemInfo(bag, slot) + + local count = item and item.stackCount + local quality = item and item.quality + local link = item and item.hyperlink + if quality and quality == 0 then local price = select(11, GetItemInfo(link)) sellTotal = sellTotal + (price * count) print("Selling "..count.."x"..link) - UseContainerItem(bag, slot) + C_Container.UseContainerItem(bag, slot) end end end