GetNumBagFreeSlots
ESO Lua API function — used by 56 of the 3,030 addons we indexed (combined 11,401,971 downloads). Signature from the official ESOUIDocumentation.txt, API version 101050.
Official signature
GetNumBagFreeSlots([Bag|#Bag] bagId)Returns: integer freeSlots
Real usage — from CraftStore
if notpreview and control.data.craftable then
if GetNumBagFreeSlots(BAG_BACKPACK) > 0 then
local amount = isEnchanting and (tonumber(CraftStoreFixed_RuneAmount:GetText()) or 1) or (tonumber(CraftStoreFixed_CookAmount:GetText()) Short excerpt from the shipping addon CraftStore — its ESOUI page; the code belongs to its author. Shown because documentation without a working example is half a reference.
Most-downloaded addons using it
| Addon | Total downloads |
|---|---|
| CraftStore | 5,176,147 |
| Dustman | 1,178,205 |
| AlphaGear 2 (Builds, Gear, Skills, Banking) | 848,683 |
| Roomba - Guildbank Stacker | 675,040 |
| Wykkyd Toolbar | 567,448 |
| Wizard's Wardrobe | 481,038 |