DestroyItem

From ESOUI Wiki

Jump to: navigation, search

This function destroys the item stack that exists in a particular bag slot.

Contents

Arguments

bagId
A number representing the bag to check; it must be one of the built-in Bag values.
slotIndex
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.

Syntax

-- GIVEN:
-- number bagIndex
-- number slotIndex
--
DestroyItem(bagIndex, slotIndex)

Destroying only part of a stack

There is no built-in API function to destroy only part of a stack. If you need to destroy just part of a stack, then you will have to go through a rather involved process. You need to split the stack and then destroy it, but splitting a stack isn't instantaneous. You can request the splitting of a stack by calling the protected function RequestMoveItem, but you will need to use an EVENT_INVENTORY_SINGLE_SLOT_UPDATE event listener to know when the split actually occurs, and then destroy the stack at that time. There are additional concerns which are covered on the page for RequestMoveItem.

External links

Personal tools
Namespaces
Variants
Actions
Menu
Wiki
Toolbox