anyObject
returns bool
anyObject(id: int, name: string, nameContains: string, within: int, area: area, command: string) -> bool
True when at least one object matches. Stops at the first one, so it is cheaper than counting.
| Parameter | Type | What it does |
| idoptional |
int |
the object id from the cache, not the server index |
| nameoptional |
string |
the whole name, ignoring case |
| nameContainsoptional |
string |
part of the name, ignoring case |
| withinoptional |
int |
how many tiles away at most, straight line |
| areaoptional |
area |
must be standing inside this area |
| commandoptional |
string |
offers this right-click option, such as "Chop down" |
Example
if anyObject(command: "Bank", within: 6) { stop }
nearestObject
returns object?
nearestObject(id: int, name: string, nameContains: string, within: int, area: area, command: string) -> object?
The closest object matching every option given, or none. Distance is straight-line from where you are standing, measured in the same reading the object was read from.
| Parameter | Type | What it does |
| idoptional |
int |
the object id from the cache, not the server index |
| nameoptional |
string |
the whole name, ignoring case |
| nameContainsoptional |
string |
part of the name, ignoring case |
| withinoptional |
int |
how many tiles away at most, straight line |
| areaoptional |
area |
must be standing inside this area |
| commandoptional |
string |
offers this right-click option, such as "Chop down" |
Example
let rock = nearestObject(name: "Iron rock", within: 12)
objectCount
returns int
objectCount(id: int, name: string, nameContains: string, within: int, area: area, command: string) -> int
How many objects match every option given. With no options, how many there are.
| Parameter | Type | What it does |
| idoptional |
int |
the object id from the cache, not the server index |
| nameoptional |
string |
the whole name, ignoring case |
| nameContainsoptional |
string |
part of the name, ignoring case |
| withinoptional |
int |
how many tiles away at most, straight line |
| areaoptional |
area |
must be standing inside this area |
| commandoptional |
string |
offers this right-click option, such as "Chop down" |
Example
if objectCount(name: "Iron rock", within: 12) == 0 { walkTo(tile(303, 553)) }
objects
returns list<object>
objects(id: int, name: string, nameContains: string, within: int, area: area, command: string) -> list<object>
Every object matching every option given, in whatever order the client holds them. With no options, all of them.
| Parameter | Type | What it does |
| idoptional |
int |
the object id from the cache, not the server index |
| nameoptional |
string |
the whole name, ignoring case |
| nameContainsoptional |
string |
part of the name, ignoring case |
| withinoptional |
int |
how many tiles away at most, straight line |
| areaoptional |
area |
must be standing inside this area |
| commandoptional |
string |
offers this right-click option, such as "Chop down" |
Example
for rock in objects(name: "Iron rock", within: 12) { approach(rock) }
objectsByDistance
returns list<object>
objectsByDistance(id: int, name: string, nameContains: string, within: int, area: area, command: string) -> list<object>
Every object matching every option given, closest first.
| Parameter | Type | What it does |
| idoptional |
int |
the object id from the cache, not the server index |
| nameoptional |
string |
the whole name, ignoring case |
| nameContainsoptional |
string |
part of the name, ignoring case |
| withinoptional |
int |
how many tiles away at most, straight line |
| areaoptional |
area |
must be standing inside this area |
| commandoptional |
string |
offers this right-click option, such as "Chop down" |
Example
for tree in objectsByDistance(command: "Chop down", within: 15) { approach(tree) }
No command on this page matches that. The search box looks across every page.