This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
usage:atlatc:api [2020-02-23 09:10] orwell |
usage:atlatc:api [2021-05-26 22:03] 56independent added an function wich didnt exist. |
||
---|---|---|---|
Line 73: | Line 73: | ||
Causes the LuaAutomation mod to trigger an '' | Causes the LuaAutomation mod to trigger an '' | ||
+ | |||
+ | Use of this function is discouraged, | ||
+ | |||
+ | === interrupt_safe(time, | ||
+ | |||
+ | //since version 2.3.0// | ||
+ | |||
+ | Like '' | ||
===interrupt_pos(pos, | ===interrupt_pos(pos, | ||
Triggers immediately an '' | Triggers immediately an '' | ||
+ | |||
+ | === clear_interrupts() === | ||
+ | |||
+ | //since version 2.3.0// | ||
+ | |||
+ | Removes any pending interrupts (both of type ' | ||
+ | |||
+ | ==== Remote ATC ==== | ||
+ | |||
+ | //since version 2.3.0// | ||
+ | |||
+ | In addition to '' | ||
+ | |||
+ | === atc_send_to_train(train_id, | ||
+ | |||
+ | Sends the specified [[usage: | ||
+ | |||
+ | The ATC command is instantly applied to the train in question, regardless of where it is and what it is doing. It also cancels any active ATC command of the train. | ||
+ | |||
+ | Calling this function from an ATC rail is independent of any train that stands on the rail and does not affect it (except of course when train_id happens to be the ID of the train on the rail). | ||
==== Railway Time ==== | ==== Railway Time ==== | ||
Line 106: | Line 134: | ||
The time value here is an absolute value. | The time value here is an absolute value. | ||
msg can be any data type and is accessible in '' | msg can be any data type and is accessible in '' | ||
+ | < | ||
+ | -- Example: schedule a " | ||
+ | local now = rwt.now() | ||
+ | local next_5minutes = rwt.next_rpt(now, | ||
+ | schedule(next_5minutes, | ||
+ | </ | ||
=== schedule_in(rwtime, | === schedule_in(rwtime, | ||
Line 188: | Line 222: | ||
=== atc_set_text_inside(text) === | === atc_set_text_inside(text) === | ||
Sets the text shown inside the train and returns '' | Sets the text shown inside the train and returns '' | ||
+ | |||
+ | === atc_get_text_outside() / atc_get_text_inside() === | ||
+ | Gets the outside/ | ||
=== get_line() === | === get_line() === | ||
Line 216: | Line 253: | ||
If there is no train, same behavior as [[# | If there is no train, same behavior as [[# | ||
+ | |||
+ | === train_length() === | ||
+ | Returns the length of the Train in carrages. example '' | ||
=== set_shunt() === | === set_shunt() === | ||
Line 225: | Line 265: | ||
=== atc_set_ars_disable(value) === | === atc_set_ars_disable(value) === | ||
+ | |||
+ | //since version 2.3.0// | ||
+ | |||
Enables ('' | Enables ('' | ||
This function has essentially the same effect as the ATC command '' | This function has essentially the same effect as the ATC command '' | ||
- | |||
- | **This function is experimental and currently available only in the '' | ||
=== atc_set_lzb_tsr(speed) === | === atc_set_lzb_tsr(speed) === | ||
+ | |||
+ | //since version 2.3.0// | ||
Adds a Temporary Speed Restriction at the current rail, so that the train is passing the rail at the specified '' | Adds a Temporary Speed Restriction at the current rail, so that the train is passing the rail at the specified '' | ||
Line 239: | Line 282: | ||
* This function is available only when the [[wiki: | * This function is available only when the [[wiki: | ||
* This function is only accessible during '' | * This function is only accessible during '' | ||
- | |||
- | **This function is experimental and currently available only in the '' | ||
==== Fields ==== | ==== Fields ==== |