ZapScript
ZapScript is a small scripting language written to the storage of Zaparoo tokens. It tells Zaparoo what to do when a token is scanned. Through regular use you won't need to write much yourself, but you can use it to customize launching or add scripted actions.
Quick Reference
| Command | Description |
|---|---|
launch | Launch media from a path or identifier |
launch.title | Launch by title ID with explicit syntax |
launch.system | Launch a system/emulator |
launch.random | Launch a random game |
launch.search | Search and launch by filename pattern |
input.keyboard | Simulate keyboard input |
input.gamepad | Simulate gamepad input |
input.coinp1 | Insert coin for player 1 |
input.coinp2 | Insert coin for player 2 |
http.get | Make an HTTP GET request |
http.post | Make an HTTP POST request |
playlist.play | Load and play a playlist |
playlist.load | Load a playlist without playing |
playlist.open | Open playlist picker menu |
playlist.stop | Stop and clear playlist |
playlist.pause | Pause playlist |
playlist.next | Next playlist item |
playlist.previous | Previous playlist item |
playlist.goto | Jump to playlist position |
stop | Stop current media |
echo | Log a message |
execute | Run a shell command |
delay | Pause script execution |
mister.ini | Load MiSTer ini file |
mister.core | Launch MiSTer core |
mister.script | Run MiSTer script |
mister.mgl | Execute MGL content |
Command Categories
- Launch: Commands for launching games, systems, and media
- Input: Commands for simulating keyboard and gamepad input
- HTTP: Commands for making HTTP requests
- Playlist: Commands for managing playlists
- Utilities: Utility commands (stop, delay, echo, execute)
- MiSTer: Commands specific to the MiSTer platform
Syntax
The syntax of ZapScript is designed to be human-readable and writeable, with minimal complexity and focused on fitting as much information as possible on the limited storage available on NFC tags and QR codes.
See Syntax for a detailed explanation of all the different parts of ZapScript syntax, Expressions for dynamic values, and Zap Links for remote script hosting.
Examples
Launch a game
@Genesis/Sonic the Hedgehog
Or with the explicit command:
**launch:PCEngine/Another Game
Launch a game with a delay
**delay:1000||@SNES/Super Mario World
Send an HTTP request and launch a random game
**http.get:https://api.example.com/hello||**launch.random:Genesis
Launch different content based on platform
Genesis/Game.md?when=[[platform == "mister"]]||PCEngine/Game.pce?when=[[platform != "mister"]]
Use expressions for dynamic paths
SNES/games-[[platform]]/Super Mario World.sfc