Classes
Target
Properties
lastObjectSerial
lastObjectSerial: number;
Serial of the last object used, i.e. double-clicked by the player
Methods
entity()
entity(serial: SerialOrEntity): void
Target a Mobile or an Item with the currently open target
Parameters
Parameter | Type |
---|---|
serial | SerialOrEntity |
Example
client.castSpell(Spells.Heal);
target.wait();
target.entity(player);
query()
query(isGround?: boolean): TargetInfo
Creates a target and returns information about the result
Parameters
Parameter | Type |
---|---|
isGround ? | boolean |
Returns
TargetInfo
repeatLast()
repeatLast(): void
Repeats the last targeting information based on the cursor type, e.g. Entity/Position etc
Examples
client.castSpell(Spells.Heal);
target.wait();
target.repeatLast();
client.castSpell(Spells.Teleport);
target.wait();
target.repeatLast();
self()
self(): void
Target self with the currently open target
Example
client.castSpell(Spells.Heal);
target.wait();
target.self();
terrain()
terrain(
x: number,
y: number,
z: number,
graphic?: number): void
Target a Tile or Static
When graphic
is omitted it will target LAND
by default.
Parameters
Parameter | Type |
---|---|
x | number |
y | number |
z | number |
graphic ? | number |
Examples
client.castSpell(Spells.Teleport);
target.wait();
target.terrain(1203, 222, 0);
client.castSpell(Spells.Teleport);
target.wait();
target.terrain(1203, 222, 0, 0x5a2);
terrainRelativeToEntity()
terrainRelativeToEntity(
entity: SerialOrEntity,
range: number,
forward: boolean,
graphic?: number): void
Target a Tile or Static from a specific Item or Mobile
When graphic
is omitted it will target LAND
by default.
Parameters
Parameter | Type |
---|---|
entity | SerialOrEntity |
range | number |
forward | boolean |
graphic ? | number |
Examples
client.castSpell(Spells.Teleport);
target.wait();
target.terrainRelativeToEntity(mob, 5, true);
client.castSpell(Spells.Teleport);
target.wait();
target.terrainRelativeToEntity(mob, 5, true, 0x5a2);
terrainWithOffset()
terrainWithOffset(
x: number,
y: number,
z: number,
graphic?: number): void
Target a Tile or Static where { x, y, z }
is the distance from the player.
When graphic
is omitted it will target LAND
by default.
Parameters
Parameter | Type |
---|---|
x | number |
y | number |
z | number |
graphic ? | number |
Examples
client.castSpell(Spells.Teleport);
target.wait();
target.terrainWithOffset(-1, -2, 0);
client.castSpell(Spells.Teleport);
target.wait();
target.terrainWithOffset(-1, -2, 0, 0x5a2);
wait()
wait(timeoutMs?: number): boolean
Wait for the target to open within a specific amount of time.
Parameters
Parameter | Type |
---|---|
timeoutMs ? | number |
Returns
boolean
waitTargetEntity()
waitTargetEntity(entity: SerialOrEntity, timeoutMs?: number): boolean
Waits for the target to open, and then targets the desired entity
Parameters
Parameter | Type |
---|---|
entity | SerialOrEntity |
timeoutMs ? | number |
Returns
boolean
waitTargetSelf()
waitTargetSelf(timeoutMs?: number): boolean
Wait for target with a specific amount of time, when open target self.
Parameters
Parameter | Type |
---|---|
timeoutMs ? | number |
Returns
boolean
Example
player.useType(0xe21);
target.waitTargetSelf();
waitTargetType()
waitTargetType(
graphic: number,
hue?: number,
timeoutMs?: number): boolean
Wait for target, when open target the first object with a certain graphic/hue
Parameters
Parameter | Type |
---|---|
graphic | number |
hue ? | number |
timeoutMs ? | number |
Returns
boolean
Example
player.useType(0xf9d);
target.waitTargetType(0x1078);