OSRS Plugin API
    Preparing search index...

    Class ObjPileType

    Class representing the pile of objects on a tile.

    Implements

    Index

    Methods

    • Gets the number of objects stored in the pile.

      Returns number

      local function mousePickingCallback()
      for _, typeCode in pairs(osrs.Engine.MousePickingHelper.getPickedEntityTypecodes()) do
      local entityType = typeCode:getEntityType()
      local typeData = typeCode:getEntityTypeData()
      if typeData ~= nil then
      if entityType == osrs.TypecodeEntityType.OBJ then
      osrs.print(typeData:getCount())
      end
      end
      end
      end

      osrs.Events.subscribe(mousePickingCallback, osrs.Events.ON_GAME_TICK)
    • 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
    • Gets the list of objects stored in the pile.

      Returns ObjType[]

      local function mousePickingCallback()
      for _, typeCode in pairs(osrs.Engine.MousePickingHelper.getPickedEntityTypecodes()) do
      local entityType = typeCode:getEntityType()
      local typeData = typeCode:getEntityTypeData()
      if typeData ~= nil then
      if entityType == osrs.TypecodeEntityType.OBJ then
      local objList = typeData:getObjList();
      for _, obj in ipairs(objList) do
      osrs.print(obj:getName())
      end
      end
      end
      end
      end

      osrs.Events.subscribe(mousePickingCallback, osrs.Events.ON_GAME_TICK)