From dd021c155983d19fed0704976e85b060180a4c37 Mon Sep 17 00:00:00 2001 From: autocommitter Date: Mon, 22 Apr 2024 14:57:17 +0200 Subject: State at 2022-05-15 --- durt/init_code.lua | 19 ------------ durt/nodes/(-2354,15,-1327).lua | 68 +++++++++++++++++++++++++++++++++++++++++ durt/nodes/(-2356,15,-1361).lua | 68 +++++++++++++++++++++++++++++++++++++++++ durt/nodes/(-2364,15,-1360).lua | 46 ++++++++++++++++++++++++++++ durt/nodes/(-2365,15,-1333).lua | 46 ++++++++++++++++++++++++++++ 5 files changed, 228 insertions(+), 19 deletions(-) create mode 100644 durt/nodes/(-2354,15,-1327).lua create mode 100644 durt/nodes/(-2356,15,-1361).lua create mode 100644 durt/nodes/(-2364,15,-1360).lua create mode 100644 durt/nodes/(-2365,15,-1333).lua diff --git a/durt/init_code.lua b/durt/init_code.lua index 82ac61e..0b60d52 100644 --- a/durt/init_code.lua +++ b/durt/init_code.lua @@ -204,25 +204,6 @@ S.runarounds = { --------------------------------------------------------------------- --- M27 Tracking -S.M27_tracking = {} --- tracks for the above table are located at --- -4003,12,-2766 Between Alieane and Trojan --- -3766,15,-3562 EV_Beach<->Sinensis --- -3592,18,-3907 Sinensis<->Willow Tunnel --- -3602,18,-3961 Willow Tunnel <-> Djnc --- -3602.18.-3961 Djnc<->Dcaves --- -2345,15,-1336 Tanh Depot --- -1986,13,-1699 x2 Foundry entry - -F.M27_tracking = function(id) - if not event.train then return end - local rc = get_rc() or "" - if not rc:match("M27_tracking") then return end - S.M27_tracking.last = S.M27_tracking.now - S.M27_tracking.now = id -end - --Atlac Yard Operations if event.init then local list_of_yards = { diff --git a/durt/nodes/(-2354,15,-1327).lua b/durt/nodes/(-2354,15,-1327).lua new file mode 100644 index 0000000..993387a --- /dev/null +++ b/durt/nodes/(-2354,15,-1327).lua @@ -0,0 +1,68 @@ +local pts = { + north={ + pos=POS(-2358,15,-1329), + lined="st" + }, + south={ + pos=POS(-2358,15,-1361), + lined="st" + }, +} +local set_dir = function(dir) + for _,v in pairs(pts) do + setstate(v.pos,(dir==((true and v.lined=="st") or false) and "st" or "cr")) + end +end + +__approach_callback_mode = 2 +if event.approach and not event.has_entered then + atc_set_lzb_tsr(2) + atc_set_ars_disable(true) + return +end + +if event.train then + if not F.has_rc("TANH_REV") then + atc_set_ars_disable(false) + return + end + + if F.has_rc("TANH_REV_active") then + if not atc_arrow then + if F.has_rc("TANH_REV_loop") then + F.remove_rc({"TANH_REV_loop"}) + set_dir(true) + else + F.add_rc("TANH_REV_loop") + set_dir(false) + end + return + end + + set_autocouple() + schedule_in(";01",atc_id) + return + elseif F.has_rc("TANH_REV_exit") then + atc_set_ars_disable(false) + unset_autocouple() + F.remove_rc({"TANH_REV_exit"}) + return + else + set_dir(true) + return + end +end + +if event.schedule then + if event.msg == atc_id then + schedule_in(";01",atc_id) + return + elseif not atc_id then + set_dir(false) + atc_send_to_train(event.msg,"D1S0WRD1S2") + else + atc_send("BB") + atc_send_to_train("BB") + return + end +end \ No newline at end of file diff --git a/durt/nodes/(-2356,15,-1361).lua b/durt/nodes/(-2356,15,-1361).lua new file mode 100644 index 0000000..993387a --- /dev/null +++ b/durt/nodes/(-2356,15,-1361).lua @@ -0,0 +1,68 @@ +local pts = { + north={ + pos=POS(-2358,15,-1329), + lined="st" + }, + south={ + pos=POS(-2358,15,-1361), + lined="st" + }, +} +local set_dir = function(dir) + for _,v in pairs(pts) do + setstate(v.pos,(dir==((true and v.lined=="st") or false) and "st" or "cr")) + end +end + +__approach_callback_mode = 2 +if event.approach and not event.has_entered then + atc_set_lzb_tsr(2) + atc_set_ars_disable(true) + return +end + +if event.train then + if not F.has_rc("TANH_REV") then + atc_set_ars_disable(false) + return + end + + if F.has_rc("TANH_REV_active") then + if not atc_arrow then + if F.has_rc("TANH_REV_loop") then + F.remove_rc({"TANH_REV_loop"}) + set_dir(true) + else + F.add_rc("TANH_REV_loop") + set_dir(false) + end + return + end + + set_autocouple() + schedule_in(";01",atc_id) + return + elseif F.has_rc("TANH_REV_exit") then + atc_set_ars_disable(false) + unset_autocouple() + F.remove_rc({"TANH_REV_exit"}) + return + else + set_dir(true) + return + end +end + +if event.schedule then + if event.msg == atc_id then + schedule_in(";01",atc_id) + return + elseif not atc_id then + set_dir(false) + atc_send_to_train(event.msg,"D1S0WRD1S2") + else + atc_send("BB") + atc_send_to_train("BB") + return + end +end \ No newline at end of file diff --git a/durt/nodes/(-2364,15,-1360).lua b/durt/nodes/(-2364,15,-1360).lua new file mode 100644 index 0000000..9abfaad --- /dev/null +++ b/durt/nodes/(-2364,15,-1360).lua @@ -0,0 +1,46 @@ +local pts = { + north={ + pos=POS(-2358,15,-1329), + lined="st" + }, + south={ + pos=POS(-2358,15,-1361), + lined="st" + }, +} +local set_dir = function(dir) + for _,v in pairs(pts) do + setstate(v.pos,(dir==((true and v.lined=="st") or false) and "st" or "cr")) + end +end +__approach_callback_mode = 2 +if event.approach and not event.has_entered then + atc_set_lzb_tsr(2) + atc_set_ars_disable(true) + return +end + +if event.train then + if not F.has_rc("TANH_REV") then + atc_set_ars_disable(false) + return + end + if not F.has_rc("TANH_REV_active") then + if not atc_arrow then + atc_send("S2") + return + end + if F.has_rc("TANH_REV_exit") then return end + F.add_rc("TANH_REV_active") + split_off_locomotive("B0",3) + atc_send("S2") + set_dir(true) + return + else + if not atc_arrow then return end + F.remove_rc({"TANH_REV_active"}) + F.add_rc("TANH_REV_exit") + atc_send("B0WRD1S5D5SM") + return + end +end \ No newline at end of file diff --git a/durt/nodes/(-2365,15,-1333).lua b/durt/nodes/(-2365,15,-1333).lua new file mode 100644 index 0000000..9abfaad --- /dev/null +++ b/durt/nodes/(-2365,15,-1333).lua @@ -0,0 +1,46 @@ +local pts = { + north={ + pos=POS(-2358,15,-1329), + lined="st" + }, + south={ + pos=POS(-2358,15,-1361), + lined="st" + }, +} +local set_dir = function(dir) + for _,v in pairs(pts) do + setstate(v.pos,(dir==((true and v.lined=="st") or false) and "st" or "cr")) + end +end +__approach_callback_mode = 2 +if event.approach and not event.has_entered then + atc_set_lzb_tsr(2) + atc_set_ars_disable(true) + return +end + +if event.train then + if not F.has_rc("TANH_REV") then + atc_set_ars_disable(false) + return + end + if not F.has_rc("TANH_REV_active") then + if not atc_arrow then + atc_send("S2") + return + end + if F.has_rc("TANH_REV_exit") then return end + F.add_rc("TANH_REV_active") + split_off_locomotive("B0",3) + atc_send("S2") + set_dir(true) + return + else + if not atc_arrow then return end + F.remove_rc({"TANH_REV_active"}) + F.add_rc("TANH_REV_exit") + atc_send("B0WRD1S5D5SM") + return + end +end \ No newline at end of file -- cgit v1.2.3