ESODecoded

GetBagSize

ESO Lua API function — used by 243 of the 3,030 addons we indexed (combined 44,771,786 downloads). Signature from the official ESOUIDocumentation.txt, API version 101050.

Official signature

GetBagSize([Bag|#Bag] bagId)

Returns: integer bagSlots

Real usage — from Dolgubon's Lazy Writ Crafter

	emptySlots = {}
	for i = FindFirstEmptySlotInBag(location) or 250, GetBagSize(location) - 1 do
		if GetItemName(location, i) == "" then

Short excerpt from the shipping addon Dolgubon's Lazy Writ Crafterits ESOUI page; the code belongs to its author. Shown because documentation without a working example is half a reference.

Most-downloaded addons using it

AddonTotal downloads
Dolgubon's Lazy Writ Crafter9,498,314
LibLazyCrafting6,538,592
CraftStore5,176,147
Inventory Insight2,763,446
WritWorthy2,484,332
Research Assistant (Find your researchable items)1,749,216