OSRS Plugin API
    Preparing search index...

    Interface TypeDataHideconstructor

    interface TypeData {
        getEntityType(): TypecodeEntityType;
        getId(): number;
        getName(): string;
    }

    Implemented by

    Index

    Methods

    • Returns the type of the current entity.

      Returns TypecodeEntityType

      enum designating the type of the current entity.

      local loc = osrs.Engine.Decoders.decodeLocType(osrs.gamevals.loctypes.poh_portal_teak_empty)
      if(loc:getEntityType() == osrs.TypecodeEntityType.LOC) then
      osrs.print("Found type LOC")
      end

      local lesserdemon = osrs.Engine.Decoders.decodeNpcType(osrs.gamevals.npctypes.lesser_demon)
      if(lesserdemon:getEntityType() == osrs.TypecodeEntityType.NPC) then
      osrs.print("Found type NPC")
      end
    • Gets the id of the current datatype. Data types will return their type ID, which will match the id in gamevals.

      Returns number

      id of the current entity.

      local loc = osrs.Engine.Decoders.decodeLocType(osrs.gamevals.loctypes.poh_portal_teak_empty)
      if(loc:getEntityType() == osrs.TypecodeEntityType.LOC) then
      osrs.print("Found type LOC")
      end

      local lesserdemon = osrs.Engine.Decoders.decodeNpcType(osrs.gamevals.npctypes.lesser_demon)
      if(lesserdemon:getEntityType() == osrs.TypecodeEntityType.NPC) then
      osrs.print("Found type NPC")
      end
    • Returns the name of the entity.

      Returns string

      Returns the name of the entity as a string.

      local picked = osrs.Engine.MousePickingHelper.getPickedEntityTypecodes()
      for index, entity in pairs(picked) do
      local var = entity:getEntityTypeData()
      if(var ~= nil) then
      osrs.print(var:getName())
      end
      end