diff options
Diffstat (limited to 'auto_yards/nodes/(-2029,19,733).lua')
-rw-r--r-- | auto_yards/nodes/(-2029,19,733).lua | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/auto_yards/nodes/(-2029,19,733).lua b/auto_yards/nodes/(-2029,19,733).lua index 58ed28c..afbb94b 100644 --- a/auto_yards/nodes/(-2029,19,733).lua +++ b/auto_yards/nodes/(-2029,19,733).lua @@ -1,28 +1,36 @@ local yard_id = "ARC" + +__approach_callback_mode = 1 +if event.approach and not event.has_entered then --disable ARS for all approaching trains + atc_set_ars_disable(true) + atc_set_lzb_tsr(1) + return +end + if event.train then - -- direct train to the headshunt to reenter the yard if F.has_rc("ARC_YARD_REENTRY") then -- loco will use S23-S approach track as headshunt and re-enter yard -- RC will be removed by the headshunt controller (req to trigger it) -- manually set the route here before ARS has a chance set_route(POS(-2033,21,731),"Yard Reentry (LENGTH LIMIT)") - -- defer re-enabling ARS to ensure the route has been accepted, if not set + F.indicator(S.yards[yard_id].active_indicator_pos,false) + + -- Extract the second exit director from ARC_2nd_EXIT_x and insert if available + -- should be safe to add it now as the route has already been set to reenter the yard first + local rc = F.get_rc_safe():match("ARC_2ND_EXIT_(%S+)") + print("Second Exit RC: "..tostring(rc)) + if rc then + F.remove_rc_match("ARC_2ND_EXIT_%S+") + F.add_rc(rc) + print(F.get_rc_safe()) + end + + -- defer re-enabling ARS to ensure the route has been accepted, or at least queued atc_send("S4D1A1") - return + return end - -- deal with ARC_2nd_EXIT_rc - local rc = F.get_rc_safe():match("ARC_2ND_EXIT_(%S+)") - print(rc) - if rc then - F.remove_rc_match("ARC_2ND_EXIT_%S+") - F.add_rc(rc) - print(F.get_rc_safe()) - atc_set_ars_disable(false) - atc_send("SM") - return - end -- disregard light exit locos if F.has_rc(yard_id.."_LIGHT_EXIT") then F.remove_rc(yard_id.."_LIGHT_EXIT") |