API reference
API version: 1.0.0
Source review: 2026-10-21
Find a callable by namespace or exact name. Each page explains its parameters, return values and usage.
Runtime
Shared contracts and examples
| Callable |
Purpose |
gos.on_tick |
Register bounded work on the update scheduler; optional interval_ms controls cadence. |
gos.time_ms |
Read monotonic milliseconds for elapsed time, not wall-clock time. |
World and units
Shared contracts and examples
| Callable |
Purpose |
gos.actor_names |
Read a bounded, epoch-checked snapshot of retained actor names without live-unit lookup. |
gos.target.cancel |
Cancel an owned target request only while it is still queued. |
gos.target.select |
Request an intentional persistent selected-target change; confirm it in a later snapshot. |
gos.target.status |
Observe an owned target-selection request without replaying it. |
gos.world |
Acquire the current generation-bound world and its optional player and target. |
unit:basis |
Read the current normalized yaw basis with forward, right and up axes, or nil. |
unit:combat_style |
Read a stable lowercase combat-style key, or nil. |
unit:discipline |
Read the observed display discipline, or nil. |
unit:distance |
Current distance in game-world units, or nil; multiply by 10 for metres. |
unit:handle |
Get an opaque identity that can be resolved in a fresh world; do not parse it. |
unit:hp |
Read observed health and optional percentage, or nil. |
unit:is_current_target |
Test whether this current unit is the selected target. |
unit:is_local_player |
Test whether this current unit is the local player. |
unit:is_on_screen |
Read whether this unit has a current on-screen observation. |
unit:item_rating |
Read the prepared overall equipped item rating, or nil when unavailable. |
unit:name |
Read the observed display name, or nil. |
unit:position |
Read game-world coordinates for this observation, or nil. |
unit:reaction |
Read friendly, neutral, hostile or unclassified relationship. |
unit:resource |
Read observed resource, kind and optional percentage. |
unit:rotation |
Read current character yaw in radians, or nil when its prepared pose is unavailable. |
unit:screen_position |
Read a current projected top, center or bottom unit anchor in pixels; return nil when unavailable. |
unit:speed |
Read available velocity magnitude, or nil. |
unit:target |
Read this unit's observed target and target-observation availability. |
unit:toughness |
Read the observed toughness label and number, or nil. |
unit:type |
Read the canonical unit classification, including unknown. |
unit:velocity |
Read available velocity in game-world coordinate units, or nil. |
world:presence |
Read bounded camera-independent character-roster presence; unknown is not absence. |
world:resolve |
Resolve an opaque handle in the current world; absent units return nil. |
world:units |
Get currently captured units with strict AND-combined filters. |
Effects
Shared contracts and examples
| Callable |
Purpose |
unit:effect |
Query a named or definition-key-matched aggregate; check readiness and completeness. |
unit:effects |
Read current effect rows and separately marked presentation-only history. |
Shared contracts and examples
| Callable |
Purpose |
gos.input.cursor |
Read the current cursor in render-viewport pixels without capturing input; unavailable samples omit coordinates. |
gos.input.is_down |
Read whether a supported keyboard or mouse button is held. |
gos.input.state |
Read held and edge state for a key; unrecognized keys are marked unknown. |
gos.input.was_pressed |
Read the shared press edge for this update without consuming it. |
gos.input.was_released |
Read the shared release edge for this update without consuming it. |
Settings
Shared contracts and examples
| Callable |
Purpose |
gos.settings.get |
Read current settings, enabled/active state and field values. |
gos.settings.register |
Register this script's settings schema at load time, never from a tick. |
gos.settings.set |
Queue a validated update to one of the caller's registered fields. |
Abilities
Shared contracts and examples
Combat events
Shared contracts and examples
| Callable |
Purpose |
gos.events.casts |
Read current cast/channel presentation observations, not a history stream. |
gos.events.combat |
Consume ordered combat events using a retained cursor, with loss and backlog reporting. |
gos.events.instants |
Read current instant-action observations, not a history stream. |
Overlay
Shared contracts and examples
Logging
Shared contracts and examples
| Callable |
Purpose |
gos.log.debug |
Write a debug-level message to this script's log. |
gos.log.error |
Write an error-level message to this script's log. |
gos.log.info |
Write an info-level message to this script's log. |
gos.log.success |
Write a success-level message to this script's log. |
gos.log.warn |
Write a warning-level message to this script's log. |
gos.log.write |
Write one structured log message with an optional level, tag and color. |
print |
Log at info level. Returns no values. |
Modules and files
Shared contracts and examples
| Callable |
Purpose |
DeleteFile |
Remove one file or empty directory without recursion; false without an error means nothing was removed. |
DownloadFileAsync |
Perform a blocking load-time download; the optional callback runs synchronously. |
FileExist |
Test for a regular file in an approved root; a missing file returns false without an error. |
GetFromWebOrLocal |
Ensure a local file exists, downloading only on a cache miss; returns a boolean, not contents. |
ListFiles |
List immediate regular-file names with optional exact extension filtering and truncation reporting. |
MakeDirectory |
Create approved directories; false without an error can mean they already exist. |
ReadFile |
Read binary-safe file contents, or nil and an error. |
UnzipArchive |
Extract a validated ZIP at load time within sandbox and size limits. |
WriteFile |
Write or append bytes in approved roots, creating missing parent directories. |
gos.file.delete |
Remove one file or empty directory without recursion; false without an error means nothing was removed. |
gos.file.download_async |
Perform a blocking load-time download; the optional callback runs synchronously. |
gos.file.exists |
Test for a regular file in an approved root; a missing file returns false without an error. |
gos.file.get_from_web_or_local |
Ensure a local file exists, downloading only on a cache miss; returns a boolean, not contents. |
gos.file.list |
List immediate regular-file names with optional exact extension filtering and truncation reporting. |
gos.file.mkdir |
Create approved directories; false without an error can mean they already exist. |
gos.file.read |
Read binary-safe file contents, or nil and an error. |
gos.file.unzip |
Extract a validated ZIP at load time within sandbox and size limits. |
gos.file.write |
Write or append bytes in approved roots, creating missing parent directories. |
gos.import |
Load a sandbox Lua module cached per top-level script environment. |
import |
Load a sandbox Lua module cached per top-level script environment. |
require |
Load a sandbox Lua module cached per top-level script environment. |
Inventory
Shared contracts and examples