Docs · camera

camera

3 camera commands, generated from the engine's own registry — signatures, parameters and a worked example each. A does something command acts on the game; a needs x() one answers a confident wrong answer when its client hooks are missing.

face does something returns bool
face(target: object) -> boolface(target: wall) -> boolface(target: npc) -> boolface(target: drop) -> bool

Turns the view until the client is drawing this, and returns whether it is. Returns immediately when it already was. Refuses without turning when the target is out of range rather than out of shot - turning cannot fix distance, and the trace says which of the two it was. Gives up after a full turn, or about three seconds; six at the very worst.

ParameterTypeWhat it does
targetrequired object the object to turn toward
Example
let rock = nearestObject(name: "Iron rock", within: 12)
if rock != none and face(rock) { interact(rock, "Mine") }
let door = nearestWall(name: "Door", within: 6)
if door != none { face(door) }
let banker = nearestNpc(id: 95, within: 20)
if banker != none { face(banker) }
let loot = nearestDrop(name: "Coins", within: 8)
if loot != none { face(loot) }
rotateLeft does something
rotateLeft(millis: int)

Turns the view left by holding the left arrow key. Blocks for that long, and stops promptly when the script is stopped. Prefer face(target), which turns until the thing is actually drawn instead of for a guessed duration; this is the manual version.

ParameterTypeWhat it does
millisrequired int how long to hold the key
Example
let banker = nearestNpc(id: 95, within: 20)
if banker != none and not banker.onScreen { rotateLeft(300) }
rotateRight does something
rotateRight(millis: int)

Turns the view right by holding the right arrow key. The mirror of rotateLeft; which one you want depends on where the target is, and a script that does not know should call face(target) instead.

ParameterTypeWhat it does
millisrequired int how long to hold the key
Example
rotateRight(300)