Classes
Client
Methods
toggleCircleOfTransparency()
toggleCircleOfTransparency(): void
Toggles the Circle of Transparency between states
Example
client.toggleCircleOfTransparency();
getPing()
(): number
Gets the current ping to the server (as seen in the Connection gump)
Returns
number
number
sysMsg()
(message: string, hue?: number): void
Display a message in the text chat.
Parameters
Parameter | Type |
---|---|
message | string |
hue ? | number |
Example
client.headMsg('A chat in Red', 33);
client.headMsg('A chat in Green', 66);
headMsg()
(
message: string,
serial: number | SerialObject | GameObject | "world",
hue?: number): void
Display a message overhead of the target entity.
Parameters
Parameter | Type |
---|---|
message | string |
serial | number | SerialObject | GameObject | "world" |
hue ? | number |
Example
client.headMsg('A message in Red', player, 33);
client.headMsg('A message in Green', player, 66);
openPaperdoll()
(serial?: number | SerialObject | GameObject | "world"): void
Open the paperdoll for a Mobile.
Parameters
Parameter | Type |
---|---|
serial ? | number | SerialObject | GameObject | "world" |
Example
const nearestHuman = client.selectEntity(
SearchEntityOptions.Any,
SearchEntityRangeOptions.Nearest,
SearchEntityTypeOptions.Human,
false
);
client.openPaperdoll(nearestHuman);
findObject()
(
serial: number | SerialObject | GameObject | "world",
hue?: null | number,
sourceSerial?:
| null
| number
| SerialObject
| GameObject
| "world",
amount?: null | number,
range?: null | number): any
Attempts to check whether a certain object can be found in the game.
Parameters
Parameter | Type |
---|---|
serial | number | SerialObject | GameObject | "world" |
hue ? | null | number |
sourceSerial ? | | null | number | SerialObject | GameObject | "world" |
amount ? | null | number |
range ? | null | number |
Example
const runebookSerial = 0x401c37fb;
const runebook = client.findObject(runebookSerial);
if (runebook) {
player.use(runebook);
} else {
client.headMsg('Runbook missing!', player.serial);
}
findType()
(
graphic: number,
hue?: null | number,
sourceSerial?:
| null
| number
| SerialObject
| GameObject
| "world",
amount?: null | number,
range?: null | number): any
Attempts to find an object in the world with the specified search parameters, returning it if found.
Parameters
Parameter | Type |
---|---|
graphic | number |
hue ? | null | number |
sourceSerial ? | | null | number | SerialObject | GameObject | "world" |
amount ? | null | number |
range ? | null | number |
Example
const bandageType = 0xe21;
const bandages = client.findType(bandageType);
if (bandages) {
player.use(bandages);
target.waitTargetSelf();
} else {
client.headMsg('Out of bandages', player.serial);
}
findAllOfType()
(
graphic: number,
hue?: null | number,
sourceSerial?:
| null
| number
| SerialObject
| GameObject
| "world",
amount?: null | number,
range?: null | number): any[]
Attempts to find all objects of a certain type (graphic), returning the matching Items/Mobiles.
Parameters
Parameter | Type |
---|---|
graphic | number |
hue ? | null | number |
sourceSerial ? | | null | number | SerialObject | GameObject | "world" |
amount ? | null | number |
range ? | null | number |
Returns
any
[]
Example
const goldPile = 0xeed;
const piles = client.findAllOfType(goldPile, undefined, 'world');
if (piles.length > 0) {
client.headMsg(`Found ${piles.length} gold piles on the ground`, player);
} else {
client.headMsg('No gold piles in range', player);
}
findAllItemsOfType()
(
graphic: number,
hue?: null | number,
sourceSerial?:
| null
| number
| SerialObject
| GameObject
| "world",
amount?: null | number,
range?: null | number): Item[]
Attempts to find all Items of a certain type (graphic).
Parameters
Parameter | Type |
---|---|
graphic | number |
hue ? | null | number |
sourceSerial ? | | null | number | SerialObject | GameObject | "world" |
amount ? | null | number |
range ? | null | number |
Returns
Item
[]
Example
const goldPile = 0xeed;
const piles = client.findAllItemsOfType(goldPile, undefined, 'world');
if (piles.length > 0) {
const total = piles.reduce((sum, item) => sum + item.amount, 0);
client.headMsg(`Found ${piles.length} piles, ${total} gold`, player);
} else {
client.headMsg('No gold piles in range', player);
}
findAllMobilesOfType()
(
graphic: number,
hue?: null | number,
sourceSerial?:
| null
| number
| SerialObject
| GameObject
| "world",
amount?: null | number,
range?: null | number): Mobile[]
Attempts to find all Mobiles of a certain type (graphic).
Parameters
Parameter | Type |
---|---|
graphic | number |
hue ? | null | number |
sourceSerial ? | | null | number | SerialObject | GameObject | "world" |
amount ? | null | number |
range ? | null | number |
Returns
Mobile
[]
Example
const sheepGraphic = 0xcf;
const sheep = client.findAllMobilesOfType(sheepGraphic);
if (sheep.length > 0) {
client.headMsg(`I count ${sheep.length} sheep`, player);
} else {
client.headMsg('No sheep here!', player);
}
findItemOnLayer()
(serial: number | SerialObject | GameObject | "world", layer: Layers): any
Attempts to find the object at the specified layer, if it exists.
Parameters
Parameter | Type |
---|---|
serial | number | SerialObject | GameObject | "world" |
layer | Layers |
Example
const helm = client.findItemOnLayer(player.serial, Layers.Helmet);
if (helm) {
client.headMsg(`Removing helm`, player);
player.moveItem(helm, player.backpack);
} else {
client.headMsg('Not wearing a helm', player.serial);
}
selectEntity()
(
searchOpt: number,
searchRangeOpt: number,
searchTypeOpt: number,
asFriend: boolean): any
Returns the entity based on the search criteria
Parameters
Parameter | Type |
---|---|
searchOpt | number |
searchRangeOpt | number |
searchTypeOpt | number |
asFriend | boolean |
Examples
client.selectEntity(
SearchEntityOptions.Enemy | SearchEntityOptions.Gray,
SearchEntityRangeOptions.Nearest,
SearchEntityTypeOptions.Any,
false
);
client.selectEntity(
SearchEntityOptions.Innocent,
SearchEntityRangeOptions.Nearest,
SearchEntityTypeOptions.Human,
false
);
allNames()
(): any
Triggers the All Names
macro which shows name overheads for all entities on-screen.
Example
client.allNames();
toggleAlwaysRun()
(): any
Toggles whether the player always runs despite the mouse distance from the player mobile.
Example
client.toggleAlwaysRun();
closeAllGumps()
(): any
Closes all gumps that aren't the Top Bar, Buff bar, or the World view (radar)
Example
client.closeAllGumps();
closeAllHealthBars()
(): any
Closes all healthbars on-screen
Example
client.closeAllHealthBars();
closeInactiveHealthBars()
(): any
Closes all inactive healthbars (i.e. dead or off-screen entities).
Example
client.closeInactiveHealthBars();
toggleChatVisibility()
(): any
Toggles the chat visibility, e.g. the bar at the bottom of the game viewport
Example
client.zoomIn();
toggleNameOverheads()
(): any
Toggles whether entities have name plates
Example
client.toggleNameOverheads();
toggleAuras()
(): any
Toggles whether mobiles have auras underneath them
Example
client.toggleAuras();
getStatic()
(graphic: number): undefined | object
Parameters
Parameter | Type |
---|---|
graphic | number |
Returns
undefined
| object
getTile()
(graphic: number): undefined | object
Parameters
Parameter | Type |
---|---|
graphic | number |
Returns
undefined
| object
getTerrainList()
(x: number, y: number): undefined | object[]
Parameters
Parameter | Type |
---|---|
x | number |
y | number |
Returns
undefined
| object
[]
sendBuyRequest()
(vendorSerial: any, items: object[]): boolean
Parameters
Parameter | Type |
---|---|
vendorSerial | any |
items | object [] |
Returns
boolean
sendSellRequest()
(vendorSerial: any, items: object[]): boolean
Parameters
Parameter | Type |
---|---|
vendorSerial | any |
items | object [] |
Returns
boolean
queryItemOPL()
(serialOrObject: number | SerialObject | GameObject | "world", timeout?: number): object
Parameters
Parameter | Type |
---|---|
serialOrObject | number | SerialObject | GameObject | "world" |
timeout ? | number |
Returns
object
Member | Type |
---|---|
amount | number |
data | null | string |
graphic | number |
hue | number |
name | string |
properties | null | object [] |
serial | number |
queryItemSingleClickName()
(serialOrObject: number | SerialObject | GameObject | "world", timeout?: number): string
Parameters
Parameter | Type |
---|---|
serialOrObject | number | SerialObject | GameObject | "world" |
timeout ? | number |
Returns
string