Skip to main content

Documentation 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.

asr-assemblyscript is an AssemblyScript library that gives speedrun developers a structured, type-safe way to write auto splitters for LiveSplit One. Instead of manually authoring raw WebAssembly or wrestling with low-level host imports, you write familiar TypeScript-like code, compile it to a .wasm binary, and drop that file into LiveSplit One’s layout — where the auto splitting runtime takes over. The library is designed for anyone who wants to automate timer control for a game: from a runner writing their first splitter to a developer maintaining splits for an entire game community.

What is an auto splitter?

An auto splitter is a small WebAssembly module loaded directly by the LiveSplit One auto splitting runtime. Once loaded, the runtime calls the module’s exported update() function on every tick (the rate is configurable via Runtime.setTickRate). Inside update(), your code inspects the game’s process memory and issues timer commands — start, split, reset — based on what it finds. Because the module runs inside a sandboxed WebAssembly environment, it can only interact with the outside world through the host functions that the runtime exposes, all of which are wrapped by this library.

Library modules

asr-assemblyscript is organized into five modules:
ModuleImport pathPurpose
timerasr-assemblyscript/timerControl the speedrun timer: start, split, reset, set game time, pause/resume game time, and read the current TimerState.
processasr-assemblyscript/processAttach to a running game process by name, check whether it is still open, read arbitrary memory addresses, and look up module base addresses and sizes.
runtimeasr-assemblyscript/runtimeConfigure the tick rate, print debug log messages, and query the host operating system and CPU architecture. Also provides the custom abort implementation required by AssemblyScript.
userSettingsasr-assemblyscript/userSettingsExpose boolean toggles to the runner through LiveSplit One’s settings UI, returning either the user-chosen value or a specified default.
watcher classesasr-assemblyscript/watcherTyped helpers (BoolWatcher, I32Watcher, U64Watcher, F64Watcher, StringWatcher, and more) that track a memory value across ticks, exposing both the current value and the old value from the previous update so you can react to changes with .changed.

Timer states

The getState() function in the timer module returns a TimerState value (typed as u32). There are four possible states a speedrun timer can be in:
ValueStateMeaning
0Not RunningThe timer has not been started yet (or has been fully reset).
1RunningThe timer is actively counting up.
2PausedThe timer is paused mid-run.
3EndedThe runner has crossed the finish line and the run is complete.
You can compare the return value of Timer.getState() directly against these numeric constants to branch your logic — for example, only issuing a Timer.split() call when the state is 1 (Running).

Explore the docs

Quickstart

Set up a project, write your first auto splitter, and compile it to .wasm in under 10 minutes.

Auto Splitter Lifecycle

Understand how the runtime loads your module, calls update(), and manages process attachment.

Reading Memory

Use the process module and watcher helpers to read typed values from a game’s memory.

Timer API

Full reference for every function exported by the timer module.
asr-assemblyscript targets AssemblyScript — a TypeScript-like language that compiles directly to WebAssembly. It does not run in Node.js or a browser JavaScript engine. Code you write with this library is compiled to a standalone .wasm binary that is loaded and sandboxed by the LiveSplit One runtime.

Build docs developers (and LLMs) love