Test/event

From OpenComputers: Rebooted
Revision as of 20:28, 24 August 2026 by Michiyo (talk | contribs) (Clean up Markdown artifacts from DokuWiki migration)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

===== event listen

===== Syntax

Syntax event.listen(event: string, callback: function): boolean

===== Description

Description Register a new event listener that should be called for events with the specified name.

===== Details

Arguments event - name of the signal to listen to.
callback - the function to call if this signal is received. The function will receive the event name it was registered for as first parameter, then all remaining parameters as defined by the signal that caused the event.
Returns true if the event was successfully registered, false if this function was already registered for this event type.