Classes
Mobile
Extends
Extended by
Properties
direction
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
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
equippedItems
equippedItems: object;
Member | Type |
---|---|
arms | Item |
beard | Item |
bracelet | Item |
cloak | Item |
earrings | Item |
face | Item |
gloves | Item |
hair | Item |
helmet | Item |
legs | Item |
mount | Item |
necklace | Item |
oneHanded | Item |
pants | Item |
ring | Item |
robe | Item |
shirt | Item |
shoes | Item |
skirt | Item |
talisman | Item |
torso | Item |
tunic | Item |
twoHanded | Item |
waist | Item |
graphic
graphic: number;
Gets the graphic id of the entity. Returns 0 if entity is no longer on screen.
Example
console.log(player.graphic); // e.g. 400
Inherited from
hits
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
const entity = client.findObject(0x991);
if (entity) {
console.log(entity.hits);
}
Inherited from
hue
hue: number;
Gets the hue/color of the entity. Returns 0 if entity is no longer on screen.
Example
const entity = client.findObject(player.equippedItems.robe);
if (entity) {
console.log(entity.name);
}
Inherited from
maxHits
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
const entity = client.findObject(0x991);
if (entity) {
console.log(entity.maxHits);
}
Inherited from
name
name: string;
Gets the name of the entity. Returns an empty string if not known to the client yet.
Example
const entity = client.findObject(player.equippedItems.robe);
if (entity) {
console.log(entity.name);
}
Inherited from
x
x: number;
Gets the current X coordinate of the entity. Returns 0 if entity is no longer on screen.
Example
const entity = client.findObject(player); // Replace with any other entity serial
console.log(entity.x);
Inherited from
y
y: number;
Gets the current Y coordinate of the entity. Returns 0 if entity is no longer on screen.
Example
const entity = client.findObject(player);
console.log(entity.y);