View Single Post
08/27/23, 04:36 AM   #1
schorse
Join Date: Aug 2023
Posts: 4
SellInventoryItem() doesn't sell some items

Hi,

I was trying to sell my whole inventory and the function SellInventoryItem() fails to do so in most cases.

My inventory consists of:
1 x Platinum Necklace (Ornate)
1 x Common Repair Kit
20 x Grand Repair Kit
1 x Recipe: Fredas Night Infusion
34 x Soul Gem (Empty)
1 x Superb Glyph of Health Recovery
1 x Rubedo Leather Jack (Intricate)

While interacting with a merchant i run the following code:
Code:
	SLASH_COMMANDS["/sellall"] = function()
		local bagCache = SHARED_INVENTORY:GenerateFullSlotData(nil,BAG_BACKPACK)
		
		for bagSlot in pairs(bagCache) do
			SellInventoryItem(BAG_BACKPACK, bagSlot, bagCache[bagSlot].stackCount)
		end
	end
After that only the Common Repair kit and the Recipe are sold. If I split the the Grand Repair Kits to 19 - 1 it works somehow for the 1 Kit. Does someone have experience with autoselling and knows what I am doing wrong here?

Thanks for answers!
  Reply With Quote