OSRS Plugin API
    Preparing search index...

    Type Alias OnNpcOpCallback

    OnNpcOpCallback: (opName: string, objId: number, npcId: number) => void

    The callback for Events.ON_NPC_OP events.

    Type Declaration

      • (opName: string, objId: number, npcId: number): void
      • Parameters

        • opName: string

          The Action selected by the player.

        • objId: number

          The id of the inventory object currently selected, if exists. Otherwise, -1.

        • npcId: number

          The id of the NPC the player is acting on.

        Returns void

    -- NPC says their name and the action the player selected to take on them.
    osrs.ClientOp.npcSay(npcId, string.format("You have selected %s with me, %s", opName, osrs.ClientOp.npcName(npcId)), 100)