World of Warcraft Forever API · C_Container.md, for your AI
C_Container
47 functions, 17 events, 5 tables, as Blizzard documents them for Forever 1.60.1 (70959).
Making an addon with an 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. It checks every call against this API before you try it in the game, then publishes it here. How it works.
Functions
C_Container.CalculateTotalNumberOfFreeBagSlots
totalFreeSlots = C_Container.CalculateTotalNumberOfFreeBagSlots()
Returns
totalFreeSlots | number |
|---|
C_Container.ContainerIDToInventoryID
inventoryID = C_Container.ContainerIDToInventoryID(containerID)
May return nothing.
Arguments
containerID | BagIndex |
|---|
Returns
inventoryID | luaIndex |
|---|
C_Container.ContainerRefundItemPurchase
C_Container.ContainerRefundItemPurchase(containerIndex, slotIndex, [isEquipped])
Arguments
containerIndex | BagIndex | |
|---|---|---|
slotIndex | luaIndex | |
isEquipped | bool default false |
C_Container.GetBackpackAutosortDisabled
isDisabled = C_Container.GetBackpackAutosortDisabled()
Returns
isDisabled | bool |
|---|
C_Container.GetBackpackSellJunkDisabled
isDisabled = C_Container.GetBackpackSellJunkDisabled()
Returns
isDisabled | bool |
|---|
C_Container.GetBagName
name = C_Container.GetBagName(bagIndex)
Arguments
bagIndex | BagIndex |
|---|
Returns
name | cstring |
|---|
C_Container.GetBagSlotFlag
isSet = C_Container.GetBagSlotFlag(bagIndex, flag)
Arguments
bagIndex | BagIndex | |
|---|---|---|
flag | BagSlotFlags |
Returns
isSet | bool |
|---|
C_Container.GetBankAutosortDisabled
isDisabled = C_Container.GetBankAutosortDisabled()
Returns
isDisabled | bool |
|---|
C_Container.GetContainerFreeSlots
freeSlots = C_Container.GetContainerFreeSlots(containerIndex)
May return nothing.
Arguments
containerIndex | BagIndex |
|---|
Returns
freeSlots | luaIndex[] |
|---|
C_Container.GetContainerItemCooldown
startTime, duration, enable = C_Container.GetContainerItemCooldown(containerIndex, slotIndex)
Arguments
containerIndex | BagIndex | |
|---|---|---|
slotIndex | luaIndex |
Returns
startTime | number | |
|---|---|---|
duration | number | |
enable | number |
C_Container.GetContainerItemDurability
durability, maxDurability = C_Container.GetContainerItemDurability(containerIndex, slotIndex)
May return nothing.
Arguments
containerIndex | BagIndex | |
|---|---|---|
slotIndex | luaIndex |
Returns
durability | number | |
|---|---|---|
maxDurability | number |
C_Container.GetContainerItemEquipmentSetInfo
inSet, setList = C_Container.GetContainerItemEquipmentSetInfo(containerIndex, slotIndex)
Arguments
containerIndex | BagIndex | |
|---|---|---|
slotIndex | luaIndex |
Returns
inSet | bool | |
|---|---|---|
setList | string |
C_Container.GetContainerItemID
containerID = C_Container.GetContainerItemID(containerIndex, slotIndex)
May return nothing.
Arguments
containerIndex | BagIndex | |
|---|---|---|
slotIndex | luaIndex |
Returns
containerID | number |
|---|
C_Container.GetContainerItemInfo
containerInfo = C_Container.GetContainerItemInfo(containerIndex, slotIndex)
May return nothing.
Arguments
containerIndex | BagIndex | |
|---|---|---|
slotIndex | luaIndex |
Returns
containerInfo | ContainerItemInfo |
|---|
C_Container.GetContainerItemLink
itemLink = C_Container.GetContainerItemLink(containerIndex, slotIndex)
Arguments
containerIndex | BagIndex | |
|---|---|---|
slotIndex | luaIndex |
Returns
itemLink | cstring |
|---|
C_Container.GetContainerItemPurchaseCurrency
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
info = C_Container.GetContainerItemPurchaseInfo(containerIndex, slotIndex, isEquipped)
May return nothing.
Arguments
containerIndex | BagIndex | |
|---|---|---|
slotIndex | luaIndex | |
isEquipped | bool |
Returns
info | ItemPurchaseInfo |
|---|
C_Container.GetContainerItemPurchaseItem
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
questInfo = C_Container.GetContainerItemQuestInfo(containerIndex, slotIndex)
Arguments
containerIndex | BagIndex | |
|---|---|---|
slotIndex | luaIndex |
Returns
questInfo | ItemQuestInfo |
|---|
C_Container.GetContainerNumFreeSlots
numFreeSlots, bagFamily = C_Container.GetContainerNumFreeSlots(bagIndex)
Arguments
bagIndex | BagIndex |
|---|
Returns
numFreeSlots | number | |
|---|---|---|
bagFamily | number may be nil |
C_Container.GetContainerNumSlots
numSlots = C_Container.GetContainerNumSlots(containerIndex)
Arguments
containerIndex | BagIndex |
|---|
Returns
numSlots | number |
|---|
C_Container.GetInsertItemsLeftToRight
isEnabled = C_Container.GetInsertItemsLeftToRight()
Returns
isEnabled | bool |
|---|
C_Container.GetItemCooldown
startTime, duration, enable = C_Container.GetItemCooldown(itemID)
May return nothing.
Arguments
itemID | number |
|---|
Returns
startTime | number | |
|---|---|---|
duration | number | |
enable | number |
C_Container.GetMaxArenaCurrency
maxCurrency = C_Container.GetMaxArenaCurrency()
Returns
maxCurrency | number |
|---|
C_Container.GetSortBagsRightToLeft
isEnabled = C_Container.GetSortBagsRightToLeft()
Returns
isEnabled | bool |
|---|
C_Container.HasContainerItem
hasItem = C_Container.HasContainerItem(containerIndex, slotIndex)
Arguments
containerIndex | BagIndex | |
|---|---|---|
slotIndex | luaIndex |
Returns
hasItem | bool |
|---|
C_Container.IsBattlePayItem
isBattlePayItem = C_Container.IsBattlePayItem(containerIndex, slotIndex)
Arguments
containerIndex | BagIndex | |
|---|---|---|
slotIndex | luaIndex |
Returns
isBattlePayItem | bool |
|---|
C_Container.IsContainerFiltered
isFiltered = C_Container.IsContainerFiltered(containerIndex)
Arguments
containerIndex | BagIndex |
|---|
Returns
isFiltered | bool |
|---|
C_Container.PickupContainerItem
C_Container.PickupContainerItem(containerIndex, slotIndex)
Arguments
containerIndex | BagIndex | |
|---|---|---|
slotIndex | luaIndex |
C_Container.PlayerHasHearthstone
itemID = C_Container.PlayerHasHearthstone()
Returns
itemID | number may be nil |
|---|
C_Container.SetBackpackAutosortDisabled
C_Container.SetBackpackAutosortDisabled(disable)
Arguments
disable | bool |
|---|
C_Container.SetBackpackSellJunkDisabled
C_Container.SetBackpackSellJunkDisabled(disable)
Arguments
disable | bool |
|---|
C_Container.SetBagPortraitTexture
C_Container.SetBagPortraitTexture(texture, bagIndex)
Arguments
texture | SimpleTexture | |
|---|---|---|
bagIndex | BagIndex |
C_Container.SetBagSlotFlag
C_Container.SetBagSlotFlag(bagIndex, flag, isSet)
Arguments
bagIndex | BagIndex | |
|---|---|---|
flag | BagSlotFlags | |
isSet | bool |
C_Container.SetBankAutosortDisabled
C_Container.SetBankAutosortDisabled(disable)
Arguments
disable | bool |
|---|
C_Container.SetInsertItemsLeftToRight
C_Container.SetInsertItemsLeftToRight(enable)
Arguments
enable | bool |
|---|
C_Container.SetItemSearch
C_Container.SetItemSearch(searchString)
Arguments
searchString | cstring |
|---|
C_Container.SetSortBagsRightToLeft
C_Container.SetSortBagsRightToLeft(enable)
Arguments
enable | bool |
|---|
C_Container.ShowContainerSellCursor
C_Container.ShowContainerSellCursor(containerIndex, slotIndex)
Arguments
containerIndex | BagIndex | |
|---|---|---|
slotIndex | luaIndex |
C_Container.SocketContainerItem
success = C_Container.SocketContainerItem(containerIndex, slotIndex)
Arguments
containerIndex | BagIndex | |
|---|---|---|
slotIndex | luaIndex |
Returns
success | bool |
|---|
C_Container.SortAccountBankBags
C_Container.SortAccountBankBags()
C_Container.SortBags
C_Container.SortBags()
C_Container.SortBank
C_Container.SortBank(bankType)
Arguments
bankType | BankType |
|---|
C_Container.SortBankBags
C_Container.SortBankBags()
C_Container.SplitContainerItem
C_Container.SplitContainerItem(containerIndex, slotIndex, amount)
Arguments
containerIndex | BagIndex | |
|---|---|---|
slotIndex | luaIndex | |
amount | number |
C_Container.UseContainerItem
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
used = C_Container.UseHearthstone()
Returns
used | bool |
|---|
Events
BAG_CLOSED
bagID | BagIndex |
|---|
BAG_CONTAINER_UPDATE
No payload.
BAG_NEW_ITEMS_UPDATED
No payload.
BAG_OPEN
bagID | number |
|---|
BAG_OVERFLOW_WITH_FULL_INVENTORY
No payload.
BAG_SLOT_FLAGS_UPDATED
slot | number |
|---|
BAG_UPDATE
bagID | BagIndex |
|---|
BAG_UPDATE_COOLDOWN
No payload.
BAG_UPDATE_DELAYED
No payload.
EQUIP_BIND_REFUNDABLE_CONFIRM
slot | number | |
|---|---|---|
itemLocation | ItemLocation |
EQUIP_BIND_TRADEABLE_CONFIRM
slot | number | |
|---|---|---|
itemLocation | ItemLocation |
EXPAND_BAG_BAR_CHANGED
expandBagBar | bool |
|---|
INVENTORY_SEARCH_UPDATE
No payload.
ITEM_LOCK_CHANGED
bagOrSlotIndex | BagIndex | |
|---|---|---|
slotIndex | luaIndex may be nil |
ITEM_LOCKED
bagOrSlotIndex | BagIndex | |
|---|---|---|
slotIndex | luaIndex may be nil |
ITEM_UNLOCKED
bagOrSlotIndex | BagIndex | |
|---|---|---|
slotIndex | luaIndex may be nil |
USE_COMBINED_BAGS_CHANGED
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 |