aboutsummaryrefslogtreecommitdiff
path: root/advtrains_luaautomation/environment.lua
diff options
context:
space:
mode:
Diffstat (limited to 'advtrains_luaautomation/environment.lua')
-rw-r--r--advtrains_luaautomation/environment.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/advtrains_luaautomation/environment.lua b/advtrains_luaautomation/environment.lua
index 9ef320c..63aa68d 100644
--- a/advtrains_luaautomation/environment.lua
+++ b/advtrains_luaautomation/environment.lua
@@ -153,6 +153,17 @@ local static_env = {
local pos=atlatc.pcnaming.resolve_pos(parpos)
atlatc.interrupt.add(0, pos, {type="ext_int", ext_int=true, message=imesg})
end,
+ -- sends an atc command to train regardless of where it is in the world
+ atc_send_to_train = function(train_id, command)
+ assertt(command, "string")
+ local train = advtrains.trains[train_id]
+ if train then
+ advtrains.atc.train_set_command(train, command, true)
+ return true
+ else
+ return false
+ end
+ end,
}
-- If interlocking is present, enable route setting functions