Skip to content

Commit

Permalink
add ability to read bank items
Browse files Browse the repository at this point in the history
  • Loading branch information
insunaa committed Nov 29, 2022
1 parent 284206e commit 5e7feb9
Showing 1 changed file with 38 additions and 40 deletions.
78 changes: 38 additions & 40 deletions QEGearImporter/questionablyepic_enhanced.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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("")
Expand Down

0 comments on commit 5e7feb9

Please sign in to comment.