player

The local player: walking, webwalking, vitals, inventory, gear, combat, magic and prayer.

Methods
40
Fields
None

Getting one

player

Methods

MethodReturnsDescription
isMoving()booleanWhether the local player is walking or running.
isLoggedIn()booleanWhether a character is logged in.
isAnimating()booleanWhether the local player is playing an animation.
isInteracting()booleanWhether the local player has an interaction target.
isRunEnabled()booleanWhether run is toggled on. Says nothing about remaining energy.
setRunEnabled(boolean)booleanTurn run on or off.
setBoatHeading(number)booleanTurn the boat the player is sailing to a compass step.
isIdle()booleanWhether the player is idle enough to be given something to do.
isInPoh()booleanWhether the local player is inside a player-owned house.
house()House?The local player's own house as the client last saw it inside: its portals, jewellery box, pool, altars and travel furniture. Saved per acc…
currentHitpoints()numberCurrent hitpoints, as the orb reads them.
currentPrayerPoints()numberCurrent prayer points, as the orb reads them.
vitals()VitalsHitpoints, prayer, run energy and special attack energy, as the orbs read them.
combatLevel()numberThe local player's combat level.
tile()WorldPoint?The tile the local player stands on, in the coordinates of the scene loaded now. Inside an instance this is the instance's tile, the space…
trueTile()WorldPoint?The tile the local player stands on in the real world: inside an instance, the map tile the instance was copied from.
walkTo(WorldPoint, number?)booleanWalk to a tile in the loaded scene, on-screen or not. A tile of the boat you stand on (a deck tile, as getWorldLocation() gives one aboar…
walkToArea(WorldArea)booleanWalk to the cheapest reachable tile in an area. Already being inside it answers true and causes no input.
stopWalking()booleanCancel a walk by walking to the tile already stood on.
webwalk()WebwalkThis plugin's webwalk: long-distance pathing across the world. There is one per plugin, and every call answers it. Raises where no plugin's…
isTeleblocked()booleanWhether the local player is teleblocked.
wildernessLevel()numberThe local player's Wilderness level, read off the HUD.
logout()booleanAsk the client to log out.
inventory()InventoryThe 28-slot inventory.
combat()CombatAttack range and speed, cooldowns, special attack, and attack style.
magic()MagicSpellbook, runes, castability, and casting.
prayer()PrayersPrayerbook, activation, flicking, and quick prayers.
equipment()EquipmentWorn gear.
quests()QuestsQuest states and progress.
consumables()ConsumablesFood, potions, and poison cures.
farming()FarmingThe account's farming patches and the Farming Guild contract, as the client tracks them.
sailing()SailingSailing: the boat the player is on, their boats, crew, docks, port tasks, Barracuda Trials and shipwrecks.
birdhouses(){ BirdhouseStatus }The four Fossil Island bird house spaces as the client last saw them, saved per account; empty until the player has been there with the cli…
charges()ItemChargesItem charges: fixed by the item id, or counted by the client (jewellery, the chronicle, the ring of endurance) and saved per account.
buffs()BuffsTimers and buffs, tracked whether or not the timers-and-buffs plugin is on.
dailies(){ Daily }The daily reminders, in a fixed order, read live from the game's vars.
slayer()SlayerTask?The slayer task, read from the game.
kingdom()Kingdom?The Kingdom of Miscellania's approval and coffer, saved per account, with an estimate of their decay since they were last seen.
essencePouches(){ EssencePouch }The five essence pouches as the game has them now, small to colossal: what each holds, what it can hold, and its wear. Empty when logged ou…
diaries()DiariesAchievement diary completion, read from the game's own completion vars.

Method details

isLoggedIn

isLoggedIn: (PlayerDomain) -> boolean

Whether a character is logged in.

Almost every hook should start here: the rest of this domain answers with defaults rather than errors when nobody is logged in.

setRunEnabled

setRunEnabled: (PlayerDomain, boolean) -> boolean

Turn run on or off.

Asks for a STATE, not a flip, so it will not turn run off because it happened to already be on.

enabled
What it should be.
Returns
false when it is already that.

setBoatHeading

setBoatHeading: (PlayerDomain, number) -> boolean

Turn the boat the player is sailing to a compass step.

step
0 to 15, as the "Set heading" entry captures it. Anything else raises.

isIdle

isIdle: (PlayerDomain) -> boolean

Whether the player is idle enough to be given something to do.

Neither animating nor moving. A cheap guard against queueing a second action on top of one already playing out.

isInPoh

isInPoh: (PlayerDomain) -> boolean

Whether the local player is inside a player-owned house.

house

house: (PlayerDomain) -> House?

The local player's own house as the client last saw it inside: its portals, jewellery box, pool, altars and travel furniture. Saved per account and refreshed in full on each visit, so removed furniture is noticed; a friend's house is never recorded.

Returns
nil when this account's house has never been seen.

tile

tile: (PlayerDomain) -> WorldPoint?

The tile the local player stands on, in the coordinates of the scene loaded now. Inside an instance this is the instance's tile, the space getWorldLocation() answers in; on an ordinary map it is the same tile as trueTile.

Returns
nil when logged out.

trueTile

trueTile: (PlayerDomain) -> WorldPoint?

The tile the local player stands on in the real world: inside an instance, the map tile the instance was copied from.

Returns
nil before there is a local player.

walkTo

walkTo: (PlayerDomain, WorldPoint, number?) -> boolean

Walk to a tile in the loaded scene, on-screen or not. A tile of the boat you stand on (a deck tile, as getWorldLocation() gives one aboard) walks on the deck; at the helm no walk is made. For anywhere further, use webwalk.

player:walkTo(WorldPoint.new(3200, 3200, 0))
player:walkTo(bankTile, 3) -- anywhere within 3 tiles will do
tile
Destination.
distance
How close is close enough, in tiles. With it, already being within it answers true and causes no input, and the walk goes to a reachable tile within it.
Returns
false when no walk was queued.

walkToArea

walkToArea: (PlayerDomain, WorldArea) -> boolean

Walk to the cheapest reachable tile in an area. Already being inside it answers true and causes no input.

area
Destination area.
Returns
false when no tile of it can be reached.

webwalk

webwalk: (PlayerDomain) -> Webwalk

This plugin's webwalk: long-distance pathing across the world. There is one per plugin, and every call answers it. Raises where no plugin's code is running to own it, as in coroutine.wrap(player.webwalk)(player); the walk's start calls raise there too.

player:webwalk():start(WorldPoint.new(3165, 3487, 0))
if player:webwalk():isWalking() then return end

wildernessLevel

wildernessLevel: (PlayerDomain) -> number

The local player's Wilderness level, read off the HUD.

Returns
0 when not in the Wilderness.

sailing

sailing: (PlayerDomain) -> Sailing

Sailing: the boat the player is on, their boats, crew, docks, port tasks, Barracuda Trials and shipwrecks.

birdhouses

birdhouses: (PlayerDomain) -> { BirdhouseStatus }

The four Fossil Island bird house spaces as the client last saw them, saved per account; empty until the player has been there with the client running.

charges

charges: (PlayerDomain) -> ItemCharges

Item charges: fixed by the item id, or counted by the client (jewellery, the chronicle, the ring of endurance) and saved per account.

buffs

buffs: (PlayerDomain) -> Buffs

Timers and buffs, tracked whether or not the timers-and-buffs plugin is on.

slayer

slayer: (PlayerDomain) -> SlayerTask?

The slayer task, read from the game.

Returns
nil without a task, or before the client has read it (it does within a tick of a change).

kingdom

kingdom: (PlayerDomain) -> Kingdom?

The Kingdom of Miscellania's approval and coffer, saved per account, with an estimate of their decay since they were last seen.

Returns
nil before the client has recorded them for this account.

essencePouches

essencePouches: (PlayerDomain) -> { EssencePouch }

The five essence pouches as the game has them now, small to colossal: what each holds, what it can hold, and its wear. Empty when logged out.