Skip to content

Classes

Item

Extends

Properties

amount
ts
amount: number;

Get the item's amount

Example
ts
const item = client.findObject(0x40001234);
if (item.amount > 5) {
  client.sysMsg('amount of ${item.amount}');
}

container
ts
container: number;

Get the item's parent container

Example
ts
const item = client.findType(axeType);
if (item.container > 0) {
  client.sysMsg('the item is into a container');
}

contents
ts
contents: undefined | Item[];

Get the item's contents

Example
ts
const itemList = player.backpack.contents;
for (const item of itemlist) {
  if (item.contents.length > 0) console.log("this item is a backpack's sub-container!");
}

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

Entity.direction


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

Entity.graphic


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

Entity.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

Entity.hue


isHidden
ts
isHidden: boolean;
Inherited from

Entity.isHidden


layer
ts
layer: Layers;

Get the item's layer if any

Example
ts
const robe = client.findItemOnLayer(player, Layers.Robe);
console.log(robe.layer);

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

Entity.maxHits


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

Entity.name


serial
ts
serial: number;
Inherited from

Entity.serial


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

Entity.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

Entity.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

Entity.z