From 572b186e28ddc2a630613765c0f0780b4664380f Mon Sep 17 00:00:00 2001 From: autocommitter Date: Tue, 15 Oct 2024 22:37:42 +0200 Subject: State at 2024-10-15 --- Tyard/nodes/(-3967,12,-2646).lua | 43 ---------------------------- Tyard/nodes/(-4011,12,-2642).lua | 38 ------------------------- Tyard/nodes/(-4011,12,-2646).lua | 1 - Tyard/nodes/(-4011,12,-2647).lua | 1 - Tyard/nodes/(-4012,12,-2646).lua | 61 ---------------------------------------- Tyard/nodes/(-4024,12,-2642).lua | 1 - Tyard/nodes/(-4027,12,-2655).lua | 58 -------------------------------------- Tyard/nodes/(-4027,12,-2731).lua | 58 -------------------------------------- Tyard/nodes/(-4028,12,-2655).lua | 1 - Tyard/nodes/(-4028,12,-2731).lua | 1 - Tyard/nodes/(-4031,12,-2655).lua | 28 ------------------ Tyard/nodes/(-4031,12,-2731).lua | 28 ------------------ Tyard/nodes/(-4032,12,-2655).lua | 1 - Tyard/nodes/(-4032,12,-2731).lua | 1 - Tyard/nodes/(-4035,12,-2655).lua | 28 ------------------ Tyard/nodes/(-4035,12,-2731).lua | 28 ------------------ Tyard/nodes/(-4036,12,-2655).lua | 1 - Tyard/nodes/(-4036,12,-2731).lua | 1 - Tyard/nodes/(-4039,12,-2655).lua | 28 ------------------ Tyard/nodes/(-4039,12,-2731).lua | 28 ------------------ Tyard/nodes/(-4040,12,-2655).lua | 1 - Tyard/nodes/(-4040,12,-2731).lua | 1 - Tyard/nodes/(-4043,12,-2655).lua | 28 ------------------ Tyard/nodes/(-4043,12,-2731).lua | 28 ------------------ Tyard/nodes/(-4044,12,-2655).lua | 1 - Tyard/nodes/(-4044,12,-2731).lua | 1 - Tyard/nodes/(-4047,12,-2655).lua | 28 ------------------ Tyard/nodes/(-4047,12,-2731).lua | 28 ------------------ Tyard/nodes/(-4048,12,-2655).lua | 1 - Tyard/nodes/(-4048,12,-2731).lua | 1 - Tyard/nodes/(-4051,12,-2655).lua | 28 ------------------ Tyard/nodes/(-4051,12,-2731).lua | 28 ------------------ Tyard/nodes/(-4052,12,-2655).lua | 1 - Tyard/nodes/(-4052,12,-2731).lua | 1 - Tyard/nodes/(-4055,12,-2655).lua | 28 ------------------ Tyard/nodes/(-4055,12,-2731).lua | 28 ------------------ Tyard/nodes/(-4056,12,-2655).lua | 1 - Tyard/nodes/(-4056,12,-2731).lua | 1 - Tyard/nodes/(-4059,12,-2714).lua | 1 - Tyard/nodes/(-4063,12,-2669).lua | 1 - Tyard/nodes/(-4100,12,-2742).lua | 61 ---------------------------------------- Tyard/nodes/(-4100,12,-2745).lua | 38 ------------------------- Tyard/nodes/(-4167,12,-2742).lua | 42 --------------------------- 43 files changed, 812 deletions(-) delete mode 100644 Tyard/nodes/(-3967,12,-2646).lua delete mode 100644 Tyard/nodes/(-4011,12,-2642).lua delete mode 100644 Tyard/nodes/(-4011,12,-2646).lua delete mode 100644 Tyard/nodes/(-4011,12,-2647).lua delete mode 100644 Tyard/nodes/(-4012,12,-2646).lua delete mode 100644 Tyard/nodes/(-4024,12,-2642).lua delete mode 100644 Tyard/nodes/(-4027,12,-2655).lua delete mode 100644 Tyard/nodes/(-4027,12,-2731).lua delete mode 100644 Tyard/nodes/(-4028,12,-2655).lua delete mode 100644 Tyard/nodes/(-4028,12,-2731).lua delete mode 100644 Tyard/nodes/(-4031,12,-2655).lua delete mode 100644 Tyard/nodes/(-4031,12,-2731).lua delete mode 100644 Tyard/nodes/(-4032,12,-2655).lua delete mode 100644 Tyard/nodes/(-4032,12,-2731).lua delete mode 100644 Tyard/nodes/(-4035,12,-2655).lua delete mode 100644 Tyard/nodes/(-4035,12,-2731).lua delete mode 100644 Tyard/nodes/(-4036,12,-2655).lua delete mode 100644 Tyard/nodes/(-4036,12,-2731).lua delete mode 100644 Tyard/nodes/(-4039,12,-2655).lua delete mode 100644 Tyard/nodes/(-4039,12,-2731).lua delete mode 100644 Tyard/nodes/(-4040,12,-2655).lua delete mode 100644 Tyard/nodes/(-4040,12,-2731).lua delete mode 100644 Tyard/nodes/(-4043,12,-2655).lua delete mode 100644 Tyard/nodes/(-4043,12,-2731).lua delete mode 100644 Tyard/nodes/(-4044,12,-2655).lua delete mode 100644 Tyard/nodes/(-4044,12,-2731).lua delete mode 100644 Tyard/nodes/(-4047,12,-2655).lua delete mode 100644 Tyard/nodes/(-4047,12,-2731).lua delete mode 100644 Tyard/nodes/(-4048,12,-2655).lua delete mode 100644 Tyard/nodes/(-4048,12,-2731).lua delete mode 100644 Tyard/nodes/(-4051,12,-2655).lua delete mode 100644 Tyard/nodes/(-4051,12,-2731).lua delete mode 100644 Tyard/nodes/(-4052,12,-2655).lua delete mode 100644 Tyard/nodes/(-4052,12,-2731).lua delete mode 100644 Tyard/nodes/(-4055,12,-2655).lua delete mode 100644 Tyard/nodes/(-4055,12,-2731).lua delete mode 100644 Tyard/nodes/(-4056,12,-2655).lua delete mode 100644 Tyard/nodes/(-4056,12,-2731).lua delete mode 100644 Tyard/nodes/(-4059,12,-2714).lua delete mode 100644 Tyard/nodes/(-4063,12,-2669).lua delete mode 100644 Tyard/nodes/(-4100,12,-2742).lua delete mode 100644 Tyard/nodes/(-4100,12,-2745).lua delete mode 100644 Tyard/nodes/(-4167,12,-2742).lua (limited to 'Tyard/nodes') diff --git a/Tyard/nodes/(-3967,12,-2646).lua b/Tyard/nodes/(-3967,12,-2646).lua deleted file mode 100644 index bf0099d..0000000 --- a/Tyard/nodes/(-3967,12,-2646).lua +++ /dev/null @@ -1,43 +0,0 @@ --- Headshunt Exit Controller -local exit_signal = POS(-3962,14,-2645) - -if not F.yard_active() then return end -__approach_callback_mode = 1 -if event.approach and not event.has_entered then - atc_set_ars_disable(true) - atc_set_lzb_tsr(1) - return -end - -if event.train then - if atc_arrow then - if F.has_rc("TY_DEPART") then - print("Train departs yard to mainline at full speed") - unset_autocouple() - F.remove_rc({"TY_FINAL_COLLECT","TY_DEPART"}) - F.remove_rc_match("TY_LOCOS_%d+") - F.remove_rc_match("TY_WAGONS_%d+") - atc_set_ars_disable(false) - set_route(exit_signal,"Exit Yard") - atc_send("S6D10SM") - schedule_in(";05","deactivate_check") -- wait a little to ensure train is clear from headshunt to deactivate yard - print(F.get_rc_safe()) - return - end - else - atc_send("BBOL") - F.error(true) - end -end - -if event.schedule then - if event.msg == "deactivate_check" then - if not atc_id then - F.yard_active(false) - print("Yard Disabled") - else - schedule_in(";05","deactivate_check") - return - end - end -end \ No newline at end of file diff --git a/Tyard/nodes/(-4011,12,-2642).lua b/Tyard/nodes/(-4011,12,-2642).lua deleted file mode 100644 index 2498bc5..0000000 --- a/Tyard/nodes/(-4011,12,-2642).lua +++ /dev/null @@ -1,38 +0,0 @@ --- Yard arrival checker --- F.dir = true if entering from south - -if F.has_rc("TY_NOSHUNT") then return end - -local function enter_yard() - F.dir(false) - F.yard_active(true) - F.add_rc({"TY_ARRIVE"}) - 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_tsr(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,-2646).lua b/Tyard/nodes/(-4011,12,-2646).lua deleted file mode 100644 index 3c9efc3..0000000 --- a/Tyard/nodes/(-4011,12,-2646).lua +++ /dev/null @@ -1 +0,0 @@ ---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/(-4011,12,-2647).lua b/Tyard/nodes/(-4011,12,-2647).lua deleted file mode 100644 index 3c9efc3..0000000 --- a/Tyard/nodes/(-4011,12,-2647).lua +++ /dev/null @@ -1 +0,0 @@ ---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 deleted file mode 100644 index 00d6c1b..0000000 --- a/Tyard/nodes/(-4012,12,-2646).lua +++ /dev/null @@ -1,61 +0,0 @@ --- Headshunt Controller --- Note: may need customising due to track layout -local this_dir = true -- true = F.dir arrow points north. atc_arrow points towards yard - -if not F.yard_active() then return end - -__approach_callback_mode = 1 -if event.approach and not event.has_entered then - atc_set_ars_disable(true) - atc_set_lzb_tsr(1) - return -end - -if event.train then - if not atc_arrow then --train has entered headshunt from yard. bounce or depart - atc_set_ars_disable(true) - F.remove_rc({"TY_HEADSHUNT"}) - if not F.has_rc("TY_FINAL_COLLECT") then - if not F.has_rc("TY_DEPART") then - schedule_in(";01",atc_id) - return - else - local collect = F.get_rc_safe():match("TY_COLLECT_(%S+)") - if collect then --train needs to collect a rake from the yard before departing - F.add_rc({"TY_FINAL_COLLECT","TY_CLASS_"..collect}) - schedule_in(";01",atc_id) - return - end - end - - --else let train proceed forward to the exit controller without a rake - end --else train has already collected rake. let it exit yard - else --train has bounced - if F.has_rc("TY_AROUND") then - if this_dir == F.dir() then --send train to Classification - F.remove_rc({"TY_AROUND"}) - F.add_rc({"TY_PICKUP"}) - atc_set_ars_disable(false) - return - end --if at wrong end, do nothing. train will follow TY_AROUND ARS to relevant headshunt - end -- if doesn't have TY_AROUND then let ARS classify the train - - atc_set_ars_disable(false) - end - return -end - -if event.schedule then - if not atc_id then --bounce the train that just passed - atc_send_to_train(event.msg,"B0WRD1S3A1") - else - if atc_id == event.msg then --train hasn't fully passed yet, wait a bit longer - schedule_in(";01",atc_id) - else -- somehow another train crossed the controller before the first one returned. Unlikely but possible - atc_send_to_train(event.msg,"BBOL") - atc_send("BBOL") - F.error(true) - end - end - return -end \ No newline at end of file diff --git a/Tyard/nodes/(-4024,12,-2642).lua b/Tyard/nodes/(-4024,12,-2642).lua deleted file mode 100644 index 36743ff..0000000 --- a/Tyard/nodes/(-4024,12,-2642).lua +++ /dev/null @@ -1 +0,0 @@ -if event.channel=="ops" or event.punch then digiline_send("lcd","Active:"..tostring(S.yard_active).."\nRC:"..tostring(S.rc).."\nRTS:"..tostring(S.RTS) .. " Dir:"..tostring(S.dir) .."\nExiting:"..tostring(S.exiting)) end \ No newline at end of file diff --git a/Tyard/nodes/(-4027,12,-2655).lua b/Tyard/nodes/(-4027,12,-2655).lua deleted file mode 100644 index 1c12a8f..0000000 --- a/Tyard/nodes/(-4027,12,-2655).lua +++ /dev/null @@ -1,58 +0,0 @@ --- Classification track -local this_dir = true --- this_dir == true for north end, false for south end -if F.yard_active() then - if atc_arrow then -- loco is at working end - F.remove_rc({"TY_PICKUP"}) - if F.has_rc("TY_ARRIVE") and F.dir() == this_dir then --first pass, prep train for working - F.remove_rc({"TY_AROUND"}) - if not F.get_rc_safe():match("TY_LOCOS_%d+") or not F.get_rc_safe():match("TY_WAGONS_%d+") then - local full_length = train_length() - split_off_locomotive("A0B0") - F.add_rc({"TY_HEADSHUNT"}) -- train will end up going through headshunt no matter what. there shouldn't be any trains entering that pass straight through. - if train_length() == full_length then --train is either only here for collection or there's no FC's in the wagons. can't differentiate - local lane = F.get_rc_safe():match("TY_COLLECT_(%S+)") or "" - F.add_rc({"TY_LAST_CLASS","TY_CLASS_"..lane}) -- direct train to correct lane for collection - else --identify and save loco:wagon ratio, then bounce back from headshunt. it's easier than trying to reconnect - F.add_rc({"TY_LOCOS_"..train_length(), "TY_WAGONS_"..(full_length-train_length()),"TY_PICKUP"}) - end - return -- train has departed for headshunt - end - if F.has_rc("TY_RTS") then - F.dir(not F.dir()) - F.remove_rc({"TY_RTS"}) - F.add_rc({"TY_AROUND"}) -- send loco around to the other end - split_off_locomotive("A0B0") - atc_set_ars_disable(false) - return -- train has departed for RTS loop - 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 pre_split = train_length() - local lane = split_at_fc("A0B0",5) -- where to classify this rake -- headshunt length - local locos = tonumber(F.get_rc_safe():match("TY_LOCOS_(%d+)")) or 1 --saved loco count - local wagons = tonumber(F.get_rc_safe():match("TY_WAGONS_(%d+)")) or 0 -- wagon_count from last classification split - local this_rake = train_length() - locos-- subtract these wagons from the overall wagon count - if this_rake == wagons then -- mark for last_classification - F.add_rc({"TY_LAST_CLASS"}) - end - if lane ~= "" then - F.add_rc({"TY_CLASS_"..lane}) - end - for v in F.get_rc_safe():gmatch("(TY_WAGONS_%d+)") do - F.remove_rc({v}) - end - F.add_rc({"TY_HEADSHUNT","TY_WAGONS_"..wagons-this_rake}) - atc_set_ars_disable(false) - set_autocouple() - else --bounce train back towards working end - atc_set_ars_disable(true) - 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 deleted file mode 100644 index 5491309..0000000 --- a/Tyard/nodes/(-4027,12,-2731).lua +++ /dev/null @@ -1,58 +0,0 @@ --- Classification track -local this_dir = false --- this_dir == true for north end, false for south end -if F.yard_active() then - if atc_arrow then -- loco is at working end - F.remove_rc({"TY_PICKUP"}) - if F.has_rc("TY_ARRIVE") and F.dir() == this_dir then --first pass, prep train for working - F.remove_rc({"TY_AROUND"}) - if not F.get_rc_safe():match("TY_LOCOS_%d+") or not F.get_rc_safe():match("TY_WAGONS_%d+") then - local full_length = train_length() - split_off_locomotive("A0B0") - F.add_rc({"TY_HEADSHUNT"}) -- train will end up going through headshunt no matter what. there shouldn't be any trains entering that pass straight through. - if train_length() == full_length then --train is either only here for collection or there's no FC's in the wagons. can't differentiate - local lane = F.get_rc_safe():match("TY_COLLECT_(%S+)") or "" - F.add_rc({"TY_LAST_CLASS","TY_CLASS_"..lane}) -- direct train to correct lane for collection - else --identify and save loco:wagon ratio, then bounce back from headshunt. it's easier than trying to reconnect - F.add_rc({"TY_LOCOS_"..train_length(), "TY_WAGONS_"..(full_length-train_length()),"TY_PICKUP"}) - end - return -- train has departed for headshunt - end - if F.has_rc("TY_RTS") then - F.dir(not F.dir()) - F.remove_rc({"TY_RTS"}) - F.add_rc({"TY_AROUND"}) -- send loco around to the other end - split_off_locomotive("A0B0") - atc_set_ars_disable(false) - return -- train has departed for RTS loop - 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 pre_split = train_length() - local lane = split_at_fc("A0B0",5) -- where to classify this rake -- headshunt length - local locos = tonumber(F.get_rc_safe():match("TY_LOCOS_(%d+)")) or 1 --saved loco count - local wagons = tonumber(F.get_rc_safe():match("TY_WAGONS_(%d+)")) or 0 -- wagon_count from last classification split - local this_rake = train_length() - locos-- subtract these wagons from the overall wagon count - if this_rake == wagons then -- mark for last_classification - F.add_rc({"TY_LAST_CLASS"}) - end - if lane ~= "" then - F.add_rc({"TY_CLASS_"..lane}) - end - for v in F.get_rc_safe():gmatch("(TY_WAGONS_%d+)") do - F.remove_rc({v}) - end - F.add_rc({"TY_HEADSHUNT","TY_WAGONS_"..wagons-this_rake}) - atc_set_ars_disable(false) - set_autocouple() - else --bounce train back towards working end - atc_set_ars_disable(true) - 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 deleted file mode 100644 index 39f9b81..0000000 --- a/Tyard/nodes/(-4028,12,-2655).lua +++ /dev/null @@ -1 +0,0 @@ ---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 deleted file mode 100644 index b04ffad..0000000 --- a/Tyard/nodes/(-4028,12,-2731).lua +++ /dev/null @@ -1 +0,0 @@ ---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 deleted file mode 100644 index f08c2fe..0000000 --- a/Tyard/nodes/(-4031,12,-2655).lua +++ /dev/null @@ -1,28 +0,0 @@ ---EOL code -local this_dir = true -- true = F.dir arrow points north - -if not F.yard_active() then return end -if atc_arrow then - if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it - if F.has_rc("TY_LAST_CLASS") then -- take the whole rake to the exit - F.remove_rc({"TY_LAST_CLASS"}) - F.add_rc({"TY_DEPART"}) - split_off_locomotive("A0B0") - elseif not F.has_rc("TY_FINAL_COLLECT") then - -- disconnect loco and return to pickup - split_off_locomotive("A0B0") - F.add_rc({"TY_PICKUP"}) - end --if has FINAL_COLLECT then don't split off the loco. take the full rake - F.add_rc({"TY_HEADSHUNT"}) - else --train needs to bounce - atc_send("B0WRD1S4") - end -else - if F.dir() == this_dir then - --train is clasifying wagons, let it pass and couple to the rest of the rake - F.remove_rc_match("TY_CLASS_%S+") - else --this should never come into play as it means the train has entered from the wrong end somehow - atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required - F.error(true) - end -end \ No newline at end of file diff --git a/Tyard/nodes/(-4031,12,-2731).lua b/Tyard/nodes/(-4031,12,-2731).lua deleted file mode 100644 index aad7649..0000000 --- a/Tyard/nodes/(-4031,12,-2731).lua +++ /dev/null @@ -1,28 +0,0 @@ ---EOL code -local this_dir = false -- true = F.dir arrow points north - -if not F.yard_active() then return end -if atc_arrow then - if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it - if F.has_rc("TY_LAST_CLASS") then -- take the whole rake to the exit - F.remove_rc({"TY_LAST_CLASS"}) - F.add_rc({"TY_DEPART"}) - split_off_locomotive("A0B0") - elseif not F.has_rc("TY_FINAL_COLLECT") then - -- disconnect loco and return to pickup - split_off_locomotive("A0B0") - F.add_rc({"TY_PICKUP"}) - end --if has FINAL_COLLECT then don't split off the loco. take the full rake - F.add_rc({"TY_HEADSHUNT"}) - else --train needs to bounce - atc_send("B0WRD1S4") - end -else - if F.dir() == this_dir then - --train is clasifying wagons, let it pass and couple to the rest of the rake - F.remove_rc_match("TY_CLASS_%S+") - else --this should never come into play as it means the train has entered from the wrong end somehow - atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required - F.error(true) - end -end \ No newline at end of file diff --git a/Tyard/nodes/(-4032,12,-2655).lua b/Tyard/nodes/(-4032,12,-2655).lua deleted file mode 100644 index b6c6d60..0000000 --- a/Tyard/nodes/(-4032,12,-2655).lua +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index c4c1959..0000000 --- a/Tyard/nodes/(-4032,12,-2731).lua +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index f08c2fe..0000000 --- a/Tyard/nodes/(-4035,12,-2655).lua +++ /dev/null @@ -1,28 +0,0 @@ ---EOL code -local this_dir = true -- true = F.dir arrow points north - -if not F.yard_active() then return end -if atc_arrow then - if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it - if F.has_rc("TY_LAST_CLASS") then -- take the whole rake to the exit - F.remove_rc({"TY_LAST_CLASS"}) - F.add_rc({"TY_DEPART"}) - split_off_locomotive("A0B0") - elseif not F.has_rc("TY_FINAL_COLLECT") then - -- disconnect loco and return to pickup - split_off_locomotive("A0B0") - F.add_rc({"TY_PICKUP"}) - end --if has FINAL_COLLECT then don't split off the loco. take the full rake - F.add_rc({"TY_HEADSHUNT"}) - else --train needs to bounce - atc_send("B0WRD1S4") - end -else - if F.dir() == this_dir then - --train is clasifying wagons, let it pass and couple to the rest of the rake - F.remove_rc_match("TY_CLASS_%S+") - else --this should never come into play as it means the train has entered from the wrong end somehow - atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required - F.error(true) - end -end \ No newline at end of file diff --git a/Tyard/nodes/(-4035,12,-2731).lua b/Tyard/nodes/(-4035,12,-2731).lua deleted file mode 100644 index aad7649..0000000 --- a/Tyard/nodes/(-4035,12,-2731).lua +++ /dev/null @@ -1,28 +0,0 @@ ---EOL code -local this_dir = false -- true = F.dir arrow points north - -if not F.yard_active() then return end -if atc_arrow then - if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it - if F.has_rc("TY_LAST_CLASS") then -- take the whole rake to the exit - F.remove_rc({"TY_LAST_CLASS"}) - F.add_rc({"TY_DEPART"}) - split_off_locomotive("A0B0") - elseif not F.has_rc("TY_FINAL_COLLECT") then - -- disconnect loco and return to pickup - split_off_locomotive("A0B0") - F.add_rc({"TY_PICKUP"}) - end --if has FINAL_COLLECT then don't split off the loco. take the full rake - F.add_rc({"TY_HEADSHUNT"}) - else --train needs to bounce - atc_send("B0WRD1S4") - end -else - if F.dir() == this_dir then - --train is clasifying wagons, let it pass and couple to the rest of the rake - F.remove_rc_match("TY_CLASS_%S+") - else --this should never come into play as it means the train has entered from the wrong end somehow - atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required - F.error(true) - end -end \ No newline at end of file diff --git a/Tyard/nodes/(-4036,12,-2655).lua b/Tyard/nodes/(-4036,12,-2655).lua deleted file mode 100644 index 3fd7dcb..0000000 --- a/Tyard/nodes/(-4036,12,-2655).lua +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index f15a717..0000000 --- a/Tyard/nodes/(-4036,12,-2731).lua +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index f08c2fe..0000000 --- a/Tyard/nodes/(-4039,12,-2655).lua +++ /dev/null @@ -1,28 +0,0 @@ ---EOL code -local this_dir = true -- true = F.dir arrow points north - -if not F.yard_active() then return end -if atc_arrow then - if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it - if F.has_rc("TY_LAST_CLASS") then -- take the whole rake to the exit - F.remove_rc({"TY_LAST_CLASS"}) - F.add_rc({"TY_DEPART"}) - split_off_locomotive("A0B0") - elseif not F.has_rc("TY_FINAL_COLLECT") then - -- disconnect loco and return to pickup - split_off_locomotive("A0B0") - F.add_rc({"TY_PICKUP"}) - end --if has FINAL_COLLECT then don't split off the loco. take the full rake - F.add_rc({"TY_HEADSHUNT"}) - else --train needs to bounce - atc_send("B0WRD1S4") - end -else - if F.dir() == this_dir then - --train is clasifying wagons, let it pass and couple to the rest of the rake - F.remove_rc_match("TY_CLASS_%S+") - else --this should never come into play as it means the train has entered from the wrong end somehow - atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required - F.error(true) - end -end \ No newline at end of file diff --git a/Tyard/nodes/(-4039,12,-2731).lua b/Tyard/nodes/(-4039,12,-2731).lua deleted file mode 100644 index aad7649..0000000 --- a/Tyard/nodes/(-4039,12,-2731).lua +++ /dev/null @@ -1,28 +0,0 @@ ---EOL code -local this_dir = false -- true = F.dir arrow points north - -if not F.yard_active() then return end -if atc_arrow then - if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it - if F.has_rc("TY_LAST_CLASS") then -- take the whole rake to the exit - F.remove_rc({"TY_LAST_CLASS"}) - F.add_rc({"TY_DEPART"}) - split_off_locomotive("A0B0") - elseif not F.has_rc("TY_FINAL_COLLECT") then - -- disconnect loco and return to pickup - split_off_locomotive("A0B0") - F.add_rc({"TY_PICKUP"}) - end --if has FINAL_COLLECT then don't split off the loco. take the full rake - F.add_rc({"TY_HEADSHUNT"}) - else --train needs to bounce - atc_send("B0WRD1S4") - end -else - if F.dir() == this_dir then - --train is clasifying wagons, let it pass and couple to the rest of the rake - F.remove_rc_match("TY_CLASS_%S+") - else --this should never come into play as it means the train has entered from the wrong end somehow - atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required - F.error(true) - end -end \ No newline at end of file diff --git a/Tyard/nodes/(-4040,12,-2655).lua b/Tyard/nodes/(-4040,12,-2655).lua deleted file mode 100644 index 592871f..0000000 --- a/Tyard/nodes/(-4040,12,-2655).lua +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index af4c22e..0000000 --- a/Tyard/nodes/(-4040,12,-2731).lua +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index f08c2fe..0000000 --- a/Tyard/nodes/(-4043,12,-2655).lua +++ /dev/null @@ -1,28 +0,0 @@ ---EOL code -local this_dir = true -- true = F.dir arrow points north - -if not F.yard_active() then return end -if atc_arrow then - if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it - if F.has_rc("TY_LAST_CLASS") then -- take the whole rake to the exit - F.remove_rc({"TY_LAST_CLASS"}) - F.add_rc({"TY_DEPART"}) - split_off_locomotive("A0B0") - elseif not F.has_rc("TY_FINAL_COLLECT") then - -- disconnect loco and return to pickup - split_off_locomotive("A0B0") - F.add_rc({"TY_PICKUP"}) - end --if has FINAL_COLLECT then don't split off the loco. take the full rake - F.add_rc({"TY_HEADSHUNT"}) - else --train needs to bounce - atc_send("B0WRD1S4") - end -else - if F.dir() == this_dir then - --train is clasifying wagons, let it pass and couple to the rest of the rake - F.remove_rc_match("TY_CLASS_%S+") - else --this should never come into play as it means the train has entered from the wrong end somehow - atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required - F.error(true) - end -end \ No newline at end of file diff --git a/Tyard/nodes/(-4043,12,-2731).lua b/Tyard/nodes/(-4043,12,-2731).lua deleted file mode 100644 index aad7649..0000000 --- a/Tyard/nodes/(-4043,12,-2731).lua +++ /dev/null @@ -1,28 +0,0 @@ ---EOL code -local this_dir = false -- true = F.dir arrow points north - -if not F.yard_active() then return end -if atc_arrow then - if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it - if F.has_rc("TY_LAST_CLASS") then -- take the whole rake to the exit - F.remove_rc({"TY_LAST_CLASS"}) - F.add_rc({"TY_DEPART"}) - split_off_locomotive("A0B0") - elseif not F.has_rc("TY_FINAL_COLLECT") then - -- disconnect loco and return to pickup - split_off_locomotive("A0B0") - F.add_rc({"TY_PICKUP"}) - end --if has FINAL_COLLECT then don't split off the loco. take the full rake - F.add_rc({"TY_HEADSHUNT"}) - else --train needs to bounce - atc_send("B0WRD1S4") - end -else - if F.dir() == this_dir then - --train is clasifying wagons, let it pass and couple to the rest of the rake - F.remove_rc_match("TY_CLASS_%S+") - else --this should never come into play as it means the train has entered from the wrong end somehow - atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required - F.error(true) - end -end \ No newline at end of file diff --git a/Tyard/nodes/(-4044,12,-2655).lua b/Tyard/nodes/(-4044,12,-2655).lua deleted file mode 100644 index c86923a..0000000 --- a/Tyard/nodes/(-4044,12,-2655).lua +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 9227db4..0000000 --- a/Tyard/nodes/(-4044,12,-2731).lua +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index f08c2fe..0000000 --- a/Tyard/nodes/(-4047,12,-2655).lua +++ /dev/null @@ -1,28 +0,0 @@ ---EOL code -local this_dir = true -- true = F.dir arrow points north - -if not F.yard_active() then return end -if atc_arrow then - if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it - if F.has_rc("TY_LAST_CLASS") then -- take the whole rake to the exit - F.remove_rc({"TY_LAST_CLASS"}) - F.add_rc({"TY_DEPART"}) - split_off_locomotive("A0B0") - elseif not F.has_rc("TY_FINAL_COLLECT") then - -- disconnect loco and return to pickup - split_off_locomotive("A0B0") - F.add_rc({"TY_PICKUP"}) - end --if has FINAL_COLLECT then don't split off the loco. take the full rake - F.add_rc({"TY_HEADSHUNT"}) - else --train needs to bounce - atc_send("B0WRD1S4") - end -else - if F.dir() == this_dir then - --train is clasifying wagons, let it pass and couple to the rest of the rake - F.remove_rc_match("TY_CLASS_%S+") - else --this should never come into play as it means the train has entered from the wrong end somehow - atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required - F.error(true) - end -end \ No newline at end of file diff --git a/Tyard/nodes/(-4047,12,-2731).lua b/Tyard/nodes/(-4047,12,-2731).lua deleted file mode 100644 index aad7649..0000000 --- a/Tyard/nodes/(-4047,12,-2731).lua +++ /dev/null @@ -1,28 +0,0 @@ ---EOL code -local this_dir = false -- true = F.dir arrow points north - -if not F.yard_active() then return end -if atc_arrow then - if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it - if F.has_rc("TY_LAST_CLASS") then -- take the whole rake to the exit - F.remove_rc({"TY_LAST_CLASS"}) - F.add_rc({"TY_DEPART"}) - split_off_locomotive("A0B0") - elseif not F.has_rc("TY_FINAL_COLLECT") then - -- disconnect loco and return to pickup - split_off_locomotive("A0B0") - F.add_rc({"TY_PICKUP"}) - end --if has FINAL_COLLECT then don't split off the loco. take the full rake - F.add_rc({"TY_HEADSHUNT"}) - else --train needs to bounce - atc_send("B0WRD1S4") - end -else - if F.dir() == this_dir then - --train is clasifying wagons, let it pass and couple to the rest of the rake - F.remove_rc_match("TY_CLASS_%S+") - else --this should never come into play as it means the train has entered from the wrong end somehow - atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required - F.error(true) - end -end \ No newline at end of file diff --git a/Tyard/nodes/(-4048,12,-2655).lua b/Tyard/nodes/(-4048,12,-2655).lua deleted file mode 100644 index 3ce2888..0000000 --- a/Tyard/nodes/(-4048,12,-2655).lua +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index e953f0e..0000000 --- a/Tyard/nodes/(-4048,12,-2731).lua +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index f08c2fe..0000000 --- a/Tyard/nodes/(-4051,12,-2655).lua +++ /dev/null @@ -1,28 +0,0 @@ ---EOL code -local this_dir = true -- true = F.dir arrow points north - -if not F.yard_active() then return end -if atc_arrow then - if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it - if F.has_rc("TY_LAST_CLASS") then -- take the whole rake to the exit - F.remove_rc({"TY_LAST_CLASS"}) - F.add_rc({"TY_DEPART"}) - split_off_locomotive("A0B0") - elseif not F.has_rc("TY_FINAL_COLLECT") then - -- disconnect loco and return to pickup - split_off_locomotive("A0B0") - F.add_rc({"TY_PICKUP"}) - end --if has FINAL_COLLECT then don't split off the loco. take the full rake - F.add_rc({"TY_HEADSHUNT"}) - else --train needs to bounce - atc_send("B0WRD1S4") - end -else - if F.dir() == this_dir then - --train is clasifying wagons, let it pass and couple to the rest of the rake - F.remove_rc_match("TY_CLASS_%S+") - else --this should never come into play as it means the train has entered from the wrong end somehow - atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required - F.error(true) - end -end \ No newline at end of file diff --git a/Tyard/nodes/(-4051,12,-2731).lua b/Tyard/nodes/(-4051,12,-2731).lua deleted file mode 100644 index aad7649..0000000 --- a/Tyard/nodes/(-4051,12,-2731).lua +++ /dev/null @@ -1,28 +0,0 @@ ---EOL code -local this_dir = false -- true = F.dir arrow points north - -if not F.yard_active() then return end -if atc_arrow then - if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it - if F.has_rc("TY_LAST_CLASS") then -- take the whole rake to the exit - F.remove_rc({"TY_LAST_CLASS"}) - F.add_rc({"TY_DEPART"}) - split_off_locomotive("A0B0") - elseif not F.has_rc("TY_FINAL_COLLECT") then - -- disconnect loco and return to pickup - split_off_locomotive("A0B0") - F.add_rc({"TY_PICKUP"}) - end --if has FINAL_COLLECT then don't split off the loco. take the full rake - F.add_rc({"TY_HEADSHUNT"}) - else --train needs to bounce - atc_send("B0WRD1S4") - end -else - if F.dir() == this_dir then - --train is clasifying wagons, let it pass and couple to the rest of the rake - F.remove_rc_match("TY_CLASS_%S+") - else --this should never come into play as it means the train has entered from the wrong end somehow - atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required - F.error(true) - end -end \ No newline at end of file diff --git a/Tyard/nodes/(-4052,12,-2655).lua b/Tyard/nodes/(-4052,12,-2655).lua deleted file mode 100644 index 9e4298b..0000000 --- a/Tyard/nodes/(-4052,12,-2655).lua +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2fc4fc5..0000000 --- a/Tyard/nodes/(-4052,12,-2731).lua +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index f08c2fe..0000000 --- a/Tyard/nodes/(-4055,12,-2655).lua +++ /dev/null @@ -1,28 +0,0 @@ ---EOL code -local this_dir = true -- true = F.dir arrow points north - -if not F.yard_active() then return end -if atc_arrow then - if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it - if F.has_rc("TY_LAST_CLASS") then -- take the whole rake to the exit - F.remove_rc({"TY_LAST_CLASS"}) - F.add_rc({"TY_DEPART"}) - split_off_locomotive("A0B0") - elseif not F.has_rc("TY_FINAL_COLLECT") then - -- disconnect loco and return to pickup - split_off_locomotive("A0B0") - F.add_rc({"TY_PICKUP"}) - end --if has FINAL_COLLECT then don't split off the loco. take the full rake - F.add_rc({"TY_HEADSHUNT"}) - else --train needs to bounce - atc_send("B0WRD1S4") - end -else - if F.dir() == this_dir then - --train is clasifying wagons, let it pass and couple to the rest of the rake - F.remove_rc_match("TY_CLASS_%S+") - else --this should never come into play as it means the train has entered from the wrong end somehow - atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required - F.error(true) - end -end \ No newline at end of file diff --git a/Tyard/nodes/(-4055,12,-2731).lua b/Tyard/nodes/(-4055,12,-2731).lua deleted file mode 100644 index aad7649..0000000 --- a/Tyard/nodes/(-4055,12,-2731).lua +++ /dev/null @@ -1,28 +0,0 @@ ---EOL code -local this_dir = false -- true = F.dir arrow points north - -if not F.yard_active() then return end -if atc_arrow then - if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it - if F.has_rc("TY_LAST_CLASS") then -- take the whole rake to the exit - F.remove_rc({"TY_LAST_CLASS"}) - F.add_rc({"TY_DEPART"}) - split_off_locomotive("A0B0") - elseif not F.has_rc("TY_FINAL_COLLECT") then - -- disconnect loco and return to pickup - split_off_locomotive("A0B0") - F.add_rc({"TY_PICKUP"}) - end --if has FINAL_COLLECT then don't split off the loco. take the full rake - F.add_rc({"TY_HEADSHUNT"}) - else --train needs to bounce - atc_send("B0WRD1S4") - end -else - if F.dir() == this_dir then - --train is clasifying wagons, let it pass and couple to the rest of the rake - F.remove_rc_match("TY_CLASS_%S+") - else --this should never come into play as it means the train has entered from the wrong end somehow - atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required - F.error(true) - end -end \ No newline at end of file diff --git a/Tyard/nodes/(-4056,12,-2655).lua b/Tyard/nodes/(-4056,12,-2655).lua deleted file mode 100644 index 4113ece..0000000 --- a/Tyard/nodes/(-4056,12,-2655).lua +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index edb2ef8..0000000 --- a/Tyard/nodes/(-4056,12,-2731).lua +++ /dev/null @@ -1 +0,0 @@ -F.EOL("S",7) \ No newline at end of file diff --git a/Tyard/nodes/(-4059,12,-2714).lua b/Tyard/nodes/(-4059,12,-2714).lua deleted file mode 100644 index f89a6ec..0000000 --- a/Tyard/nodes/(-4059,12,-2714).lua +++ /dev/null @@ -1 +0,0 @@ ---waiting lane -- config'd for the southbound-waiting lane -- train nose points south, using a north signal local dir = "N" local waiting_signal = "TY_WAITING_"..dir if S.yard_active then if atc_id then atc_send("B0") interrupt(10,"recheck") end else -- send train to "headshunt" if not atc_id then return end 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 -- to direct train to PICKUP lane. AROUND_dir will be set by the pickup track else --invert S.dir --working end ~= entrance end if dir == "N" then S.dir = "S" else S.dir = "N" end end set_rc("PICKUP") set_route(waiting_signal,"HEADSHUNT") atc_set_text_outside("Proceeding to Classification Yard") atc_send("S0WRS4") end \ No newline at end of file diff --git a/Tyard/nodes/(-4063,12,-2669).lua b/Tyard/nodes/(-4063,12,-2669).lua deleted file mode 100644 index 7489acc..0000000 --- a/Tyard/nodes/(-4063,12,-2669).lua +++ /dev/null @@ -1 +0,0 @@ --- \ No newline at end of file diff --git a/Tyard/nodes/(-4100,12,-2742).lua b/Tyard/nodes/(-4100,12,-2742).lua deleted file mode 100644 index 8ed965e..0000000 --- a/Tyard/nodes/(-4100,12,-2742).lua +++ /dev/null @@ -1,61 +0,0 @@ --- Headshunt Controller --- Note: may need customising due to track layout -local this_dir = false -- true = F.dir arrow points north. atc_arrow points towards yard - -if not F.yard_active() then return end - -__approach_callback_mode = 1 -if event.approach and not event.has_entered then - atc_set_ars_disable(true) - atc_set_lzb_tsr(1) - return -end - -if event.train then - if not atc_arrow then --train has entered headshunt from yard. bounce or depart - atc_set_ars_disable(true) - F.remove_rc({"TY_HEADSHUNT"}) - if not F.has_rc("TY_FINAL_COLLECT") then - if not F.has_rc("TY_DEPART") then - schedule_in(";01",atc_id) - return - else - local collect = F.get_rc_safe():match("TY_COLLECT_(%S+)") - if collect then --train needs to collect a rake from the yard before departing - F.add_rc({"TY_FINAL_COLLECT","TY_CLASS_"..collect}) - schedule_in(";01",atc_id) - return - end - end - - --else let train proceed forward to the exit controller without a rake - end --else train has already collected rake. let it exit yard - else --train has bounced - if F.has_rc("TY_AROUND") then - if this_dir == F.dir() then --send train to Classification - F.remove_rc({"TY_AROUND"}) - F.add_rc({"TY_PICKUP"}) - atc_set_ars_disable(false) - return - end --if at wrong end, do nothing. train will follow TY_AROUND ARS to relevant headshunt - end -- if doesn't have TY_AROUND then let ARS classify the train - - atc_set_ars_disable(false) - end - return -end - -if event.schedule then - if not atc_id then --bounce the train that just passed - atc_send_to_train(event.msg,"B0WRD1S3A1") - else - if atc_id == event.msg then --train hasn't fully passed yet, wait a bit longer - schedule_in(";01",atc_id) - else -- somehow another train crossed the controller before the first one returned. Unlikely but possible - atc_send_to_train(event.msg,"BBOL") - atc_send("BBOL") - F.error(true) - end - end - return -end \ No newline at end of file diff --git a/Tyard/nodes/(-4100,12,-2745).lua b/Tyard/nodes/(-4100,12,-2745).lua deleted file mode 100644 index 7f6b3e5..0000000 --- a/Tyard/nodes/(-4100,12,-2745).lua +++ /dev/null @@ -1,38 +0,0 @@ --- Yard arrival checker --- F.dir = true if entering from south - -if F.has_rc("TY_NOSHUNT") then return end - -local function enter_yard() - F.dir(true) - F.yard_active(true) - F.add_rc({"TY_ARRIVE"}) - 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_tsr(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/(-4167,12,-2742).lua b/Tyard/nodes/(-4167,12,-2742).lua deleted file mode 100644 index fe1b446..0000000 --- a/Tyard/nodes/(-4167,12,-2742).lua +++ /dev/null @@ -1,42 +0,0 @@ --- Headshunt Exit Controller -if not F.yard_active() then return end -local exit_signal = POS(-4178,15,-2742) -__approach_callback_mode = 1 -if event.approach and not event.has_entered then - atc_set_ars_disable(true) - atc_set_lzb_tsr(1) - return -end - -if event.train then - if atc_arrow then - if F.has_rc("TY_DEPART") then - print("Train departs yard to mainline at full speed") - unset_autocouple() - F.remove_rc({"TY_FINAL_COLLECT","TY_DEPART"}) - F.remove_rc_match("TY_LOCOS_%d+") - F.remove_rc_match("TY_WAGONS_%d+") - atc_set_ars_disable(false) - set_route(exit_signal,"Exit Yard") - atc_send("S6D10SM") - schedule_in(";05","deactivate_check") -- wait a little to ensure train is clear from headshunt to deactivate yard - print(F.get_rc_safe()) - return - end - else - atc_send("BBOL") - F.error(true) - end -end - -if event.schedule then - if event.msg == "deactivate_check" then - if not atc_id then - F.yard_active(false) - print("Yard Disabled") - else - schedule_in(";05","deactivate_check") - return - end - end -end \ No newline at end of file -- cgit v1.2.3