OnEvent - theRAPTLab/gsgo GitHub Wiki

[[toc]]

onEvent

The onEvent code block will run ONCE every time the event is fired.

There are currently four available events:

  • RoundInit -- Fires when the "PREP ROUND" button is pushed
  • Costumes -- Fires when the "PICK CHARACTERS" button is pushed
  • Start -- Fires when the "START ROUND" button is pushed
  • RoundStop-- Fires when the "STOP ROUND" round button is pushed. NOTE that agent scripts will not run at RoundStop because of the switch to the POSTRUN sim loop. See #442.

Syntax

onEvery <event> [[ <code> ]]

Where

  • <event> is either RoundInit, Costumes, Start, or RoundStop
  • <code> is a block of code to run whenever the event fires.

Example

onEvent RoundStop [[ 
  dbgOut 'Game Over!'
]]
⚠️ **GitHub.com Fallback** ⚠️