TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/CryZe/asr-assemblyscript/llms.txt
Use this file to discover all available pages before exploring further.
timer module is your primary interface for controlling the LiveSplit One timer from within your auto splitter. It exposes functions to start, split, reset, and manage both real time and game time, as well as a state query so you can guard against invalid transitions. Every function in this module communicates directly with the LiveSplit One host via WebAssembly imports — no internal state is maintained on the Wasm side.
TimerState
TimerState is a u32 type alias that represents the current state of the timer. Use it to guard timer calls and avoid triggering illegal transitions (e.g. splitting when the timer has already ended).
| Value | Constant meaning | Description |
|---|---|---|
0 | Not Running | The timer has not been started yet. |
1 | Running | The timer is actively counting up. |
2 | Paused | Game time is paused; real time continues. |
3 | Ended | The run has been finished (final split done). |
getState
start(), split(), or reset() to avoid no-op or invalid operations.
Returns: TimerState — one of the four numeric states described above.
start
getState() before calling if you need to guard the transition.
split
3 (Ended). Has no effect if the timer is not currently running.
reset
0 (Not Running). Any unsaved run data will be lost.
setGameTime
pauseGameTime() before setGameTime() to prevent the runtime from automatically advancing game time between your updates.
The whole-second component of the game time duration. May be negative to represent time before the start.
The sub-second nanosecond component. Must be in the range
0–999_999_999.pauseGameTime
setGameTime(), so the runtime does not advance game time between your explicit updates.
resumeGameTime
pauseGameTime(). This does not resume a paused timer — it only re-enables the runtime’s automatic game time advancement.
setVariable
A unique string identifier for this variable. Repeated calls with the same key will overwrite the previous value.
The string value to associate with the key. Both
key and value are encoded as UTF-8 before being passed to the host.