OSRS Plugin API
    Preparing search index...

    Function getNpcIdByName

    • Gets the Id of the first NPC that is identified by the given name, if the NPC is rendered on the player's screen. Otherwise, returns -1.

      Parameters

      • name: string

        The name of an NPC

      Returns number

      The Id of the named NPC

      id = osrs.ClientOp.getNpcIdByName("Emblem Trader")
      osrs.ClientOp.highlightNpcOn(id, osrs.ClientOp.npcCreationCycle(id), 6);