diff options
author | autocommitter <autocommitter@linux-forks.de> | 2024-04-22 14:56:58 +0200 |
---|---|---|
committer | autocommitter <autocommitter@linux-forks.de> | 2024-04-22 14:56:58 +0200 |
commit | aeea70df13db7d77ce2ce1075cbd14dc1c3797fc (patch) | |
tree | 0b95d7adcbc6f128ce1528d6e965c926bb725fb1 /Tyard/nodes/(-4011,12,-2647).lua | |
parent | 4062f8447ce4eaa550613c41d3251c473522c201 (diff) | |
download | luaatc_envs-aeea70df13db7d77ce2ce1075cbd14dc1c3797fc.tar.gz luaatc_envs-aeea70df13db7d77ce2ce1075cbd14dc1c3797fc.tar.bz2 luaatc_envs-aeea70df13db7d77ce2ce1075cbd14dc1c3797fc.zip |
State at 2022-04-19
Diffstat (limited to 'Tyard/nodes/(-4011,12,-2647).lua')
-rw-r--r-- | Tyard/nodes/(-4011,12,-2647).lua | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Tyard/nodes/(-4011,12,-2647).lua b/Tyard/nodes/(-4011,12,-2647).lua new file mode 100644 index 0000000..3c9efc3 --- /dev/null +++ b/Tyard/nodes/(-4011,12,-2647).lua @@ -0,0 +1 @@ +--arrow points into yard
-- config'd for Southbound entrance (North end of yard)
local dir = "N"
local entrance_signal = "Tyard_Enter_"..dir
-- train enters from mainline. stop at signal to be safe
if event.train and atc_arrow then atc_send("B0") end
if atc_arrow then
local rc = get_rc() or ""
-- allow for manual working
if rc:match("TYARD_NOSHUNT") then return end
if S.yard_active then -- send train to "waiting"
if can_set_route(entrance_signal,"WAITING") then
set_route(entrance_signal,"WAITING")
atc_set_text_outside("Waiting for yard to clear")
atc_send("S6")
else
interrupt(5,"recheck")
end
else -- send train to "pickup"
S.yard_active = true
step_fc()
local rc = get_rc() or ""
S.rc = rc
--check for RTS
if S.single_dir == true or S.rc:match("TY_RTS") then
S.dir = dir
--working end = entrance dir
S.RTS = true
set_rc("AROUND_"..S.dir)
else
--invert S.dir
--working end ~= entrance end
if dir == "N" then
S.dir = "S"
else
S.dir = "N"
end
end
set_route(entrance_signal,"PICKUP")
atc_set_text_outside("Proceeding to Classification Yard")
atc_send("S4")
end
else -- train exiting
set_rc(S.rc)
S.yard_active = nil
S.rc = nil
S.dir = nil
unset_autocouple()
atc_send("SM")
end
\ No newline at end of file |