diff options
Diffstat (limited to 'advtrains_luaautomation')
-rw-r--r-- | advtrains_luaautomation/README.txt | 10 | ||||
-rw-r--r-- | advtrains_luaautomation/atc_rail.lua | 13 |
2 files changed, 16 insertions, 7 deletions
diff --git a/advtrains_luaautomation/README.txt b/advtrains_luaautomation/README.txt index c377c1b..65e068e 100644 --- a/advtrains_luaautomation/README.txt +++ b/advtrains_luaautomation/README.txt @@ -203,10 +203,12 @@ set_rc(routingcode) split_at_index(index, command) Splits the train at the specified index, into a train with index-1 wagons and a second train starting with the index-th wagon. command specifies an atc command to be sent to the second train after decoupling. -set_shunt() - Sets the train into shunting mode -unset_shunt() - Sets the train into normal mode +set_autocouple() + Sets the train into autocouple mode +unset_autocouple() + Unsets autocouple mode +set_shunt(), unset_shunt() + deprecated aliases for set_autocouple() and unset_autocouple(), will be removed from a later release. # Operator panel This simple node executes its actions when punched. It can be used to change a switch and update the corresponding signals or similar applications. diff --git a/advtrains_luaautomation/atc_rail.lua b/advtrains_luaautomation/atc_rail.lua index feac8d1..0bb9871 100644 --- a/advtrains_luaautomation/atc_rail.lua +++ b/advtrains_luaautomation/atc_rail.lua @@ -67,13 +67,20 @@ function r.fire_event(pos, evtdata) return false end, set_shunt = function() - -- enable shunting mode if not train_id then return false end - train.is_shunt = true + train.autocouple = true end, unset_shunt = function() if not train_id then return false end - train.is_shunt = nil + train.autocouple = nil + end, + set_autcouple = function () + if not train_id then return false end + train.autocouple = true + end, + unset_autocouple = function () + if not train_id then return false end + train.autocouple = nil end, set_line = function(line) if type(line)~="string" and type(line)~="number" then |