Appearance
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
| Name | Type | Summary |
|---|---|---|
direction | DirectionName | — |
Returns
| Type | Summary |
|---|---|
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
| Name | Type | Summary |
|---|---|---|
x | integer | — |
y | integer | — |
z | integer | — |
Returns
| Type | Summary |
|---|---|
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
| Name | Type | Summary |
|---|---|---|
text | string | — |
channel | integer | — |
Returns
| Type | Summary |
|---|---|
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
| Name | Type | Summary |
|---|---|---|
item_id | ItemId | — |
Returns
| Type | Summary |
|---|---|
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
| Name | Type | Summary |
|---|---|---|
item_id | ItemId | — |
creature_id | integer | — |
Returns
| Type | Summary |
|---|---|
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
| Name | Type | Summary |
|---|---|---|
name | string | — |
callback | GameEventCallback|TickCallback|KeyCallback|RenderCallback | — |
Returns
| Type | Summary |
|---|---|
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
| Name | Type | Summary |
|---|---|---|
id | SubscriptionId | — |
Returns
| Type | Summary |
|---|---|
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
| Type | Summary |
|---|---|
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
| Type | Summary |
|---|---|
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
| Name | Type | Summary |
|---|---|---|
world_x | integer | — |
world_y | integer | — |
world_z | integer | — |
extra | any | — |
Returns
| Type | Summary |
|---|---|
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
| Name | Type | Summary |
|---|---|---|
screen_x | number | — |
screen_y | number | — |
extra | any | — |
Returns
| Type | Summary |
|---|---|
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
| Name | Type | Summary |
|---|---|---|
virtual_key | integer | — |
Returns
| Type | Summary |
|---|---|
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
| Name | Type | Summary |
|---|---|---|
name | string | — |
Returns
| Type | Summary |
|---|---|
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.