From ESOUI Wiki
This function tests whether the item in the specified bag slot can be deconstructed or refined at a blacksmithing, clothier, jewelry, or woodworking station.
This function doesn't check whether the target item is locked, even though it isn't supposed to be possible to deconstruct a locked item.
- 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.
- A TradeskillType constant indicating the crafting station we want to test for. If a valid crafting type isn't specified, this acts as CRAFTING_TYPE_INVALID and will cause the function to always return false.
if CanItemBeSmithingExtractedOrRefined(bag, slot, GetCraftingInteractionType()) and not IsItemPlayerLocked(bag, slot) then d("You can deconstruct/refine this item!") end