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 | |
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')
37 files changed, 233 insertions, 20 deletions
diff --git a/Tyard/init_code.lua b/Tyard/init_code.lua index 99b63e4..a90efdf 100644 --- a/Tyard/init_code.lua +++ b/Tyard/init_code.lua @@ -1,5 +1,67 @@ --- flag to hard enable RTS: -S.single_dir = true +--Environment Code +F.yard_active = function(set) --if set == true then yard = active + local yard_indicator = POS(-4025,14,-2659) + if set ~= nil then + setstate(yard_indicator,(set and "on") or "off") + end + return (getstate(yard_indicator) == "on") or false +end +F.dir = function(set) -- if set == true then dir = pointing north + local dir_indicator = POS(-4025,13,-2665) + if set ~= nil then + setstate(dir_indicator,(set and "on") or "off") + end + return (getstate(dir_indicator) == "on") or false +end -F.EOL = function(direction,lane)
if S.yard_active then
if S.dir == direction then
if atc_arrow then
if not S.exiting then
--return to PICKUP via headshunt
split_off_locomotive("B0WR")
set_rc("PICKUP")
set_route("TY"..direction.."_"..lane, "HEADSHUNT")
else
--if S.exiting then loco has already sorted to correct lane for departure
--S.exiting set by the pickup track
set_rc(S.rc)
set_route("TY"..direction.."_"..lane, "EXIT")
S.exiting = nil
end
end
else -- preparing for bi-directional. also EOL Bounce
atc_send("B0WD1RS4")
end
end
end
\ No newline at end of file +F.get_rc_safe = function() + return get_rc() or "" +end + +F.has_rc = function(query,rc_list) + if rc_list == "" or query == nil or query=="" then return false end + if not rc_list then rc_list = F.get_rc_safe() end + for word in rc_list:gmatch("[^%s]+") do + if word == query then return true end + end + return false +end + +F.remove_rc = function(rc_list,arrow_mode) -- rc_list eg: {"rc1","rc2"} + -- rc_list MUST be a table of rc codes to remove + -- eg: {"rc1","rc2"} + -- Arrow Modes: + -- true: with arrow direction + -- false: against arrow direction + -- nil: ignores arrow direction + + if not atc_id then return false end + if (arrow_mode == nil) or (atc_arrow == arrow_mode) then + local rc = F.get_rc_safe() + rc_list = rc_list or {} + local rc_remove = {} + for _,v in pairs(rc_list) do + rc_remove[v] = true + end + -- remove codes from train's rc + local reinsert = {} + for token in rc:gmatch("[^%s]+") do + if not rc_remove[token] then + table.insert(reinsert,token) + end + end + -- insert new string to train's rc + set_rc(table.concat(reinsert," ")) + end + return reinsert +end + +F.add_rc = function(rc_list) -- rc_list eg {"rc1","rc2"} OR "rc1 rc2" + if not atc_id then return false end + if type(rc_list) == "table" then + rc_list = table.concat(rc_list," ") + end + set_rc(F.get_rc_safe().." "..rc_list) + return true +end
\ No newline at end of file diff --git a/Tyard/nodes/(-4011,12,-2642).lua b/Tyard/nodes/(-4011,12,-2642).lua index 81a963d..d263812 100644 --- a/Tyard/nodes/(-4011,12,-2642).lua +++ b/Tyard/nodes/(-4011,12,-2642).lua @@ -1 +1,33 @@ -if S.yard_active and atc_arrow then set_autocouple() end
\ No newline at end of file +-- Yard arrival checker +local function enter_yard() + F.dir(false) + F.yard_active(true) + atc_set_ars_disable(false) + atc_send("S6") + return +end + +__approach_callback_mode = 1 +if event.approach and not event.has_entered then + atc_set_ars_disable(true) + atc_set_lzb_trs(1) + return +end + +if event.train then + if F.yard_active() then + schedule_in(";10","recheck") + return + else + enter_yard() + end +end + +if event.schedule then + if F.yard_active() then + schedule_in(";10","recheck") + return + else + enter_yard() + end +end
\ No newline at end of file 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 diff --git a/Tyard/nodes/(-4012,12,-2646).lua b/Tyard/nodes/(-4012,12,-2646).lua new file mode 100644 index 0000000..5199847 --- /dev/null +++ b/Tyard/nodes/(-4012,12,-2646).lua @@ -0,0 +1 @@ +-- Headshunt / Exit controller
\ No newline at end of file diff --git a/Tyard/nodes/(-4027,12,-2655).lua b/Tyard/nodes/(-4027,12,-2655).lua index 39f9b81..136f70b 100644 --- a/Tyard/nodes/(-4027,12,-2655).lua +++ b/Tyard/nodes/(-4027,12,-2655).lua @@ -1 +1,35 @@ ---North pickup splitter
local dir = "N"
local lane = 0
--nothing below this line should indicate a hard direction
--should be able to convert to function using only above args
--------------------------------------------------
if S.yard_active then
if atc_arrow then
if S.dir == dir then
set_route("TY"..dir.."_"..lane, "HEADSHUNT")
local plen = train_length()
local rc = split_at_fc("B0")
local trc = "TY"..dir.."_"..rc
if plen == train_length() and (rc == "" or S.rc:match(trc)) then
S.exiting = true
end
if rc and rc ~= "" then
set_rc("TY"..dir.."_"..rc)
else
set_rc(S.rc)
S.exiting = true
end
else -- if S.dir ~= dir
if S.RTS then -- loop around to other HS
S.RTS = nil
set_route("TY"..dir.."_"..lane,"AROUND")
split_off_locomotive("B0")
set_rc("AROUND_"..S.dir)
return
else
atc_send("B0WRS4")
end
end
end -- nothing to do if train goes against arrow
end
\ No newline at end of file +-- Classification track +local this_dir = true -- true = F.dir arrow points north +if F.yard_active() then + if atc_arrow then -- train is at working end + if F.has_rc("TY_arrive") then --first pass + if F.has_rc("TY_RTS") then + F.dir(not F.dir()) + F.remove_rc({"TY_RTS"}) + F.add_rc({"TY_AROUND","TY_WYE"}) --need to add direction selection in the southern headshunt controller + split_off_locomotive("A0B0") + atc_set_ars_disable(false) + return + end + F.remove_rc({"TY_arrive"}) + step_fc() + end + if this_dir = F.dir() then --train has bounced and is ready to classify wagon(s) + local t_len = train_length() + local lane = split_at_fc("A0B0",3) + if t_len ~= train_length() then -- train still has wagons to classify + F.add_rc({"TY_CLASS_"..lane}) -- to be pattern matched when leaving lane --> local remove = {} for v in F.get_rc_safe():gmatch("(TY_CLASS_*)") do table.insert(remove,v) end F.remove_rc(remove) + atc_set_ars_disable(false) + else + F.add_rc({"TY_DEPART"}) + atc_set_ars_disable(false) + --send train to collect relevant wagon group and depart + end + else --bounce train back towards working end + atc_send("S0WRD1S3") + unset_autocouple() + end + else -- train entering from the far end. set autocouple so it pushes all the way through to the bounce + set_autocouple() + end +end
\ No newline at end of file diff --git a/Tyard/nodes/(-4027,12,-2731).lua b/Tyard/nodes/(-4027,12,-2731).lua index b04ffad..2b91223 100644 --- a/Tyard/nodes/(-4027,12,-2731).lua +++ b/Tyard/nodes/(-4027,12,-2731).lua @@ -1 +1,35 @@ ---South pickup splitter
local dir = "S"
local lane = 0
--nothing below this line should indicate a hard direction
--should be able to convert to function using only above args
--------------------------------------------------
if S.yard_active then
if atc_arrow then
if S.dir == dir then
set_route("TY"..dir.."_"..lane, "HEADSHUNT")
local plen = train_length()
local rc = split_at_fc("B0")
local trc = "TY"..dir.."_"..rc
if plen == train_length() and (rc == "" or S.rc:match(trc)) then
S.exiting = true
end
if rc and rc ~= "" then
set_rc("TY"..dir.."_"..rc)
else
set_rc(S.rc)
S.exiting = true
end
else -- if S.dir ~= dir
if S.RTS then -- loop around to other HS
S.RTS = nil
set_route("TY"..dir.."_"..lane,"AROUND")
split_off_locomotive("B0")
set_rc("AROUND_"..S.dir)
return
else
atc_send("B0WRS4")
end
end
end -- nothing to do if train goes against arrow
end
\ No newline at end of file +-- Classification track +local this_dir = false -- true = F.dir arrow points north +if F.yard_active() then + if atc_arrow then -- train is at working end + if F.has_rc("TY_arrive") then --first pass + if F.has_rc("TY_RTS") then + F.dir(not F.dir()) + F.remove_rc({"TY_RTS"}) + F.add_rc({"TY_AROUND","TY_WYE"}) --need to add direction selection in the southern headshunt controller + split_off_locomotive("A0B0") + atc_set_ars_disable(false) + return + end + F.remove_rc({"TY_arrive"}) + step_fc() + end + if this_dir = F.dir() then --train has bounced and is ready to classify wagon(s) + local t_len = train_length() + local lane = split_at_fc("A0B0",3) + if t_len ~= train_length() then -- train still has wagons to classify + F.add_rc({"TY_CLASS_"..lane}) -- to be pattern matched when leaving lane --> local remove = {} for v in F.get_rc_safe():gmatch("(TY_CLASS_*)") do table.insert(remove,v) end F.remove_rc(remove) + atc_set_ars_disable(false) + else + F.add_rc({"TY_DEPART"}) + atc_set_ars_disable(false) + --send train to collect relevant wagon group and depart + end + else --bounce train back towards working end + atc_send("S0WRD1S3") + unset_autocouple() + end + else -- train entering from the far end. set autocouple so it pushes all the way through to the bounce + set_autocouple() + end +end
\ No newline at end of file diff --git a/Tyard/nodes/(-4028,12,-2655).lua b/Tyard/nodes/(-4028,12,-2655).lua new file mode 100644 index 0000000..39f9b81 --- /dev/null +++ b/Tyard/nodes/(-4028,12,-2655).lua @@ -0,0 +1 @@ +--North pickup splitter
local dir = "N"
local lane = 0
--nothing below this line should indicate a hard direction
--should be able to convert to function using only above args
--------------------------------------------------
if S.yard_active then
if atc_arrow then
if S.dir == dir then
set_route("TY"..dir.."_"..lane, "HEADSHUNT")
local plen = train_length()
local rc = split_at_fc("B0")
local trc = "TY"..dir.."_"..rc
if plen == train_length() and (rc == "" or S.rc:match(trc)) then
S.exiting = true
end
if rc and rc ~= "" then
set_rc("TY"..dir.."_"..rc)
else
set_rc(S.rc)
S.exiting = true
end
else -- if S.dir ~= dir
if S.RTS then -- loop around to other HS
S.RTS = nil
set_route("TY"..dir.."_"..lane,"AROUND")
split_off_locomotive("B0")
set_rc("AROUND_"..S.dir)
return
else
atc_send("B0WRS4")
end
end
end -- nothing to do if train goes against arrow
end
\ No newline at end of file diff --git a/Tyard/nodes/(-4028,12,-2731).lua b/Tyard/nodes/(-4028,12,-2731).lua new file mode 100644 index 0000000..b04ffad --- /dev/null +++ b/Tyard/nodes/(-4028,12,-2731).lua @@ -0,0 +1 @@ +--South pickup splitter
local dir = "S"
local lane = 0
--nothing below this line should indicate a hard direction
--should be able to convert to function using only above args
--------------------------------------------------
if S.yard_active then
if atc_arrow then
if S.dir == dir then
set_route("TY"..dir.."_"..lane, "HEADSHUNT")
local plen = train_length()
local rc = split_at_fc("B0")
local trc = "TY"..dir.."_"..rc
if plen == train_length() and (rc == "" or S.rc:match(trc)) then
S.exiting = true
end
if rc and rc ~= "" then
set_rc("TY"..dir.."_"..rc)
else
set_rc(S.rc)
S.exiting = true
end
else -- if S.dir ~= dir
if S.RTS then -- loop around to other HS
S.RTS = nil
set_route("TY"..dir.."_"..lane,"AROUND")
split_off_locomotive("B0")
set_rc("AROUND_"..S.dir)
return
else
atc_send("B0WRS4")
end
end
end -- nothing to do if train goes against arrow
end
\ No newline at end of file diff --git a/Tyard/nodes/(-4031,12,-2655).lua b/Tyard/nodes/(-4031,12,-2655).lua index b6c6d60..7489acc 100644 --- a/Tyard/nodes/(-4031,12,-2655).lua +++ b/Tyard/nodes/(-4031,12,-2655).lua @@ -1 +1 @@ -F.EOL("N",1)
\ No newline at end of file +--
\ No newline at end of file diff --git a/Tyard/nodes/(-4031,12,-2731).lua b/Tyard/nodes/(-4031,12,-2731).lua index c4c1959..7489acc 100644 --- a/Tyard/nodes/(-4031,12,-2731).lua +++ b/Tyard/nodes/(-4031,12,-2731).lua @@ -1 +1 @@ -F.EOL("S",1)
\ No newline at end of file +--
\ No newline at end of file diff --git a/Tyard/nodes/(-4032,12,-2655).lua b/Tyard/nodes/(-4032,12,-2655).lua new file mode 100644 index 0000000..b6c6d60 --- /dev/null +++ b/Tyard/nodes/(-4032,12,-2655).lua @@ -0,0 +1 @@ +F.EOL("N",1)
\ No newline at end of file diff --git a/Tyard/nodes/(-4032,12,-2731).lua b/Tyard/nodes/(-4032,12,-2731).lua new file mode 100644 index 0000000..c4c1959 --- /dev/null +++ b/Tyard/nodes/(-4032,12,-2731).lua @@ -0,0 +1 @@ +F.EOL("S",1)
\ No newline at end of file diff --git a/Tyard/nodes/(-4035,12,-2655).lua b/Tyard/nodes/(-4035,12,-2655).lua index 3fd7dcb..7489acc 100644 --- a/Tyard/nodes/(-4035,12,-2655).lua +++ b/Tyard/nodes/(-4035,12,-2655).lua @@ -1 +1 @@ -F.EOL("N",2)
\ No newline at end of file +--
\ No newline at end of file diff --git a/Tyard/nodes/(-4035,12,-2731).lua b/Tyard/nodes/(-4035,12,-2731).lua index f15a717..7489acc 100644 --- a/Tyard/nodes/(-4035,12,-2731).lua +++ b/Tyard/nodes/(-4035,12,-2731).lua @@ -1 +1 @@ -F.EOL("S",2)
\ No newline at end of file +--
\ No newline at end of file diff --git a/Tyard/nodes/(-4036,12,-2655).lua b/Tyard/nodes/(-4036,12,-2655).lua new file mode 100644 index 0000000..3fd7dcb --- /dev/null +++ b/Tyard/nodes/(-4036,12,-2655).lua @@ -0,0 +1 @@ +F.EOL("N",2)
\ No newline at end of file diff --git a/Tyard/nodes/(-4036,12,-2731).lua b/Tyard/nodes/(-4036,12,-2731).lua new file mode 100644 index 0000000..f15a717 --- /dev/null +++ b/Tyard/nodes/(-4036,12,-2731).lua @@ -0,0 +1 @@ +F.EOL("S",2)
\ No newline at end of file diff --git a/Tyard/nodes/(-4039,12,-2655).lua b/Tyard/nodes/(-4039,12,-2655).lua index 592871f..7489acc 100644 --- a/Tyard/nodes/(-4039,12,-2655).lua +++ b/Tyard/nodes/(-4039,12,-2655).lua @@ -1 +1 @@ -F.EOL("N",3)
\ No newline at end of file +--
\ No newline at end of file diff --git a/Tyard/nodes/(-4039,12,-2731).lua b/Tyard/nodes/(-4039,12,-2731).lua index af4c22e..7489acc 100644 --- a/Tyard/nodes/(-4039,12,-2731).lua +++ b/Tyard/nodes/(-4039,12,-2731).lua @@ -1 +1 @@ -F.EOL("S",3)
\ No newline at end of file +--
\ No newline at end of file diff --git a/Tyard/nodes/(-4040,12,-2655).lua b/Tyard/nodes/(-4040,12,-2655).lua new file mode 100644 index 0000000..592871f --- /dev/null +++ b/Tyard/nodes/(-4040,12,-2655).lua @@ -0,0 +1 @@ +F.EOL("N",3)
\ No newline at end of file diff --git a/Tyard/nodes/(-4040,12,-2731).lua b/Tyard/nodes/(-4040,12,-2731).lua new file mode 100644 index 0000000..af4c22e --- /dev/null +++ b/Tyard/nodes/(-4040,12,-2731).lua @@ -0,0 +1 @@ +F.EOL("S",3)
\ No newline at end of file diff --git a/Tyard/nodes/(-4043,12,-2655).lua b/Tyard/nodes/(-4043,12,-2655).lua index c86923a..7489acc 100644 --- a/Tyard/nodes/(-4043,12,-2655).lua +++ b/Tyard/nodes/(-4043,12,-2655).lua @@ -1 +1 @@ -F.EOL("N",4)
\ No newline at end of file +--
\ No newline at end of file diff --git a/Tyard/nodes/(-4043,12,-2731).lua b/Tyard/nodes/(-4043,12,-2731).lua index 9227db4..7489acc 100644 --- a/Tyard/nodes/(-4043,12,-2731).lua +++ b/Tyard/nodes/(-4043,12,-2731).lua @@ -1 +1 @@ -F.EOL("S",4)
\ No newline at end of file +--
\ No newline at end of file diff --git a/Tyard/nodes/(-4044,12,-2655).lua b/Tyard/nodes/(-4044,12,-2655).lua new file mode 100644 index 0000000..c86923a --- /dev/null +++ b/Tyard/nodes/(-4044,12,-2655).lua @@ -0,0 +1 @@ +F.EOL("N",4)
\ No newline at end of file diff --git a/Tyard/nodes/(-4044,12,-2731).lua b/Tyard/nodes/(-4044,12,-2731).lua new file mode 100644 index 0000000..9227db4 --- /dev/null +++ b/Tyard/nodes/(-4044,12,-2731).lua @@ -0,0 +1 @@ +F.EOL("S",4)
\ No newline at end of file diff --git a/Tyard/nodes/(-4047,12,-2655).lua b/Tyard/nodes/(-4047,12,-2655).lua index 3ce2888..7489acc 100644 --- a/Tyard/nodes/(-4047,12,-2655).lua +++ b/Tyard/nodes/(-4047,12,-2655).lua @@ -1 +1 @@ -F.EOL("N",5)
\ No newline at end of file +--
\ No newline at end of file diff --git a/Tyard/nodes/(-4047,12,-2731).lua b/Tyard/nodes/(-4047,12,-2731).lua index e953f0e..7489acc 100644 --- a/Tyard/nodes/(-4047,12,-2731).lua +++ b/Tyard/nodes/(-4047,12,-2731).lua @@ -1 +1 @@ -F.EOL("S",5)
\ No newline at end of file +--
\ No newline at end of file diff --git a/Tyard/nodes/(-4048,12,-2655).lua b/Tyard/nodes/(-4048,12,-2655).lua new file mode 100644 index 0000000..3ce2888 --- /dev/null +++ b/Tyard/nodes/(-4048,12,-2655).lua @@ -0,0 +1 @@ +F.EOL("N",5)
\ No newline at end of file diff --git a/Tyard/nodes/(-4048,12,-2731).lua b/Tyard/nodes/(-4048,12,-2731).lua new file mode 100644 index 0000000..e953f0e --- /dev/null +++ b/Tyard/nodes/(-4048,12,-2731).lua @@ -0,0 +1 @@ +F.EOL("S",5)
\ No newline at end of file diff --git a/Tyard/nodes/(-4051,12,-2655).lua b/Tyard/nodes/(-4051,12,-2655).lua index 9e4298b..7489acc 100644 --- a/Tyard/nodes/(-4051,12,-2655).lua +++ b/Tyard/nodes/(-4051,12,-2655).lua @@ -1 +1 @@ -F.EOL("N",6)
\ No newline at end of file +--
\ No newline at end of file diff --git a/Tyard/nodes/(-4051,12,-2731).lua b/Tyard/nodes/(-4051,12,-2731).lua index 2fc4fc5..7489acc 100644 --- a/Tyard/nodes/(-4051,12,-2731).lua +++ b/Tyard/nodes/(-4051,12,-2731).lua @@ -1 +1 @@ -F.EOL("S",6)
\ No newline at end of file +--
\ No newline at end of file diff --git a/Tyard/nodes/(-4052,12,-2655).lua b/Tyard/nodes/(-4052,12,-2655).lua new file mode 100644 index 0000000..9e4298b --- /dev/null +++ b/Tyard/nodes/(-4052,12,-2655).lua @@ -0,0 +1 @@ +F.EOL("N",6)
\ No newline at end of file diff --git a/Tyard/nodes/(-4052,12,-2731).lua b/Tyard/nodes/(-4052,12,-2731).lua new file mode 100644 index 0000000..2fc4fc5 --- /dev/null +++ b/Tyard/nodes/(-4052,12,-2731).lua @@ -0,0 +1 @@ +F.EOL("S",6)
\ No newline at end of file diff --git a/Tyard/nodes/(-4055,12,-2655).lua b/Tyard/nodes/(-4055,12,-2655).lua index 4113ece..7489acc 100644 --- a/Tyard/nodes/(-4055,12,-2655).lua +++ b/Tyard/nodes/(-4055,12,-2655).lua @@ -1 +1 @@ -F.EOL("N",7)
\ No newline at end of file +--
\ No newline at end of file diff --git a/Tyard/nodes/(-4055,12,-2731).lua b/Tyard/nodes/(-4055,12,-2731).lua index edb2ef8..7489acc 100644 --- a/Tyard/nodes/(-4055,12,-2731).lua +++ b/Tyard/nodes/(-4055,12,-2731).lua @@ -1 +1 @@ -F.EOL("S",7)
\ No newline at end of file +--
\ No newline at end of file diff --git a/Tyard/nodes/(-4056,12,-2655).lua b/Tyard/nodes/(-4056,12,-2655).lua new file mode 100644 index 0000000..4113ece --- /dev/null +++ b/Tyard/nodes/(-4056,12,-2655).lua @@ -0,0 +1 @@ +F.EOL("N",7)
\ No newline at end of file diff --git a/Tyard/nodes/(-4056,12,-2731).lua b/Tyard/nodes/(-4056,12,-2731).lua new file mode 100644 index 0000000..edb2ef8 --- /dev/null +++ b/Tyard/nodes/(-4056,12,-2731).lua @@ -0,0 +1 @@ +F.EOL("S",7)
\ No newline at end of file diff --git a/Tyard/nodes/(-4100,12,-2745).lua b/Tyard/nodes/(-4100,12,-2745).lua new file mode 100644 index 0000000..16007e9 --- /dev/null +++ b/Tyard/nodes/(-4100,12,-2745).lua @@ -0,0 +1,33 @@ +-- Yard arrival checker +local function enter_yard() + F.dir(true) + F.yard_active(true) + atc_set_ars_disable(false) + atc_send("S6") + return +end + +__approach_callback_mode = 1 +if event.approach and not event.has_entered then + atc_set_ars_disable(true) + atc_set_lzb_trs(1) + return +end + +if event.train then + if F.yard_active() then + schedule_in(";10","recheck") + return + else + enter_yard() + end +end + +if event.schedule then + if F.yard_active() then + schedule_in(";10","recheck") + return + else + enter_yard() + end +end
\ No newline at end of file |