This guide walks you through creating a brand-new auto splitter project from scratch using asr-assemblyscript. By the end you will have a fully compiledDocumentation 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.
.wasm file that attaches to a game process and controls LiveSplit One’s timer automatically. All you need is Node.js (v16 or later) installed on your machine — the AssemblyScript compiler and the library itself are installed locally through npm.
Create the project folder
Create a directory for your auto splitter and navigate into it, then initialize a new npm project. Running
npm init will prompt you for basic metadata; you can press Enter to accept the defaults for every field.Install AssemblyScript and asr-assemblyscript
Install the AssemblyScript compiler as a dev dependency, then add asr-assemblyscript itself. Because asr-assemblyscript is distributed directly from GitHub rather than the npm registry, the second command uses the full repository URL.After this step your
node_modules folder will contain both the assemblyscript compiler toolchain and the asr-assemblyscript library source files.Initialize the AssemblyScript project
Use the AssemblyScript scaffolding tool (
asinit) to generate the standard project layout. This creates the assembly/ source directory, a starter assembly/index.ts entry point, an asconfig.json compiler configuration file, and updates package.json with build scripts.Update the build scripts in package.json
The scaffolded build scripts do not yet reference asr-assemblyscript’s custom Your
abort implementation, which the AssemblyScript runtime requires. Open package.json and replace the two asbuild script lines with the versions below so the compiler picks up the correct abort handler via the --use flag.scripts section should look similar to this after the edit:The
--use abort=~lib/asr-assemblyscript/runtime/abort flag tells the AssemblyScript compiler to substitute asr-assemblyscript’s abort function in place of the default one. Without it, unhandled errors inside the module will not be handled gracefully inside the sandboxed runtime.Write your auto splitter and compile
Open Once your code is ready, compile it into a release WebAssembly binary:The compiler will emit your finished auto splitter to:
assembly/index.ts and replace its contents with the example below. This minimal auto splitter imports the runtime side-effects module (which registers the custom abort handler), imports the timer and process modules, then exports the update() function that the runtime calls on every tick.Next steps
You now have a working auto splitter skeleton. From here you can expand theupdate() function to read specific memory addresses using Process.read() or the typed watcher classes, fire Timer.split() when a level changes, call Timer.reset() on a new-game flag, or expose toggle options to runners with UserSettings.addBool(). Check out the guides below to go deeper.
Auto Splitter Lifecycle
Learn exactly when and how the runtime calls your
update() function and how to manage process state across ticks.Reading Memory
Use
Process.read(), module addresses, and the watcher helper classes to track game values.