From ESOUI Wiki
This action attempts to extract or refine the item in the specified bag slot.
If the item is a raw material, then it will be refined. If it is an armor, weapon, or jewelry item, then it will be deconstructed if possible. Only one item can be deconstructed at a time, so if you wish to deconstruct multiple items automatically, you must listen for crafting events and process them in a queue.
- A number representing the bag to check; it must be one of the built-in Bag values.
- The numeric index of the slot in that bag which should be checked. For most bags, this is a number ranging from 1 to the size of the bag.
-- GIVEN: -- number bagIndex -- number slotIndex -- -- We could just blindly call the function, but if we don't know -- anything about the item we're working with, then we don't know -- what'll happen if we call the function. Will we deconstruct an -- item? Refine a material? Or will nothing happen at all? -- local _, itemType = GetItemCraftingInfo(bagIndex, slotIndex) if itemType == ITEMTYPE_GLYPH_WEAPON or itemType == ITEMTYPE_GLYPH_ARMOR or itemType == ITEMTYPE_GLYPH_JEWELRY then -- -- This type of item can be deconstructed... but what about this -- specific item? -- local link = GetItemLink(bagIndex, slotIndex) if IsItemLinkForcedNotDeconstructable(link) and not IsItemLinkContainer(link) then -- -- This is the check that the game uses to tell whether something -- is "forced non-deconstructable." Generally this seems to apply -- to jewelry items that existed before the Summerset update. -- else -- -- The item is of a type that can be deconstructed, and it's not -- "forced non-deconstructable," so let's break it apart! -- ExtractOrRefineSmithingItem(bagIndex, slotIndex) end end
- If the player has ESO Plus, if a raw material exists in both the player's inventory (BAG_BACKPACK) and the Craft Bag (BAG_VIRTUAL), and you attempt to refine the item in BAG_BACKPACK, the game will actually refine the item in the Craft Bag first. The game will continue to refine from the Craft Bag until none of the item remains in the Craft Bag; if the game must take from both bags in order to empty the Craft Bag of the raw material, then it will do so (e.g. using the last 6 of a raw material from BAG_VIRTUAL and 4 of the raw material in BAG_BACKPACK in order to refine). There doesn't appear to be a way to control this behavior or to know that it has occurred.
- Adding to the complications, you still have to call ExtractOrRefineSmithingItem multiple times in order to refine all of the raw material... which means that you need to measure the item's count across both bags in order to know when you've refined all of it. GetItemLinkStacks can help with that.
- This behavior does not occur with raw materials in BAG_BANK.