From 5e7feb9eb0356fe93a1c4bcbc07f1492b192ef76 Mon Sep 17 00:00:00 2001 From: insunaa Date: Tue, 29 Nov 2022 19:55:38 +0100 Subject: [PATCH] add ability to read bank items --- QEGearImporter/questionablyepic_enhanced.lua | 78 ++++++++++---------- 1 file changed, 38 insertions(+), 40 deletions(-) diff --git a/QEGearImporter/questionablyepic_enhanced.lua b/QEGearImporter/questionablyepic_enhanced.lua index 517206c..76945e6 100644 --- a/QEGearImporter/questionablyepic_enhanced.lua +++ b/QEGearImporter/questionablyepic_enhanced.lua @@ -132,51 +132,49 @@ function scanGear() addPrint("") addPrint("### GEAR FROM BAGS ###") - for bag=0, NUM_BAG_SLOTS do - - for bagSlots=1, GetContainerNumSlots(bag) do - --print("Inside the bag this time"); - local itemID = GetContainerItemID(bag, bagSlots); - - if (itemID) then - local itemName, _, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture, vendorPrice, classID, subclassID = GetItemInfo(itemID); - - local itemLink = GetContainerItemLink(bag, bagSlots) - local itemSplit = GetItemSplit(itemLink) - local suffix = itemSplit[7] * -1 - local enchantId = itemSplit[2] - local gem1 = itemSplit[3] - local gem2 = itemSplit[4] - local gem3 = itemSplit[5] - - if (suffix ~= -0) then - local unique = bit.band(itemSplit[8], 65535) - suffix = ",suffix=" .. suffix .. ",unique=" .. unique - else suffix = "" end + for bag=0, NUM_BAG_SLOTS + GetNumBankSlots() do + if GetContainerNumSlots(bag) != 0 then + for bagSlots=1, GetContainerNumSlots(bag) do + --print("Inside the bag this time"); + local itemID = GetContainerItemID(bag, bagSlots); - SocketContainerItem(bag, bagSlots) - gemColors = {nil, nil, nil} - for j=1, GetNumSockets() do - _, _, gemColors[j] = GetExistingSocketInfo(j) - end - CloseSocketInfo() - - --if ((classID == 2 or classID == 4) and checkIfUsable(classID, subclassID)) then - if (true or classID == 2 or classID == 4) then - --addPrint("#") - --addPrint("# " .. itemName) - --addPrint("# " .. convertSlot(itemEquipLoc) .. "=,id=" .. itemID .. suffix) - local _, itemCount = GetContainerItemInfo(bag, bagSlots) - --addPrint(itemName) - addPrint("id=" .. itemID .. suffix .. ",count=" .. itemCount .. ",enchantId=" .. enchantId .. ",gem1=" .. gem1 ..":" .. tostring(gemColors[1]) .. ",gem2=" .. gem2 ..":" .. tostring(gemColors[2]) .. ",gem3=" .. gem3 ..":" .. tostring(gemColors[3])) - --print(itemName .. "(" .. itemType .. ")"); + if (itemID) then + local itemName, _, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture, vendorPrice, classID, subclassID = GetItemInfo(itemID); + + local itemLink = GetContainerItemLink(bag, bagSlots) + local itemSplit = GetItemSplit(itemLink) + local suffix = itemSplit[7] * -1 + local enchantId = itemSplit[2] + local gem1 = itemSplit[3] + local gem2 = itemSplit[4] + local gem3 = itemSplit[5] + if (suffix ~= -0) then + local unique = bit.band(itemSplit[8], 65535) + suffix = ",suffix=" .. suffix .. ",unique=" .. unique + else suffix = "" end + + SocketContainerItem(bag, bagSlots) + gemColors = {nil, nil, nil} + for j=1, GetNumSockets() do + _, _, gemColors[j] = GetExistingSocketInfo(j) + end + CloseSocketInfo() + + --if ((classID == 2 or classID == 4) and checkIfUsable(classID, subclassID)) then + if (true or classID == 2 or classID == 4) then + --addPrint("#") + --addPrint("# " .. itemName) + --addPrint("# " .. convertSlot(itemEquipLoc) .. "=,id=" .. itemID .. suffix) + local _, itemCount = GetContainerItemInfo(bag, bagSlots) + --addPrint(itemName) + addPrint("id=" .. itemID .. suffix .. ",count=" .. itemCount .. ",enchantId=" .. enchantId .. ",gem1=" .. gem1 ..":" .. tostring(gemColors[1]) .. ",gem2=" .. gem2 ..":" .. tostring(gemColors[2]) .. ",gem3=" .. gem3 ..":" .. tostring(gemColors[3])) + --print(itemName .. "(" .. itemType .. ")"); + + end end end - - --local _, _, itemRarity, _, _, itemType, itemSubType, _, _, _, _ = GetItemInfo() end - end addPrint("")