User Tools

Site Tools


usage:atlatc:api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
usage:atlatc:api [2020-12-25 19:01]
orwell example for schedule
usage:atlatc:api [2021-02-17 23:38]
orwell add api of commit 5232c22f
Line 73: Line 73:
  
 Causes the LuaAutomation mod to trigger an ''int'' [[usage:atlatc:events|event]] (the Advtrains equivalent of [[usage:mods:mesecons|Mesecons]]' ''interrupt'') on this component after the given ''time'', in seconds, with the specified ''message''. ''message'' can be of any Lua data type. Causes the LuaAutomation mod to trigger an ''int'' [[usage:atlatc:events|event]] (the Advtrains equivalent of [[usage:mods:mesecons|Mesecons]]' ''interrupt'') on this component after the given ''time'', in seconds, with the specified ''message''. ''message'' can be of any Lua data type.
 +
 +Use of this function is discouraged, as "fork bombs" can easily be built. Please use ''interrupt_safe()'' or make sure to ''clear_interrupts()'' in appropriate places.
 +
 +=== interrupt_safe(time, message) ===
 +
 +//since version 3.0//
 +
 +Like ''interrupt()'', but does not add an interrupt and returns false when an interrupt (of any type) is already present for this component. Returns true when interrupt was successfully added.
  
 ===interrupt_pos(pos, message) === ===interrupt_pos(pos, message) ===
  
 Triggers immediately an ''ext_int'' [[usage:atlatc:events|event]] on the active component at ''pos''. ''message'' can be of any Lua data type. Triggers immediately an ''ext_int'' [[usage:atlatc:events|event]] on the active component at ''pos''. ''message'' can be of any Lua data type.
 +
 +=== clear_interrupts() ===
 +
 +//since version 3.0//
 +
 +Removes any pending interrupts (both of type 'int' and 'ext_int') set on this node.
 +
  
 ==== Railway Time ==== ==== Railway Time ====
usage/atlatc/api.txt · Last modified: 2023-07-05 17:48 by maverick2797