FindFirstEmptySlotInBag
ESO Lua API function — used by 53 of the 3,030 addons we indexed (combined 26,360,702 downloads). Signature from the official ESOUIDocumentation.txt, API version 101050.
Official signature
FindFirstEmptySlotInBag([Bag|#Bag] bagId)Returns: integer:nilable slotIndex
Real usage — from Dolgubon's Lazy Writ Crafter
emptySlots = {}
for i = FindFirstEmptySlotInBag(location) or 250, GetBagSize(location) - 1 do
if GetItemName(location, i) == "" thenShort excerpt from the shipping addon Dolgubon's Lazy Writ Crafter — 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 |
|---|---|
| Dolgubon's Lazy Writ Crafter | 9,498,314 |
| LibLazyCrafting | 6,538,592 |
| AwesomeGuildStore | 4,722,462 |
| LibMarify | 1,376,993 |
| AlphaGear 2 (Builds, Gear, Skills, Banking) | 848,683 |
| Roomba - Guildbank Stacker | 675,040 |