Skip to main content

Movement

client:setPoint(point, teleport?)

FieldType
Signature(self: Client, point: Vec2i, teleport: boolean?) → string?
Returnsstring?nil when the move resolves; an Errors.* code on failure
Common errorsErrors.NOT_IN_WORLD, Errors.CANCELLED, Errors.DISCONNECTED
Asyncyes

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?)

FieldType
Signature(self: Client, pos: Vec2, teleport: boolean?) → string?
Returnsstring?nil on success
Common errorsErrors.NOT_IN_WORLD, Errors.CANCELLED, Errors.DISCONNECTED
Asyncyes

Same as setPoint but takes world coords (sub-tile precision) instead of tile coords.

client:movePoint(delta)

FieldType
Signature(self: Client, delta: Vec2i) → string?
Returnsstring?nil on success
Asyncyes

client:movePosition(delta)

FieldType
Signature(self: Client, delta: Vec2) → string?
Returnsstring?nil on success
Asyncyes
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)

FieldType
Signature(self: Client, point: Vec2i) → {Vec2i}?
Returns1-indexed table of {x, y} points along the route. Empty when no path is reachable
Asyncyes

Computes the path without walking it.

client:findPath(point)

FieldType
Signature(self: Client, point: Vec2i) → string?
Returnsbooleantrue if the walk task launched, false when the bot's start tile is unknown
Asyncyes

Kicks an A* walk; returns immediately. Poll pathfinding() until false.

client:planPath(from, to)

FieldType
Signature(self: Client, from: Vec2i, to: Vec2i) → {Vec2i}
Returns1-indexed table of {x, y} points along the route (includes both endpoints). Empty when no path exists
Asyncyes

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)

FieldType
Signature(self: Client, from: Vec2i, to: Vec2i) → boolean
Returnsbooleantrue if a path exists
Asyncyes

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()

FieldType
Signature(self: Client) → boolean
Returnsbooleantrue while a walk task is in flight
Asyncno

client:clearPath()

FieldType
Signature(self: Client) → ()
Returnsnothing — aborts the in-flight walk
Asyncno
local ok = client:findPath(Vector2i.new(5, 3))
while ok and client:pathfinding() do
sleep(100)
end

Location

client:point()

FieldType
Signature(self: Client) → Vec2i
ReturnsVec2i — current map tile
Asyncyes

client:position()

FieldType
Signature(self: Client) → Vec2
ReturnsVec2 — current world position (sub-tile precision)
Asyncyes

client:navigation()

FieldType
Signature(self: Client) → string?
Returnsstring?"EXIT" at the menu, the world name in-world, nil for any transitional / terminal state
Asyncyes