This is an old revision of the document!
In a LuaAutomation ATC controller, an event has the following format:
event = { type = "<type>", <type> = true, -- additional content }
You can check for a specific event type by using
if event.type == "<wanted>" then -- ... do stuff end
or
if event.<wanted> == true then -- ... do stuff end
event = { type = "int", int = true, msg = <message>, message = <message>, -- For backwards compatibility only! }
Fired when an interrupt set by the interrupt
function runs out. <message>
is the message passed to the function.
For backwards compatibility reasons, the message is also contained in the event.message
field.
event = { type = "ext_int", ext_int = true, message = <message>, }
Fired when a node called interrupt_pos
on this node's position. <message>
is the message passed to the function.
event = { type = "digiline", digiline = true, channel = <channel>, msg = <message>, }
Fired when the rail receives a Digiline message.