OSRS Plugin API
    Preparing search index...

    Function invSize

    • Gets the number of slots in the specified inventory.

      Parameters

      • invId: number

        id of the inventory to read.

      Returns number

      number of slots in the specified inventory.

      local BACKPACK = 93;
      local size = osrs.ClientOp.invSize(BACKPACK);
      for i=0, size-1, 1 do
      local id = osrs.ClientOp.invGetObjId(BACKPACK, i)
      osrs.printf("Slot %d contains the item: %s", i, osrs.ClientOp.ocName(id))
      end