diff options
-rw-r--r-- | durt/init_code.lua | 12 | ||||
-rw-r--r-- | durt/nodes/(-4129,13,-5726).lua | 28 | ||||
-rw-r--r-- | durt/nodes/(-4129,16,-5802).lua | 4 | ||||
-rw-r--r-- | durt/nodes/(-4135,16,-5809).lua | 27 | ||||
-rw-r--r-- | durt/nodes/(-4142,17,-5841).lua | 17 | ||||
-rw-r--r-- | durt/nodes/(-4144,16,-5792).lua | 5 | ||||
-rw-r--r-- | durt/nodes/(-4147,19,-5792).lua | 3 |
7 files changed, 87 insertions, 9 deletions
diff --git a/durt/init_code.lua b/durt/init_code.lua index 625353a..aa7e821 100644 --- a/durt/init_code.lua +++ b/durt/init_code.lua @@ -254,7 +254,7 @@ F.remove_rc = function(rc_list,arrow_mode) -- false: against arrow direction -- nil: ignores arrow direction - if not event.train then return end + 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 {} @@ -263,7 +263,6 @@ F.remove_rc = function(rc_list,arrow_mode) 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 @@ -277,6 +276,15 @@ F.remove_rc = function(rc_list,arrow_mode) return reinsert end +F.add_rc = function(rc_list) + 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 + F.yard_road_count = function(yard,section_id,monitoring_light) if not S.yards[yard][section_id] then S.yards[yard][section_id] = {['car_count'] = 0} end diff --git a/durt/nodes/(-4129,13,-5726).lua b/durt/nodes/(-4129,13,-5726).lua new file mode 100644 index 0000000..2f179db --- /dev/null +++ b/durt/nodes/(-4129,13,-5726).lua @@ -0,0 +1,28 @@ +if event.train then + if atc_arrow then + if F.has_rc("DLG_exit_north") then + F.remove_rc({"DLG_exit_north"}) + return + end + if F.has_rc("DLG_north_reverse") then + schedule_in(";01",atc_id) + return + end + else + if F.has_rc("DLG_north_reverse_couple") then + atc_send("CplD1S2") + return + end + end +end + + +if event.schedule then + if event.msg == atc_id then + schedule_in(";01",event.msg) + return + else + atc_send_to_train(event.msg,"S0WRS3") + return + end +end
\ No newline at end of file diff --git a/durt/nodes/(-4129,16,-5802).lua b/durt/nodes/(-4129,16,-5802).lua index e0cacb0..2e1142d 100644 --- a/durt/nodes/(-4129,16,-5802).lua +++ b/durt/nodes/(-4129,16,-5802).lua @@ -17,10 +17,10 @@ if event.train then atc_send("S3") atc_set_ars_disable(false) setstate(split_indicator,"green") - set_rc((get_rc() or "").." DLG_headshunt_south DLG_around_short DLG_shunt_platforms DLG_shunt_Platform2") + set_rc((get_rc() or "").." DLG_south_reverse DLG_around_short DLG_north_reverse DLG_shunt_platforms DLG_shunt_Platform2") elseif state == "green" then atc_send("B0WROCA1D2S4D10SM") setstate(split_indicator,"red") - F.remove_rc({"DLG_headshunt_south","DLG_around_short","DLG_shunt_platforms","DLG_shunt_Platform2"}) + F.remove_rc({"DLG_south_reverse","DLG_around_long","DLG_north_reverse","DLG_shunt_platforms","DLG_shunt_Platform2"}) end end
\ No newline at end of file diff --git a/durt/nodes/(-4135,16,-5809).lua b/durt/nodes/(-4135,16,-5809).lua new file mode 100644 index 0000000..28ae5f2 --- /dev/null +++ b/durt/nodes/(-4135,16,-5809).lua @@ -0,0 +1,27 @@ +local split_indicator = POS(-4134,17,-5811) +__approach_callback_mode = 1 + +if event.approach and not event.has_entered then + if not F.has_rc("DLG_ArcRun") then return end + + atc_set_ars_disable(true) + atc_set_lzb_tsr(1) +end + +if event.train then + if not F.has_rc("DLG_ArcRun") then return end + if not atc_arrow then return end + local state = getstate(split_indicator) + if state == "red" then + split_off_locomotive("A0B0OL",1) + atc_send("S3") + atc_set_ars_disable(false) + setstate(split_indicator,"green") + set_rc(F.get_rc_safe().." DLG_south_reverse DLG_around_long DLG_north_reverse DLG_north_reverse_couple DLG_shunt_platforms DLG_shunt_Freight2") + elseif state == "green" then + atc_send("B0WROCA1D2S4") + setstate(split_indicator,"red") + F.remove_rc({"DLG_south_reverse","DLG_around_long","DLG_north_reverse_couple","DLG_shunt_Freight2"}) + set_rc(F.get_rc_safe().." DLG_shunt_Freight4") + end +end
\ No newline at end of file diff --git a/durt/nodes/(-4142,17,-5841).lua b/durt/nodes/(-4142,17,-5841).lua index 8d26b0c..24270e4 100644 --- a/durt/nodes/(-4142,17,-5841).lua +++ b/durt/nodes/(-4142,17,-5841).lua @@ -1,11 +1,18 @@ -if event.train and atc_arrow then - local rc = get_rc() or "" - if rc:match("DLG_headshunt_south") then - schedule_in(";01",atc_id) - return +if event.train then + if atc_arrow then + if F.has_rc("DLG_south_reverse") then + schedule_in(";01",atc_id) + return + end + else + if F.has_rc("DLG_south_reverse_couple") then + atc_send("CplD1S2") + return + end end end + if event.schedule then if event.msg == atc_id then schedule_in(";01",event.msg) diff --git a/durt/nodes/(-4144,16,-5792).lua b/durt/nodes/(-4144,16,-5792).lua new file mode 100644 index 0000000..5bfe7a1 --- /dev/null +++ b/durt/nodes/(-4144,16,-5792).lua @@ -0,0 +1,5 @@ +if event.ext_int then + F.remove_rc({"DLG_north_reverse","DLG_shunt_platforms","DLG_shunt_Freight4"}) + F.add_rc("DLG_exit_north") + atc_send("I-S0WR;S4D10SM") +end diff --git a/durt/nodes/(-4147,19,-5792).lua b/durt/nodes/(-4147,19,-5792).lua new file mode 100644 index 0000000..c53ad9d --- /dev/null +++ b/durt/nodes/(-4147,19,-5792).lua @@ -0,0 +1,3 @@ +local track = POS(-4144,16,-5792) +local message = "ArcRun" +if event.punch then interrupt_pos(track,message) end
\ No newline at end of file |