summaryrefslogtreecommitdiff
path: root/durt/nodes/(-2734,10,-1693).lua
diff options
context:
space:
mode:
authorautocommitter <autocommitter@linux-forks.de>2024-04-22 14:52:07 +0200
committerautocommitter <autocommitter@linux-forks.de>2024-04-22 14:52:07 +0200
commitc21692e0a830e434675014dd7b54736d180ce71d (patch)
treee928ac06b872bb5fa7697736f8cb78873e1424d2 /durt/nodes/(-2734,10,-1693).lua
parentc6612d4e4b59a03d097a494eee4c714f8b88f123 (diff)
downloadluaatc_envs-c21692e0a830e434675014dd7b54736d180ce71d.tar.gz
luaatc_envs-c21692e0a830e434675014dd7b54736d180ce71d.tar.bz2
luaatc_envs-c21692e0a830e434675014dd7b54736d180ce71d.zip
State at 2020-06-24
Diffstat (limited to 'durt/nodes/(-2734,10,-1693).lua')
-rw-r--r--durt/nodes/(-2734,10,-1693).lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/durt/nodes/(-2734,10,-1693).lua b/durt/nodes/(-2734,10,-1693).lua
new file mode 100644
index 0000000..8043b8c
--- /dev/null
+++ b/durt/nodes/(-2734,10,-1693).lua
@@ -0,0 +1 @@
+--Still need to convert to a function rather than trackside local hs_sig = "M27_Quarry_Headshunt" local hs_route = "Headshunt" local exit_sig = "M27_Quarry_Exit" local exit_route = "Exit to Mainline" local siding_id = "M27_Quarry_runaround" local length_prefix = "Loco" if (event.train and atc_arrow) then local rc = get_rc() or " " -- the RC that controls the link to split -- rc value: "<rc><num_wagons to shunt with>" default is single loco -- eg "Loco2" for tenders, "Loco3" for local loco_pos = rc:match(length_prefix.."%d+") or length_prefix.."1" loco_pos = tonumber(loco_pos:match("%d+"))+1 if not S.runarounds[siding_id].shunting then -- train to be split --store info for later re-insertion S.runarounds[siding_id] = { ['shunting'] = true, ['rc'] = rc, ['line'] = get_line() or " " } atc_send("B0S0") interrupt(5,{['cmd'] = "split", ['leng'] = loco_pos}) -- change int time if needed, depends on approach speed slowdown else -- train has rejoined --re-insert info to train if S.runarounds[siding_id].rc then set_rc(S.runarounds[siding_id].rc) end if S.runarounds[siding_id].line then set_line(S.runarounds[siding_id].line) end --depart atc_send("B0WD3RSM") set_route(exit_sig,exit_route) S.runarounds[siding_id].shunting = false end end if event.int then if event.msg.cmd=="split" then cmd = event.msg split_at_index(cmd.leng,"") set_rc(S.runarounds[siding_id].rc .. " shunt_limit") atc_send("S2") set_route(hs_sig,hs_route) end end \ No newline at end of file