Skip to content

Classes

Player

This class references the current player whilst in-game and is accessible on the global scope as the player variable.

Example

ts
while (true) {
  if (player.hits < 50) {
    player.say('I need healing!');
  }
  sleep(500);
}

Extends

Properties

backpack
ts
backpack: undefined | Item;

coldResistance
ts
coldResistance: number;

damageIncrease
ts
damageIncrease: number;

damageMax
ts
damageMax: number;

damageMin
ts
damageMin: number;

defenseChanceIncrease
ts
defenseChanceIncrease: number;

dexterity
ts
dexterity: number;

direction
ts
direction: number;

Gets the direction of the entity as a number, if it has one. Returns 0 if the client does not know (e.g. item.maxHits) or the entity is no longer on screen.

Compare using the Directions enum.

Example
ts
const entity = client.findObject(0x991);
if (entity) {
  if (entity.direction === Directions.North) {
    console.log(`${entity.name} is facing North`);
  } else {
    console.log(Directions[entity.direction]); // Prints the directions name, e.g. East
  }
}
Inherited from

Mobile.direction


energyResistance
ts
energyResistance: number;

equippedItems
ts
equippedItems: object;
MemberType
armsItem
beardItem
braceletItem
cloakItem
earringsItem
faceItem
glovesItem
hairItem
helmetItem
legsItem
mountItem
necklaceItem
oneHandedItem
pantsItem
ringItem
robeItem
shirtItem
shoesItem
skirtItem
talismanItem
torsoItem
tunicItem
twoHandedItem
waistItem
Inherited from

Mobile.equippedItems


fasterCastRecovery
ts
fasterCastRecovery: number;

fasterCasting
ts
fasterCasting: number;

fireResistance
ts
fireResistance: number;

followers
ts
followers: number;

gold
ts
gold: number;

graphic
ts
graphic: number;

Gets the graphic id of the entity. Returns 0 if entity is no longer on screen.

Example
ts
console.log(player.graphic); // e.g. 400
Inherited from

Mobile.graphic


hitChanceIncrease
ts
hitChanceIncrease: number;

hits
ts
hits: number;

Gets the hits of the entity. Returns 0 if the client does not know (e.g. item.hits) or the entity is no longer on screen.

Example
ts
const entity = client.findObject(0x991);
if (entity) {
  console.log(entity.hits);
}
Inherited from

Mobile.hits


hue
ts
hue: number;

Gets the hue/color of the entity. Returns 0 if entity is no longer on screen.

Example
ts
const entity = client.findObject(player.equippedItems.robe);
if (entity) {
  console.log(entity.name);
}
Inherited from

Mobile.hue


inWarMode
ts
inWarMode: boolean;
Inherited from

Mobile.inWarMode


intelligence
ts
intelligence: number;

isDead
ts
isDead: boolean;
Inherited from

Mobile.isDead


isFemale
ts
isFemale: boolean;
Inherited from

Mobile.isFemale


isHidden
ts
isHidden: boolean;
Inherited from

Mobile.isHidden


isParalyzed
ts
isParalyzed: boolean;
Inherited from

Mobile.isParalyzed


isPoisoned
ts
isPoisoned: boolean;
Inherited from

Mobile.isPoisoned


isYellowHits
ts
isYellowHits: boolean;
Inherited from

Mobile.isYellowHits


lowerManaCost
ts
lowerManaCost: number;

lowerReagentCost
ts
lowerReagentCost: number;

luck
ts
luck: number;

mana
ts
mana: number;
Inherited from

Mobile.mana


maxColdResistence
ts
maxColdResistence: number;

maxDefenseChanceIncrease
ts
maxDefenseChanceIncrease: number;

maxEnergyResistence
ts
maxEnergyResistence: number;

maxFireResistence
ts
maxFireResistence: number;

maxFollowers
ts
maxFollowers: number;

maxHits
ts
maxHits: number;

Gets the maxHits of the entity. Returns 0 if the client does not know (e.g. item.maxHits) or the entity is no longer on screen.

Example
ts
const entity = client.findObject(0x991);
if (entity) {
  console.log(entity.maxHits);
}
Inherited from

Mobile.maxHits


maxMana
ts
maxMana: number;
Inherited from

Mobile.maxMana


maxPhysicResistence
ts
maxPhysicResistence: number;

maxPoisonResistence
ts
maxPoisonResistence: number;

maxStamina
ts
maxStamina: number;
Inherited from

Mobile.maxStamina


name
ts
name: string;

Gets the name of the entity. Returns an empty string if not known to the client yet.

Example
ts
const entity = client.findObject(player.equippedItems.robe);
if (entity) {
  console.log(entity.name);
}
Inherited from

Mobile.name


notoriety
ts
notoriety: Notorieties;
Inherited from

Mobile.notoriety


physicalResistance
ts
physicalResistance: number;

poisonResistance
ts
poisonResistance: number;

primaryAbility
ts
primaryAbility: Abilities;

secondaryAbility
ts
secondaryAbility: Abilities;

serial
ts
serial: number;
Overrides

Mobile.serial


spellDamageIncrease
ts
spellDamageIncrease: number;

stamina
ts
stamina: number;
Inherited from

Mobile.stamina


statsCap
ts
statsCap: number;

strength
ts
strength: number;

swingSpeedIncrease
ts
swingSpeedIncrease: number;

tithingPoints
ts
tithingPoints: number;

weight
ts
weight: number;

weightMax
ts
weightMax: number;

x
ts
x: number;

Gets the current X coordinate of the entity. Returns 0 if entity is no longer on screen.

Example
ts
const entity = client.findObject(player); // Replace with any other entity serial
console.log(entity.x);
Inherited from

Mobile.x


y
ts
y: number;

Gets the current Y coordinate of the entity. Returns 0 if entity is no longer on screen.

Example
ts
const entity = client.findObject(player);
console.log(entity.y);
Inherited from

Mobile.y


z
ts
z: number;

Gets the current Z coordinate of the entity. Returns 0 if entity is no longer on screen.

Example
ts
const entity = client.findObject(player);
console.log(entity.z);
Inherited from

Mobile.z

Methods

attack()
ts
attack(serial: SerialOrEntity): void

Attacks a mobile

Parameters
ParameterType
serialSerialOrEntity
Example
ts
player.attack(target.lastSerial);

bow()
ts
bow(): void

Triggers the Bow emote

Example
ts
player.bow();

cast()
ts
cast(spell: string | Spells): void

Casts a spell

Parameters
ParameterType
spellstring | Spells
Example
ts
player.cast(Spells.Agility);
target.wait();
target.entity(player);

castTo()
ts
castTo(
   spell:
  | Spells
  | "Clumsy"
  | "CreateFood"
  | "Feeblemind"
  | "Heal"
  | "MagicArrow"
  | "NightSight"
  | "ReactiveArmor"
  | "Weaken"
  | "Agility"
  | "Cunning"
  | "Cure"
  | "Harm"
  | "MagicTrap"
  | "RemoveTrap"
  | "Protection"
  | "Strength"
  | "Bless"
  | "Fireball"
  | "MagicLock"
  | "Poison"
  | "Telekinesis"
  | "Teleport"
  | "Unlock"
  | "WallOfStone"
  | "ArchCure"
  | "ArchProtection"
  | "Curse"
  | "FireField"
  | "GreaterHeal"
  | "Lightning"
  | "ManaDrain"
  | "Recall"
  | "BladeSpirits"
  | "DispelField"
  | "Incognito"
  | "MagicReflect"
  | "MindBlast"
  | "Paralyze"
  | "PoisonField"
  | "SummonCreature"
  | "Dispel"
  | "EnergyBolt"
  | "Explosion"
  | "Invisibility"
  | "Mark"
  | "MassCurse"
  | "ParalyzeField"
  | "Reveal"
  | "ChainLightning"
  | "EnergyField"
  | "FlameStrike"
  | "GateTravel"
  | "ManaVampire"
  | "MassDispel"
  | "MeteorSwarm"
  | "Polymorph"
  | "Earthquake"
  | "EnergyVortex"
  | "Resurrection"
  | "AirElemental"
  | "SummonDaemon"
  | "EarthElemental"
  | "FireElemental"
  | "WaterElemental"
  | "AnimateDead"
  | "BloodOath"
  | "CorpseSkin"
  | "CurseWeapon"
  | "EvilOmen"
  | "HorrificBeast"
  | "LichForm"
  | "MindRot"
  | "PainSpike"
  | "PoisonStrike"
  | "Strangle"
  | "SummonFamiliar"
  | "VampiricEmbrace"
  | "VengefulSpirit"
  | "Wither"
  | "WraithForm"
  | "Exorcism"
  | "CleanseByFire"
  | "CloseWounds"
  | "ConsecrateWeapon"
  | "DispelEvil"
  | "DivineFury"
  | "EnemyOfOne"
  | "HolyLight"
  | "NobleSacrifice"
  | "RemoveCurse"
  | "SacredJourney"
  | "HonorableExecution"
  | "Confidence"
  | "Evasion"
  | "CounterAttack"
  | "LightningStrike"
  | "MomentumStrike"
  | "FocusAttack"
  | "DeathStrike"
  | "AnimalForm"
  | "KiAttack"
  | "SurpriseAttack"
  | "Backstab"
  | "Shadowjump"
  | "MirrorImage"
  | "ArcaneCircle"
  | "GiftOfRenewal"
  | "ImmolatingWeapon"
  | "Attunement"
  | "Thunderstorm"
  | "NaturesFury"
  | "SummonFey"
  | "SummonFiend"
  | "ReaperForm"
  | "Wildfire"
  | "EssenceOfWind"
  | "DryadAllure"
  | "EtherealVoyage"
  | "WordOfDeath"
  | "GiftOfLife"
  | "ArcaneEmpowerment"
  | "NetherBolt"
  | "HealingStone"
  | "PurgeMagic"
  | "Enchant"
  | "Sleep"
  | "EagleStrike"
  | "AnimatedWeapon"
  | "StoneForm"
  | "SpellTrigger"
  | "MassSleep"
  | "CleansingWinds"
  | "Bombard"
  | "SpellPlague"
  | "HailStorm"
  | "NetherCyclone"
  | "RisingColossus"
  | "Inspire"
  | "Invigorate"
  | "Resilience"
  | "Perseverance"
  | "Tribulation"
  | "Despair"
  | "DeathRay"
  | "EtherealBurst"
  | "NetherBlast"
  | "MysticWeapon"
  | "CommandUndead"
  | "Conduit"
  | "ManaShield"
  | "SummonReaper"
  | "EnchantedSummoning"
  | "AnticipateHit"
  | "Warcry"
  | "Intuition"
  | "Rejuvenate"
  | "HolyFist"
  | "Shadow"
  | "WhiteTigerForm"
  | "FlamingShot"
  | "PlayingTheOdds"
  | "Thrust"
  | "Pierce"
  | "Stagger"
  | "Toughness"
  | "Onslaught"
  | "FocusedEye"
  | "ElementalFury"
  | "CalledShot"
  | "WarriorsGifts"
  | "ShieldBash"
  | "Bodyguard"
  | "HeightenSenses"
  | "Tolerance"
  | "InjectedStrike"
  | "Potency"
  | "Rampage"
  | "FistsOfFury"
  | "Knockout"
  | "Whispering"
  | "CombatTraining"
  | "Boarding",
   serial: SerialOrEntity,
   timeout?: number): void

Casts a spell and automatically targets the given serial on the next target

Parameters
ParameterType
spell| Spells | "Clumsy" | "CreateFood" | "Feeblemind" | "Heal" | "MagicArrow" | "NightSight" | "ReactiveArmor" | "Weaken" | "Agility" | "Cunning" | "Cure" | "Harm" | "MagicTrap" | "RemoveTrap" | "Protection" | "Strength" | "Bless" | "Fireball" | "MagicLock" | "Poison" | "Telekinesis" | "Teleport" | "Unlock" | "WallOfStone" | "ArchCure" | "ArchProtection" | "Curse" | "FireField" | "GreaterHeal" | "Lightning" | "ManaDrain" | "Recall" | "BladeSpirits" | "DispelField" | "Incognito" | "MagicReflect" | "MindBlast" | "Paralyze" | "PoisonField" | "SummonCreature" | "Dispel" | "EnergyBolt" | "Explosion" | "Invisibility" | "Mark" | "MassCurse" | "ParalyzeField" | "Reveal" | "ChainLightning" | "EnergyField" | "FlameStrike" | "GateTravel" | "ManaVampire" | "MassDispel" | "MeteorSwarm" | "Polymorph" | "Earthquake" | "EnergyVortex" | "Resurrection" | "AirElemental" | "SummonDaemon" | "EarthElemental" | "FireElemental" | "WaterElemental" | "AnimateDead" | "BloodOath" | "CorpseSkin" | "CurseWeapon" | "EvilOmen" | "HorrificBeast" | "LichForm" | "MindRot" | "PainSpike" | "PoisonStrike" | "Strangle" | "SummonFamiliar" | "VampiricEmbrace" | "VengefulSpirit" | "Wither" | "WraithForm" | "Exorcism" | "CleanseByFire" | "CloseWounds" | "ConsecrateWeapon" | "DispelEvil" | "DivineFury" | "EnemyOfOne" | "HolyLight" | "NobleSacrifice" | "RemoveCurse" | "SacredJourney" | "HonorableExecution" | "Confidence" | "Evasion" | "CounterAttack" | "LightningStrike" | "MomentumStrike" | "FocusAttack" | "DeathStrike" | "AnimalForm" | "KiAttack" | "SurpriseAttack" | "Backstab" | "Shadowjump" | "MirrorImage" | "ArcaneCircle" | "GiftOfRenewal" | "ImmolatingWeapon" | "Attunement" | "Thunderstorm" | "NaturesFury" | "SummonFey" | "SummonFiend" | "ReaperForm" | "Wildfire" | "EssenceOfWind" | "DryadAllure" | "EtherealVoyage" | "WordOfDeath" | "GiftOfLife" | "ArcaneEmpowerment" | "NetherBolt" | "HealingStone" | "PurgeMagic" | "Enchant" | "Sleep" | "EagleStrike" | "AnimatedWeapon" | "StoneForm" | "SpellTrigger" | "MassSleep" | "CleansingWinds" | "Bombard" | "SpellPlague" | "HailStorm" | "NetherCyclone" | "RisingColossus" | "Inspire" | "Invigorate" | "Resilience" | "Perseverance" | "Tribulation" | "Despair" | "DeathRay" | "EtherealBurst" | "NetherBlast" | "MysticWeapon" | "CommandUndead" | "Conduit" | "ManaShield" | "SummonReaper" | "EnchantedSummoning" | "AnticipateHit" | "Warcry" | "Intuition" | "Rejuvenate" | "HolyFist" | "Shadow" | "WhiteTigerForm" | "FlamingShot" | "PlayingTheOdds" | "Thrust" | "Pierce" | "Stagger" | "Toughness" | "Onslaught" | "FocusedEye" | "ElementalFury" | "CalledShot" | "WarriorsGifts" | "ShieldBash" | "Bodyguard" | "HeightenSenses" | "Tolerance" | "InjectedStrike" | "Potency" | "Rampage" | "FistsOfFury" | "Knockout" | "Whispering" | "CombatTraining" | "Boarding"
serialSerialOrEntity
timeout?number
Example
ts
player.castTo(Spells.Heal, player);

click()
ts
click(serial: SerialOrEntity): void

Simulates clicking an object

Parameters
ParameterType
serialSerialOrEntity
Example
ts
player.click(player);

equip()
ts
equip(serial: SerialOrEntity): void

Attempts to equip an item if possible

Parameters
ParameterType
serialSerialOrEntity
Example
ts
const axe = client.findType(0x0f49); // Axe graphic ID
player.equip(axe);

fly()
ts
fly(): void

Attempt to fly... if you can.

Example
ts
player.fly();

getAllSkills()
ts
getAllSkills(): undefined | object[]

Gets an array of all the skill values

Returns

undefined | object[]

Example
ts
const skills = player.getSkills();
console.log(skills[0].value); // Print Alchemy skill value

getSkill()
ts
getSkill(skill: Skills): undefined | object

Gets an object containing the values of a skill. The actual value of the skill is represented as an integer value with no decimal. e.g. 74.6 would be 746

Parameters
ParameterType
skillSkills
Returns

undefined | object

Example
ts
const anatomySkill = player.getSkill(Skills.Anatomy).value;

hasBuffDebuff()
ts
hasBuffDebuff(buffID: BuffDebuffs): boolean
Parameters
ParameterType
buffIDBuffDebuffs
Returns

boolean


land()
ts
land(): void

Turn off flying and land

Example
ts
player.land();

moveItem()
ts
moveItem(
   serial: SerialOrEntity,
   container: SerialOrEntity,
   x?: number,
   y?: number,
   z?: number,
   amount?: number): number

Attempts to move an object between containers

Parameters
ParameterType
serialSerialOrEntity
containerSerialOrEntity
x?number
y?number
z?number
amount?number
Returns

number

Example
ts
if (player.equippedItems.robe) {
  player.moveItem(player.equippedItems.robe, player.backpack);
}

moveItemOnGroundOffset()
ts
moveItemOnGroundOffset(
   serial: SerialOrEntity,
   x?: number,
   y?: number,
   z?: number,
   amount?: number): number

Attempts to move an object around on the ground using an offset

Parameters
ParameterType
serialSerialOrEntity
x?number
y?number
z?number
amount?number
Returns

number

Example
ts
const targetInfo = target.queryTarget();
if (targetInfo) {
  player.moveItemOnGroundOffset(targetInfo, 1, 0, 0); // Move item to the east
}

moveType()
ts
moveType(
   graphic: number,
   src: SerialOrEntity,
   dest: SerialOrEntity,
   x?: number,
   y?: number,
   z?: number,
   hue?: number,
   amount?: number,
   range?: number): number

Attempts to move an object of a certain type between containers

Parameters
ParameterType
graphicnumber
srcSerialOrEntity
destSerialOrEntity
x?number
y?number
z?number
hue?number
amount?number
range?number
Returns

number

Example
ts
player.moveType(0x0f52, player.backpack, bag);

moveTypeOnGroundOffset()
ts
moveTypeOnGroundOffset(
   graphic: number,
   src: SerialOrEntity,
   x?: number,
   y?: number,
   z?: number,
   hue?: number,
   amount?: number,
   range?: number): number

Attempts to move an object of a certain type onto the ground

Parameters
ParameterType
graphicnumber
srcSerialOrEntity
x?number
y?number
z?number
hue?number
amount?number
range?number
Returns

number

Example
ts
player.moveType(0x0f52, player.backpack); // Move item to the east

openDoor()
ts
openDoor(): void

Uses any door directly in-front of where the player is facing

Example
ts
player.openDoor();

run()
ts
run(direction: Directions): boolean

Run/turn a single step in a direction

Parameters
ParameterType
directionDirections
Returns

boolean

True if character can run

Example
ts
player.run(Directions.South);

salute()
ts
salute(): void

Triggers the Salute emote

Example
ts
player.salute();

say()
ts
say(message: string, hue?: number): void

Sends a chat message as your player, with an optional hue for the message.

Parameters
ParameterType
messagestring
hue?number
Example
ts
player.say('Hello there!');

setAbility()
ts
setAbility(primary: boolean, active: boolean): void

Toggle ability on/off

Parameters
ParameterType
primaryboolean
activeboolean
Example
ts
player.setAbility(true, false); // Turn primary ability off
player.setAbility(false, true); // Turn secondary ability on

setSkillLock()
ts
setSkillLock(skill: Skills, lock: SkillLock): void

Set the status of a skill lock

Parameters
ParameterType
skillSkills
lockSkillLock
Example
ts
player.setSkillLock(Skills.Anatomy, SkillLock.Down);

toggleFlying()
ts
toggleFlying(): void

Toggles flying, provided you are a Gargoyle.

Example
ts
player.toggleFlying();

toggleWarMode()
ts
toggleWarMode(): void

Toggle War Mode

Example
ts
player.toggleWarMode();

use()
ts
use(serial: SerialOrEntity): void

Attempts to use an object if possible

Parameters
ParameterType
serialSerialOrEntity
Example
ts
const dagger = client.findType(0x0f52); // Dagger graphic ID
player.use(dagger);

useItemInHand()
ts
useItemInHand(): void

Uses the item currently in your left-hand first, otherwise it will try the right.

Example
ts
player.useItemInHand();

useLastObject()
ts
useLastObject(): void

Uses the last object you double-clicked

Example
ts
player.useLastObject();

useSkill()
ts
useSkill(
   skill:
  | "RemoveTrap"
  | Skills
  | "Alchemy"
  | "Anatomy"
  | "AnimalLore"
  | "ItemID"
  | "ArmsLore"
  | "Parry"
  | "Begging"
  | "Blacksmith"
  | "Fletching"
  | "Peacemaking"
  | "Camping"
  | "Carpentry"
  | "Cartography"
  | "Cooking"
  | "DetectHidden"
  | "Discordance"
  | "EvalInt"
  | "Healing"
  | "Fishing"
  | "Forensics"
  | "Herding"
  | "Hiding"
  | "Provocation"
  | "Inscribe"
  | "Lockpicking"
  | "Magery"
  | "MagicResist"
  | "Tactics"
  | "Snooping"
  | "Musicianship"
  | "Poisoning"
  | "Archery"
  | "SpiritSpeak"
  | "Stealing"
  | "Tailoring"
  | "AnimalTaming"
  | "TasteID"
  | "Tinkering"
  | "Tracking"
  | "Veterinary"
  | "Swords"
  | "Macing"
  | "Fencing"
  | "Wrestling"
  | "Lumberjacking"
  | "Mining"
  | "Meditation"
  | "Stealth"
  | "Necromancy"
  | "Focus"
  | "Chivalry"
  | "Bushido"
  | "Ninjitsu"
  | "Spellweaving"
  | "Mysticism"
  | "Imbuing"
  | "Throwing",
   target?: SerialOrEntity,
   timeout?: number): void

Uses a skill

Parameters
ParameterType
skill| "RemoveTrap" | Skills | "Alchemy" | "Anatomy" | "AnimalLore" | "ItemID" | "ArmsLore" | "Parry" | "Begging" | "Blacksmith" | "Fletching" | "Peacemaking" | "Camping" | "Carpentry" | "Cartography" | "Cooking" | "DetectHidden" | "Discordance" | "EvalInt" | "Healing" | "Fishing" | "Forensics" | "Herding" | "Hiding" | "Provocation" | "Inscribe" | "Lockpicking" | "Magery" | "MagicResist" | "Tactics" | "Snooping" | "Musicianship" | "Poisoning" | "Archery" | "SpiritSpeak" | "Stealing" | "Tailoring" | "AnimalTaming" | "TasteID" | "Tinkering" | "Tracking" | "Veterinary" | "Swords" | "Macing" | "Fencing" | "Wrestling" | "Lumberjacking" | "Mining" | "Meditation" | "Stealth" | "Necromancy" | "Focus" | "Chivalry" | "Bushido" | "Ninjitsu" | "Spellweaving" | "Mysticism" | "Imbuing" | "Throwing"
target?SerialOrEntity
timeout?number
Example
ts
player.useSkill(Skills.Meditation);

@example Use skill and target yourself
```ts
player.useSkill(Skills.Anatomy);

useType()
ts
useType(
   graphic: number,
   hue?: number,
   sourceSerial?: SerialOrEntity,
   range?: number): boolean

Attempts to use an object of a certain type

Parameters
ParameterType
graphicnumber
hue?number
sourceSerial?SerialOrEntity
range?number
Returns

boolean

Example
ts
const myFriend = 0x217ded;
player.useType(0xe21); // Bandage type
target.wait(5000);
target.entity(myFriend);

useVirtue()
ts
useVirtue(
   virtue: Virtues | "Honor" | "Sacrifice" | "Valor",
   target?: SerialOrEntity,
   timeout?: number): void

Uses a virtue

Parameters
ParameterType
virtueVirtues | "Honor" | "Sacrifice" | "Valor"
target?SerialOrEntity
timeout?number
Example
ts
player.useVirtue(Virtues.Honor);

@example Use virtue and target yourself
```ts
player.useVirtue(Virtues.Honor);

waitForBuffDebuff()
ts
waitForBuffDebuff(buffId: BuffDebuffs, timeoutMs?: number): null | boolean
Parameters
ParameterType
buffIdBuffDebuffs
timeoutMs?number
Returns

null | boolean


walk()
ts
walk(direction: Directions): boolean

Walk/turn a single step in a direction

Parameters
ParameterType
directionDirections
Returns

boolean

True if character can walk

Example
ts
player.walk(Directions.North);