From ESOUI Wiki
This function returns the index of the first empty bag slot in the specified bag. If the specified bag is full, then this function returns nil.
- A number representing the bag to check; it must be one of the built-in Bag values.
-- GIVEN: -- number bagIndex -- -- RETURNS: number local slotIndex = FindFirstEmptySlotInBag(BAG_BACKPACK)
- This function only checks the current state of a bag. If a bag slot is about to be full — perhaps because it was used as the destination for RequestMoveItem — then it will still count as a "free slot."