Movement
client:setPoint(point, teleport?)
| Field | Type |
|---|---|
| Signature | (self: Client, point: Vec2i, teleport: boolean?) → string? |
| Returns | string? — nil when the move resolves; an Errors.* code on failure |
| Common errors | Errors.NOT_IN_WORLD, Errors.CANCELLED, Errors.DISCONNECTED |
| Async | yes |
teleport=true sends mP{tp:true} directly (server may reject + snap back). The default runs A* + interpolated walk and blocks until the move resolves.
client:setPosition(pos, teleport?)
| Field | Type |
|---|---|
| Signature | (self: Client, pos: Vec2, teleport: boolean?) → string? |
| Returns | string? — nil on success |
| Common errors | Errors.NOT_IN_WORLD, Errors.CANCELLED, Errors.DISCONNECTED |
| Async | yes |
Same as setPoint but takes world coords (sub-tile precision) instead of tile coords.
client:movePoint(delta)
| Field | Type |
|---|---|
| Signature | (self: Client, delta: Vec2i) → string? |
| Returns | string? — nil on success |
| Async | yes |
client:movePosition(delta)
| Field | Type |
|---|---|
| Signature | (self: Client, delta: Vec2) → string? |
| Returns | string? — nil on success |
| Async | yes |
local point = Vector2i.new(40, 30)
local size = Vector2.new(0.16, 0.32)
-- Absolute teleport / set
client:setPosition(point:position(size), true) -- 2nd arg = teleport flag
client:setPoint(point, false)
-- Relative
client:movePoint(Vector2i.new(0, 1)) -- up one tile
client:movePoint(Vector2i.new(1, 0)) -- right one tile
client:movePosition(Vector2.new(0.16, 0)) -- right half-tile
client:movePosition(Vector2.new(0, -0.01)) -- down 1/32 of a tile
Pathfinding
client:getPath(point)
| Field | Type |
|---|---|
| Signature | (self: Client, point: Vec2i) → {Vec2i}? |
| Returns | 1-indexed table of {x, y} points along the route. Empty when no path is reachable |
| Async | yes |
Computes the path without walking it.
client:findPath(point)
| Field | Type |
|---|---|
| Signature | (self: Client, point: Vec2i) → string? |
| Returns | boolean — true if the walk task launched, false when the bot's start tile is unknown |
| Async | yes |
Kicks an A* walk; returns immediately. Poll pathfinding() until false.
client:planPath(from, to)
| Field | Type |
|---|---|
| Signature | (self: Client, from: Vec2i, to: Vec2i) → {Vec2i} |
| Returns | 1-indexed table of {x, y} points along the route (includes both endpoints). Empty when no path exists |
| Async | yes |
Read-only A* between two arbitrary tiles. Same physics-aware planner the bot uses for walk_to, but does not move the bot. Use this for AI / target-picking that needs to compare reachability of multiple candidates without committing to walk.
local from = Vector2i.new(10, 5)
local to = Vector2i.new(40, 12)
local path = client:planPath(from, to)
if #path > 0 then
print("reachable in " .. #path .. " steps")
else
print("no route")
end
client:hasPathBetween(from, to)
| Field | Type |
|---|---|
| Signature | (self: Client, from: Vec2i, to: Vec2i) → boolean |
| Returns | boolean — true if a path exists |
| Async | yes |
Boolean shortcut for planPath — skips building the waypoint table. Use when you only care whether a route exists.
if client:hasPathBetween(client:point(), Vector2i.new(50, 20)) then
client:findPath(Vector2i.new(50, 20))
end
client:pathfinding()
| Field | Type |
|---|---|
| Signature | (self: Client) → boolean |
| Returns | boolean — true while a walk task is in flight |
| Async | no |
client:clearPath()
| Field | Type |
|---|---|
| Signature | (self: Client) → () |
| Returns | nothing — aborts the in-flight walk |
| Async | no |
local ok = client:findPath(Vector2i.new(5, 3))
while ok and client:pathfinding() do
sleep(100)
end
Location
client:point()
| Field | Type |
|---|---|
| Signature | (self: Client) → Vec2i |
| Returns | Vec2i — current map tile |
| Async | yes |
client:position()
| Field | Type |
|---|---|
| Signature | (self: Client) → Vec2 |
| Returns | Vec2 — current world position (sub-tile precision) |
| Async | yes |
client:navigation()
| Field | Type |
|---|---|
| Signature | (self: Client) → string? |
| Returns | string? — "EXIT" at the menu, the world name in-world, nil for any transitional / terminal state |
| Async | yes |