julienbrg/avventura-ms

Avventura in MiniScript

★ 0Forks 0MiniScriptGitHub ↗Compare
miniscript

README

Avventura MS

A MiniScript port of Avventura, running in the Mini Micro fantasy computer. It talks to the same backend as the web UI: the Avventura API, served at https://api.avventura.fun.

Run

  1. Open Mini Micro.
  2. Mount this folder as the /usr disk (click the disk slot under the screen).
  3. Type:
run "avventura"

At the prompt, enter a story slug (e.g. montpellier, sailing) to start a new game, or an 8-letter game ID (e.g. ZMWQNLJN) to resume one. A new game then asks for a language (default fr) and at least one player.

Controls

Key Action
↑ / ↓ Move between options
Enter Choose
Any key Skip the typing effect
Esc Quit

How it works

The script mirrors the web page's flow over three endpoints:

Endpoint Body Used for
/start {story, language, players} Start a game from a slug
/state {gameId} Resume a game by ID
/move {gameId, choiceIndex} Play a choice (1-based index)

As in the web UI, choosing an option shows the cached nextSteps[i] right away, then calls /move to fetch the steps after it while the player reads. The API base URL is the apiUrl variable at the top of avventura.ms.

Limitations

  • http.post blocks the script until the server answers, so nothing can run during a /move call: the pink "Loading next step" message cannot blink, and keys pressed meanwhile are only handled once the response arrives.
  • On failure, http.post returns only the status line (e.g. HTTP/1.1 404 Not Found), not the server's error message. The script prints it under the error.
  • Games created before stories were keyed by slug (their story ends in .md) fail on /move with a 500 from the API.

Further reading

Contributors

julienbrg

Issues