Event Handler Basics
Events let your BER code respond to triggers. Define functions as event handlers and run them.
function onClick()
board:("Button clicked!")
end
run onClick()
Common Event Commands - Part 1
- run [eventName] - Execute an event handler.
- pause [eventName] - Pause an event handler.
- restart [eventName] - Restart an event handler.
- load [eventName] - Load resources for the event.
Event Tips & Tricks
- Keep event handlers fast and simple.
- Use
pauseandrestartto control flow. - Load resources properly before running events.
- Combine events with timers for complex behavior.