Appearance
game
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?
Parameters
| Name | Type | Summary |
|---|---|---|
x | integer | — |
y | integer | — |
z | integer | — |
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage?, string? | — |
attack
function · attack(creature_id: integer, cancel_movement?: boolean): Result?, ErrorMessage?, string?
Parameters
| Name | Type | Summary |
|---|---|---|
creature_id | integer | — |
cancel_movement | boolean | — |
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage?, string? | — |
stop_attack
function · stop_attack(): Result?, ErrorMessage?, string?
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage?, string? | — |
follow
function · follow(creature_id: integer, cancel_movement?: boolean): Result?, ErrorMessage?, string?
Parameters
| Name | Type | Summary |
|---|---|---|
creature_id | integer | — |
cancel_movement | boolean | — |
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage?, string? | — |
stop_follow
function · stop_follow(): Result?, ErrorMessage?, string?
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage?, string? | — |
attack_target_id
function · attack_target_id(): integer?
Native target-state getter; 0 means no red attack box, nil means unavailable.
Returns
| Type | Summary |
|---|---|
integer? | — |
follow_target_id
function · follow_target_id(): integer?
Native follow-state getter; 0 means no follow target.
Returns
| Type | Summary |
|---|---|
integer? | — |
rotate
function · rotate(direction: integer): Result?, ErrorMessage?, string?
Parameters
| Name | Type | Summary |
|---|---|---|
direction | integer | — |
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage?, string? | — |
action
function · action(name: string, fields?: table): Result?, ErrorMessage?, string?
Parameters
| Name | Type | Summary |
|---|---|---|
name | string | — |
fields | table | — |
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage?, string? | — |
say
function · say(text: string, channel?: integer): Result?, ErrorMessage?, string?
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?
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?
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
Parameters
| Name | Type | Summary |
|---|---|---|
name | string | — |
callback | GameEventCallback|TickCallback|KeyCallback|RenderCallback | — |
Returns
| Type | Summary |
|---|---|
SubscriptionId | — |
off
function · off(id: SubscriptionId): boolean
Parameters
| Name | Type | Summary |
|---|---|---|
id | SubscriptionId | — |
Returns
| Type | Summary |
|---|---|
boolean | — |
creature_frame
function · creature_frame(): integer
Monotonic native creature snapshot generation for per-frame caches.
Returns
| Type | Summary |
|---|---|
integer | — |
get_local_player
function · get_local_player(): NativePlayerSnapshot?
Returns
| Type | Summary |
|---|---|
NativePlayerSnapshot? | — |
get_creatures
function · get_creatures(): NativePlayerSnapshot[]
Returns
| Type | Summary |
|---|---|
NativePlayerSnapshot[] | — |
tile_to_screen
function · tile_to_screen(world_x: integer, world_y: integer, world_z: integer, extra?: any): any
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
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
Parameters
| Name | Type | Summary |
|---|---|---|
virtual_key | integer | — |
Returns
| Type | Summary |
|---|---|
GameInputSnapshot | — |
layout
function · layout(name: string): GameLayoutRow?
Parameters
| Name | Type | Summary |
|---|---|---|
name | string | — |
Returns
| Type | Summary |
|---|---|
GameLayoutRow? | — |
storage
function · storage: GameStorageApi
paths
function · paths: GamePathsApi
map
function · map: GameMapApi
alert
function · alert: GameAlertApi
http
function · http: GameHttpApi
session
function · session: GameSessionApi
overlay
function · overlay: GameOverlayApi
log
function · log: GameLogApi
planner
function · planner: GamePlannerApi
dbg
function · dbg: GameDbgApi
ui
function · ui: table
SharpGfx immediate-mode UI; see the SharpGfx guide.