OSRS Plugin API
    Preparing search index...

    Function invGetNum

    • Gets the quantity of the item in the specified slot of the specified inventory.

      Parameters

      • invId: number

        id of the inventory to read the slot from

      • slot: number

        index of the slot in the inventory to read.

      Returns number

      the quantity of the item stack in the slot. -1 if none.

      local BACKPACK = 93;
      local slotNum = 3;
      local quantity = osrs.ClientOp.invGetNum(BACKPACK, slotNum)
      osrs.printf("Slot %s has %s item(s)", tostring(slotNum), tostring(quantity))