OSRS Plugin API
    Preparing search index...

    Function ocOp

    • Gets the name of the action at the provided index, if one exists, in the list of actions possible for the object identified by the provided object id.

      Parameters

      • objId: number

        the id of an object

      • index: number

        the index in the list of actions to read from

      Returns string

      the name of the action at the given index for the provided object.

      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, field action: %s", i, osrs.ClientOp.ocName(id), tostring(osrs.ClientOp.ocOp(id, 3)))
      end