Gets the number of objects stored in the pile.
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.
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.
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
Gets the list of objects stored in the pile.
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)
Class representing the pile of objects on a tile.