Skip to content

game

Native global installed by the script host. on returns 0 when called outside an active file script; keep every positive id and release it in stop() with off for deterministic reloads.

Native global — no require.

walk

function · walk(direction: DirectionName): Result?, ErrorMessage?, string?

Diagnostic packet hex is the optional third failure result.

Parameters

NameTypeSummary
directionDirectionName

Returns

TypeSummary
Result?, ErrorMessage?, string?

move_to

function · move_to(x: integer, y: integer, z: integer): Result?, ErrorMessage?, string?

Native global installed by the script host. on returns 0 when called outside an active file script; keep every positive id and release it in stop() with off for deterministic reloads.

Parameters

NameTypeSummary
xinteger
yinteger
zinteger

Returns

TypeSummary
Result?, ErrorMessage?, string?

say

function · say(text: string, channel?: integer): Result?, ErrorMessage?, string?

Native global installed by the script host. on returns 0 when called outside an active file script; keep every positive id and release it in stop() with off for deterministic reloads.

Parameters

NameTypeSummary
textstring
channelinteger

Returns

TypeSummary
Result?, ErrorMessage?, string?

use_on_self

function · use_on_self(item_id: ItemId): Result?, ErrorMessage?, string?

Native global installed by the script host. on returns 0 when called outside an active file script; keep every positive id and release it in stop() with off for deterministic reloads.

Parameters

NameTypeSummary
item_idItemId

Returns

TypeSummary
Result?, ErrorMessage?, string?

use_on_creature

function · use_on_creature(item_id: ItemId, creature_id: integer): Result?, ErrorMessage?, string?

Native global installed by the script host. on returns 0 when called outside an active file script; keep every positive id and release it in stop() with off for deterministic reloads.

Parameters

NameTypeSummary
item_idItemId
creature_idinteger

Returns

TypeSummary
Result?, ErrorMessage?, string?

on

function · on(name: string, callback: GameEventCallback|TickCallback|KeyCallback|RenderCallback): SubscriptionId

Native global installed by the script host. on returns 0 when called outside an active file script; keep every positive id and release it in stop() with off for deterministic reloads.

Parameters

NameTypeSummary
namestring
callbackGameEventCallback|TickCallback|KeyCallback|RenderCallback

Returns

TypeSummary
SubscriptionId

off

function · off(id: SubscriptionId): boolean

Native global installed by the script host. on returns 0 when called outside an active file script; keep every positive id and release it in stop() with off for deterministic reloads.

Parameters

NameTypeSummary
idSubscriptionId

Returns

TypeSummary
boolean

get_local_player

function · get_local_player(): NativePlayerSnapshot?

Native global installed by the script host. on returns 0 when called outside an active file script; keep every positive id and release it in stop() with off for deterministic reloads.

Returns

TypeSummary
NativePlayerSnapshot?

get_creatures

function · get_creatures(): NativePlayerSnapshot[]

Native global installed by the script host. on returns 0 when called outside an active file script; keep every positive id and release it in stop() with off for deterministic reloads.

Returns

TypeSummary
NativePlayerSnapshot[]

tile_to_screen

function · tile_to_screen(world_x: integer, world_y: integer, world_z: integer, extra?: any): any

Native global installed by the script host. on returns 0 when called outside an active file script; keep every positive id and release it in stop() with off for deterministic reloads.

Parameters

NameTypeSummary
world_xinteger
world_yinteger
world_zinteger
extraany

Returns

TypeSummary
any

screen_to_tile

function · screen_to_tile(screen_x: number, screen_y: number, extra?: any): any

Native global installed by the script host. on returns 0 when called outside an active file script; keep every positive id and release it in stop() with off for deterministic reloads.

Parameters

NameTypeSummary
screen_xnumber
screen_ynumber
extraany

Returns

TypeSummary
any

input_snapshot

function · input_snapshot(virtual_key?: integer): GameInputSnapshot

Native global installed by the script host. on returns 0 when called outside an active file script; keep every positive id and release it in stop() with off for deterministic reloads.

Parameters

NameTypeSummary
virtual_keyinteger

Returns

TypeSummary
GameInputSnapshot

layout

function · layout(name: string): GameLayoutRow?

Native global installed by the script host. on returns 0 when called outside an active file script; keep every positive id and release it in stop() with off for deterministic reloads.

Parameters

NameTypeSummary
namestring

Returns

TypeSummary
GameLayoutRow?

storage

function · storage: GameStorageApi

Native global installed by the script host. on returns 0 when called outside an active file script; keep every positive id and release it in stop() with off for deterministic reloads.

map

function · map: GameMapApi

Native global installed by the script host. on returns 0 when called outside an active file script; keep every positive id and release it in stop() with off for deterministic reloads.

alert

function · alert: GameAlertApi

Native global installed by the script host. on returns 0 when called outside an active file script; keep every positive id and release it in stop() with off for deterministic reloads.

http

function · http: GameHttpApi

Native global installed by the script host. on returns 0 when called outside an active file script; keep every positive id and release it in stop() with off for deterministic reloads.

session

function · session: GameSessionApi

Native global installed by the script host. on returns 0 when called outside an active file script; keep every positive id and release it in stop() with off for deterministic reloads.

overlay

function · overlay: GameOverlayApi

Native global installed by the script host. on returns 0 when called outside an active file script; keep every positive id and release it in stop() with off for deterministic reloads.

log

function · log: GameLogApi

Native global installed by the script host. on returns 0 when called outside an active file script; keep every positive id and release it in stop() with off for deterministic reloads.

planner

function · planner: GamePlannerApi

Native global installed by the script host. on returns 0 when called outside an active file script; keep every positive id and release it in stop() with off for deterministic reloads.

dbg

function · dbg: GameDbgApi

Native global installed by the script host. on returns 0 when called outside an active file script; keep every positive id and release it in stop() with off for deterministic reloads.

ui

function · ui: table

SharpGfx immediate-mode UI; see the SharpGfx guide.

Arcane SDK catalog generated from scripts/sdk