# C_Container: World of Warcraft Forever API

Forever 1.60.1 (70959), Interface 16001, Lua 5.1, from Blizzard's own API documentation. Page: https://wowaddons.gg/forever-api/C_Container

## Functions

### C_Container.CalculateTotalNumberOfFreeBagSlots

```lua
totalFreeSlots = C_Container.CalculateTotalNumberOfFreeBagSlots()
```

Returns:
- `totalFreeSlots`: number

### C_Container.ContainerIDToInventoryID

```lua
inventoryID = C_Container.ContainerIDToInventoryID(containerID)
```

May return nothing.

Arguments:
- `containerID`: BagIndex

Returns:
- `inventoryID`: luaIndex

### C_Container.ContainerRefundItemPurchase

```lua
C_Container.ContainerRefundItemPurchase(containerIndex, slotIndex, [isEquipped])
```

Arguments:
- `containerIndex`: BagIndex
- `slotIndex`: luaIndex
- `isEquipped`: bool, default false

### C_Container.GetBackpackAutosortDisabled

```lua
isDisabled = C_Container.GetBackpackAutosortDisabled()
```

Returns:
- `isDisabled`: bool

### C_Container.GetBackpackSellJunkDisabled

```lua
isDisabled = C_Container.GetBackpackSellJunkDisabled()
```

Returns:
- `isDisabled`: bool

### C_Container.GetBagName

```lua
name = C_Container.GetBagName(bagIndex)
```

Arguments:
- `bagIndex`: BagIndex

Returns:
- `name`: cstring

### C_Container.GetBagSlotFlag

```lua
isSet = C_Container.GetBagSlotFlag(bagIndex, flag)
```

Arguments:
- `bagIndex`: BagIndex
- `flag`: BagSlotFlags

Returns:
- `isSet`: bool

### C_Container.GetBankAutosortDisabled

```lua
isDisabled = C_Container.GetBankAutosortDisabled()
```

Returns:
- `isDisabled`: bool

### C_Container.GetContainerFreeSlots

```lua
freeSlots = C_Container.GetContainerFreeSlots(containerIndex)
```

May return nothing.

Arguments:
- `containerIndex`: BagIndex

Returns:
- `freeSlots`: luaIndex[]

### C_Container.GetContainerItemCooldown

```lua
startTime, duration, enable = C_Container.GetContainerItemCooldown(containerIndex, slotIndex)
```

Arguments:
- `containerIndex`: BagIndex
- `slotIndex`: luaIndex

Returns:
- `startTime`: number
- `duration`: number
- `enable`: number

### C_Container.GetContainerItemDurability

```lua
durability, maxDurability = C_Container.GetContainerItemDurability(containerIndex, slotIndex)
```

May return nothing.

Arguments:
- `containerIndex`: BagIndex
- `slotIndex`: luaIndex

Returns:
- `durability`: number
- `maxDurability`: number

### C_Container.GetContainerItemEquipmentSetInfo

```lua
inSet, setList = C_Container.GetContainerItemEquipmentSetInfo(containerIndex, slotIndex)
```

Arguments:
- `containerIndex`: BagIndex
- `slotIndex`: luaIndex

Returns:
- `inSet`: bool
- `setList`: string

### C_Container.GetContainerItemID

```lua
containerID = C_Container.GetContainerItemID(containerIndex, slotIndex)
```

May return nothing.

Arguments:
- `containerIndex`: BagIndex
- `slotIndex`: luaIndex

Returns:
- `containerID`: number

### C_Container.GetContainerItemInfo

```lua
containerInfo = C_Container.GetContainerItemInfo(containerIndex, slotIndex)
```

May return nothing.

Arguments:
- `containerIndex`: BagIndex
- `slotIndex`: luaIndex

Returns:
- `containerInfo`: ContainerItemInfo

### C_Container.GetContainerItemLink

```lua
itemLink = C_Container.GetContainerItemLink(containerIndex, slotIndex)
```

Arguments:
- `containerIndex`: BagIndex
- `slotIndex`: luaIndex

Returns:
- `itemLink`: cstring

### C_Container.GetContainerItemPurchaseCurrency

```lua
currencyInfo = C_Container.GetContainerItemPurchaseCurrency(containerIndex, slotIndex, itemIndex, isEquipped)
```

May return nothing.

Arguments:
- `containerIndex`: BagIndex
- `slotIndex`: luaIndex
- `itemIndex`: luaIndex
- `isEquipped`: bool

Returns:
- `currencyInfo`: ItemPurchaseCurrency

### C_Container.GetContainerItemPurchaseInfo

```lua
info = C_Container.GetContainerItemPurchaseInfo(containerIndex, slotIndex, isEquipped)
```

May return nothing.

Arguments:
- `containerIndex`: BagIndex
- `slotIndex`: luaIndex
- `isEquipped`: bool

Returns:
- `info`: ItemPurchaseInfo

### C_Container.GetContainerItemPurchaseItem

```lua
itemInfo = C_Container.GetContainerItemPurchaseItem(containerIndex, slotIndex, itemIndex, isEquipped)
```

May return nothing.

Arguments:
- `containerIndex`: BagIndex
- `slotIndex`: luaIndex
- `itemIndex`: luaIndex
- `isEquipped`: bool

Returns:
- `itemInfo`: ItemPurchaseItem

### C_Container.GetContainerItemQuestInfo

```lua
questInfo = C_Container.GetContainerItemQuestInfo(containerIndex, slotIndex)
```

Arguments:
- `containerIndex`: BagIndex
- `slotIndex`: luaIndex

Returns:
- `questInfo`: ItemQuestInfo

### C_Container.GetContainerNumFreeSlots

```lua
numFreeSlots, bagFamily = C_Container.GetContainerNumFreeSlots(bagIndex)
```

Arguments:
- `bagIndex`: BagIndex

Returns:
- `numFreeSlots`: number
- `bagFamily`: number, may be nil

### C_Container.GetContainerNumSlots

```lua
numSlots = C_Container.GetContainerNumSlots(containerIndex)
```

Arguments:
- `containerIndex`: BagIndex

Returns:
- `numSlots`: number

### C_Container.GetInsertItemsLeftToRight

```lua
isEnabled = C_Container.GetInsertItemsLeftToRight()
```

Returns:
- `isEnabled`: bool

### C_Container.GetItemCooldown

```lua
startTime, duration, enable = C_Container.GetItemCooldown(itemID)
```

May return nothing.

Arguments:
- `itemID`: number

Returns:
- `startTime`: number
- `duration`: number
- `enable`: number

### C_Container.GetMaxArenaCurrency

```lua
maxCurrency = C_Container.GetMaxArenaCurrency()
```

Returns:
- `maxCurrency`: number

### C_Container.GetSortBagsRightToLeft

```lua
isEnabled = C_Container.GetSortBagsRightToLeft()
```

Returns:
- `isEnabled`: bool

### C_Container.HasContainerItem

```lua
hasItem = C_Container.HasContainerItem(containerIndex, slotIndex)
```

Arguments:
- `containerIndex`: BagIndex
- `slotIndex`: luaIndex

Returns:
- `hasItem`: bool

### C_Container.IsBattlePayItem

```lua
isBattlePayItem = C_Container.IsBattlePayItem(containerIndex, slotIndex)
```

Arguments:
- `containerIndex`: BagIndex
- `slotIndex`: luaIndex

Returns:
- `isBattlePayItem`: bool

### C_Container.IsContainerFiltered

```lua
isFiltered = C_Container.IsContainerFiltered(containerIndex)
```

Arguments:
- `containerIndex`: BagIndex

Returns:
- `isFiltered`: bool

### C_Container.PickupContainerItem

```lua
C_Container.PickupContainerItem(containerIndex, slotIndex)
```

Arguments:
- `containerIndex`: BagIndex
- `slotIndex`: luaIndex

### C_Container.PlayerHasHearthstone

```lua
itemID = C_Container.PlayerHasHearthstone()
```

Returns:
- `itemID`: number, may be nil

### C_Container.SetBackpackAutosortDisabled

```lua
C_Container.SetBackpackAutosortDisabled(disable)
```

Arguments:
- `disable`: bool

### C_Container.SetBackpackSellJunkDisabled

```lua
C_Container.SetBackpackSellJunkDisabled(disable)
```

Arguments:
- `disable`: bool

### C_Container.SetBagPortraitTexture

```lua
C_Container.SetBagPortraitTexture(texture, bagIndex)
```

Arguments:
- `texture`: SimpleTexture
- `bagIndex`: BagIndex

### C_Container.SetBagSlotFlag

```lua
C_Container.SetBagSlotFlag(bagIndex, flag, isSet)
```

Arguments:
- `bagIndex`: BagIndex
- `flag`: BagSlotFlags
- `isSet`: bool

### C_Container.SetBankAutosortDisabled

```lua
C_Container.SetBankAutosortDisabled(disable)
```

Arguments:
- `disable`: bool

### C_Container.SetInsertItemsLeftToRight

```lua
C_Container.SetInsertItemsLeftToRight(enable)
```

Arguments:
- `enable`: bool

### C_Container.SetItemSearch

```lua
C_Container.SetItemSearch(searchString)
```

Arguments:
- `searchString`: cstring

### C_Container.SetSortBagsRightToLeft

```lua
C_Container.SetSortBagsRightToLeft(enable)
```

Arguments:
- `enable`: bool

### C_Container.ShowContainerSellCursor

```lua
C_Container.ShowContainerSellCursor(containerIndex, slotIndex)
```

Arguments:
- `containerIndex`: BagIndex
- `slotIndex`: luaIndex

### C_Container.SocketContainerItem

```lua
success = C_Container.SocketContainerItem(containerIndex, slotIndex)
```

Arguments:
- `containerIndex`: BagIndex
- `slotIndex`: luaIndex

Returns:
- `success`: bool

### C_Container.SortAccountBankBags

```lua
C_Container.SortAccountBankBags()
```

### C_Container.SortBags

```lua
C_Container.SortBags()
```

### C_Container.SortBank

```lua
C_Container.SortBank(bankType)
```

Arguments:
- `bankType`: BankType

### C_Container.SortBankBags

```lua
C_Container.SortBankBags()
```

### C_Container.SplitContainerItem

```lua
C_Container.SplitContainerItem(containerIndex, slotIndex, amount)
```

Arguments:
- `containerIndex`: BagIndex
- `slotIndex`: luaIndex
- `amount`: number

### C_Container.UseContainerItem

```lua
C_Container.UseContainerItem(containerIndex, slotIndex, [unitToken], [bankType], [reagentBankOpen])
```

Arguments:
- `containerIndex`: BagIndex
- `slotIndex`: luaIndex
- `unitToken`: UnitToken, may be nil
- `bankType`: BankType, may be nil
- `reagentBankOpen`: bool, default false

### C_Container.UseHearthstone

```lua
used = C_Container.UseHearthstone()
```

Returns:
- `used`: bool

## Events

### BAG_CLOSED

Payload, after the event's name:
- `bagID`: BagIndex

### BAG_CONTAINER_UPDATE

No payload.

### BAG_NEW_ITEMS_UPDATED

No payload.

### BAG_OPEN

Payload, after the event's name:
- `bagID`: number

### BAG_OVERFLOW_WITH_FULL_INVENTORY

No payload.

### BAG_SLOT_FLAGS_UPDATED

Payload, after the event's name:
- `slot`: number

### BAG_UPDATE

Payload, after the event's name:
- `bagID`: BagIndex

### BAG_UPDATE_COOLDOWN

No payload.

### BAG_UPDATE_DELAYED

No payload.

### EQUIP_BIND_REFUNDABLE_CONFIRM

Payload, after the event's name:
- `slot`: number
- `itemLocation`: ItemLocation

### EQUIP_BIND_TRADEABLE_CONFIRM

Payload, after the event's name:
- `slot`: number
- `itemLocation`: ItemLocation

### EXPAND_BAG_BAR_CHANGED

Payload, after the event's name:
- `expandBagBar`: bool

### INVENTORY_SEARCH_UPDATE

No payload.

### ITEM_LOCK_CHANGED

Payload, after the event's name:
- `bagOrSlotIndex`: BagIndex
- `slotIndex`: luaIndex, may be nil

### ITEM_LOCKED

Payload, after the event's name:
- `bagOrSlotIndex`: BagIndex
- `slotIndex`: luaIndex, may be nil

### ITEM_UNLOCKED

Payload, after the event's name:
- `bagOrSlotIndex`: BagIndex
- `slotIndex`: luaIndex, may be nil

### USE_COMBINED_BAGS_CHANGED

Payload, after the event's name:
- `useCombinedBags`: bool

## Tables

### ContainerItemInfo (structure)

- `iconFileID`: fileID
- `stackCount`: number
- `isLocked`: bool
- `quality`: ItemQuality, may be nil
- `isReadable`: bool
- `hasLoot`: bool
- `hyperlink`: string
- `isFiltered`: bool
- `hasNoValue`: bool
- `itemID`: number
- `isBound`: bool
- `itemName`: string

### ItemPurchaseCurrency (structure)

- `iconFileID`: number, may be nil
- `currencyCount`: number
- `name`: cstring

### ItemPurchaseInfo (structure)

- `money`: WOWMONEY
- `itemCount`: number
- `refundSeconds`: time_t
- `currencyCount`: number
- `hasEnchants`: bool

### ItemPurchaseItem (structure)

- `iconFileID`: number, may be nil
- `itemCount`: number
- `hyperlink`: string

### ItemQuestInfo (structure)

- `isQuestItem`: bool
- `questID`: number, may be nil
- `isActive`: bool

---
Make an addon with your AI: tell it "Read https://wowaddons.gg/agents.md, then make me a World of Warcraft Forever addon that …, try it with me in the game, and publish it."
