Emitted events
:::info Copied from the repository
This page is app.gap.Tsum/EVENTS.md, copied in by the site's sync step. Regenerate it there with npm run events:docs; edits here are lost at the next sync.
:::
What this script broadcasts to tooling following a run, and what each event
carries. The host defines none of it: emitEvent(name, data) hands a line to
whichever consumers are attached, adding only a sequence number, a UTC
timestamp and the script id. The transport, the two sockets and the wire
format are the host's document --
../game-automation-app/docs/EVENTS.md.
Names are declared once, in src/scriptEvents.ts, and reached through
ts.emit(), which is silent on a host too old to have emitEvent.
5 event(s) from 5 call site(s).
| event | emitted from | payload |
|---|---|---|
round.over | src/play.ts:367 | id, seconds |
round.start | src/play.ts:478 | id, round, myTsum, skill, settings |
round.end | src/play.ts:827 | id, round, seconds, score, baseCoins, finalCoins, medals, settings |
run.started | src/index.ts:80 | version, skill, locale |
run.stopped | src/index.ts:352 | rounds |
The events
round.over
Emit.Round.Over — The board is finished and the score tally is beginning.
| field | type |
|---|---|
id | string |
seconds | number |
Emitted from:
src/play.ts:367—this.emit(Emit.Round.Over, …)
round.start
Emit.Round.Start — The pre-round screen is up with the bonus items set, and Start is about to be tapped. The signal to start recording -- emitted here rather than on the board so a recording opens on the items the round is being played with; the board follows a few seconds later. id is the round's own, repeated by every other round.* event of that round -- which is how a consumer several emulators dial into tells one round's events from another's, where round counts a single device's rounds and starts at 1 on each. It is also the CSV row's id. settings is what the round is being played under: the gameplay settings the stats CSV records as columns, as the settings object holds them.
| field | type |
|---|---|
id | string |
round | number |
myTsum | string |
skill | string |
settings | Partial<Settings> | undefined |
Emitted from:
src/play.ts:478—this.emit(Emit.Round.Start, …)
round.end
Emit.Round.End — The tally is done and the figures have been read. The signal to stop recording, and the only event carrying the round's numbers. settings repeats what round.start said, so this one event stands on its own.
| field | type |
|---|---|
id | string |
round | number |
seconds | number |
score | number | null |
baseCoins | number | null |
finalCoins | number | null |
medals | number | null |
settings | Partial<Settings> | undefined |
Emitted from:
src/play.ts:827—this.emit(Emit.Round.End, …)
run.started
Emit.Run.Started — A run has been asked for and its world is about to be built.
| field | type |
|---|---|
version | string |
skill | string |
locale | Locale | undefined |
Emitted from:
src/index.ts:80—emitScriptEvent(Emit.Run.Started, …)
run.stopped
Emit.Run.Stopped — The run's world has been dismantled; nothing is playing.
| field | type |
|---|---|
rounds | number |
Emitted from:
src/index.ts:352—emitScriptEvent(Emit.Run.Stopped, …)