diff options
author | autocommitter <autocommitter@linux-forks.de> | 2024-11-03 00:00:02 +0100 |
---|---|---|
committer | autocommitter <autocommitter@linux-forks.de> | 2024-11-03 00:00:02 +0100 |
commit | 34fe0d5ffd14919fdb9495e45cfca294b248eefb (patch) | |
tree | b2bf1918d24e8b8adf4a5188d22bb5d12d9b297c | |
parent | 91cc36ecd4e2c68040642dbaf0b0dc46106df61c (diff) | |
download | luaatc_envs-34fe0d5ffd14919fdb9495e45cfca294b248eefb.tar.gz luaatc_envs-34fe0d5ffd14919fdb9495e45cfca294b248eefb.tar.bz2 luaatc_envs-34fe0d5ffd14919fdb9495e45cfca294b248eefb.zip |
State at 2024-11-03
-rw-r--r-- | auto_yards/nodes/(-524,26,2481).lua | 2 | ||||
-rw-r--r-- | auto_yards/nodes/(-586,26,2504).lua | 42 | ||||
-rw-r--r-- | auto_yards/nodes/(-588,26,2504).lua | 27 | ||||
-rw-r--r-- | auto_yards/nodes/(-590,26,2504).lua | 42 | ||||
-rw-r--r-- | auto_yards/nodes/(-590,26,2534).lua (renamed from auto_yards/nodes/(-588,26,2534).lua) | 0 | ||||
-rw-r--r-- | auto_yards/nodes/(-630,26,2454).lua | 14 | ||||
-rw-r--r-- | durt/nodes/(-4125,13,-5731).lua | 9 | ||||
-rw-r--r-- | durt/nodes/(-4181,13,-5787).lua | 16 | ||||
-rw-r--r-- | durt/nodes/(-4197,13,-5781).lua | 7 | ||||
-rw-r--r-- | durt/nodes/(-4197,13,-5784).lua | 7 | ||||
-rw-r--r-- | durt/nodes/(-4197,13,-5787).lua | 7 | ||||
-rw-r--r-- | durt/nodes/(-4197,13,-5790).lua | 7 | ||||
-rw-r--r-- | durt/nodes/(-743,18,2424).lua | 1 | ||||
-rw-r--r-- | ywang/nodes/(-586,26,2534).lua | 3 |
14 files changed, 148 insertions, 36 deletions
diff --git a/auto_yards/nodes/(-524,26,2481).lua b/auto_yards/nodes/(-524,26,2481).lua index e119505..fb7f7a6 100644 --- a/auto_yards/nodes/(-524,26,2481).lua +++ b/auto_yards/nodes/(-524,26,2481).lua @@ -1,3 +1,3 @@ -if F.has_rc("CAN_INTRA_SHUFFLE") then atc_send("S0WD2RS2") return end +if F.has_rc("CAN_INTRA_SHUFFLE") then atc_send("S0WD2A0RS2") return end -- EOL F.lane_EOL("CAN",false)
\ No newline at end of file diff --git a/auto_yards/nodes/(-586,26,2504).lua b/auto_yards/nodes/(-586,26,2504).lua new file mode 100644 index 0000000..0823436 --- /dev/null +++ b/auto_yards/nodes/(-586,26,2504).lua @@ -0,0 +1,42 @@ +-- Cannery Dirt Loading Lane Modified +local sand_indicator = POS(-572,26,2515) --sand indicator + +if F.has_rc("CAN_INTRA_SHUFFLE") then + if not atc_arrow then return end + if F.has_rc("CAN_CLASS_DIRT_UNLOAD") then -- remove wagons, step the fc, move wagons to sand loading + F.remove_rc("CAN_CLASS_DIRT_UNLOAD") + F.add_rc({ + "CAN_HS_W", + "CAN_CLASS_SAND_LOAD", + "CAN_FROM_DIRT" + }) + step_fc() + return + end + if F.has_rc("CAN_FROM_DIRT") then --leave wagons and return to locostore, shutting down the yard as we go + F.remove_rc({ + "CAN_CLASS_SAND_LOAD", + "CAN_FROM_DIRT" + }) + split_off_locomotive("A0B0") + F.add_rc({ + "CAN_HS_W", + "CAN_send_to_locostore" + }) + F.indicator(sand_indicator, false) --ensure the sand indicator is off to allow the wagons to load + F.indicator(ind,true) --re-enable the notification as we haven't actually left the yard yet + F.indicator(S.yards.CAN.active_indicator_pos, false) -- disable the active indicator + return + end + if F.has_rc("CAN_CLASS_SAND_LOAD") then -- remove wagons, step the fc, move wagons to departures + F.remove_rc("CAN_CLASS_SAND_LOAD") + F.add_rc({ + "CAN_HS_W", --departures track has Cpl function built in + "CAN_CLASS_DEPARTURES" + }) + step_fc() + return + end + return +end +F.lane_EOL("CAN",true)
\ No newline at end of file diff --git a/auto_yards/nodes/(-588,26,2504).lua b/auto_yards/nodes/(-588,26,2504).lua deleted file mode 100644 index 5382804..0000000 --- a/auto_yards/nodes/(-588,26,2504).lua +++ /dev/null @@ -1,27 +0,0 @@ --- Cannery Dirt Loading Lane Modified -local sand_indicator = POS(-572,26,2515) --sand indicator - -if F.has_rc("CAN_INTRA_SHUFFLE") then - if not atc_arrow then return end - if F.has_rc("CAN_CLASS_DIRT_UNLOAD") then -- remove wagons, step the fc, return the wagons - F.remove_rc("CAN_CLASS_DIRT_UNLOAD") - F.add_rc({ - "CAN_HS_W", - "CAN_CLASS_SAND_LOAD" - }) - step_fc() - return - end - if F.has_rc("CAN_CLASS_SAND_LOAD") then -- remove wagons, step the fc, move wagons to departures - F.remove_rc("CAN_CLASS_SAND_LOAD") - F.add_rc({ - "CAN_HS_W", --departures track has Cpl function built in - "CAN_CLASS_DEPARTURES" - }) - step_fc() - F.indicator(sand_indicator, false) - return - end - return -end -F.lane_EOL("CAN",true)
\ No newline at end of file diff --git a/auto_yards/nodes/(-590,26,2504).lua b/auto_yards/nodes/(-590,26,2504).lua new file mode 100644 index 0000000..0823436 --- /dev/null +++ b/auto_yards/nodes/(-590,26,2504).lua @@ -0,0 +1,42 @@ +-- Cannery Dirt Loading Lane Modified +local sand_indicator = POS(-572,26,2515) --sand indicator + +if F.has_rc("CAN_INTRA_SHUFFLE") then + if not atc_arrow then return end + if F.has_rc("CAN_CLASS_DIRT_UNLOAD") then -- remove wagons, step the fc, move wagons to sand loading + F.remove_rc("CAN_CLASS_DIRT_UNLOAD") + F.add_rc({ + "CAN_HS_W", + "CAN_CLASS_SAND_LOAD", + "CAN_FROM_DIRT" + }) + step_fc() + return + end + if F.has_rc("CAN_FROM_DIRT") then --leave wagons and return to locostore, shutting down the yard as we go + F.remove_rc({ + "CAN_CLASS_SAND_LOAD", + "CAN_FROM_DIRT" + }) + split_off_locomotive("A0B0") + F.add_rc({ + "CAN_HS_W", + "CAN_send_to_locostore" + }) + F.indicator(sand_indicator, false) --ensure the sand indicator is off to allow the wagons to load + F.indicator(ind,true) --re-enable the notification as we haven't actually left the yard yet + F.indicator(S.yards.CAN.active_indicator_pos, false) -- disable the active indicator + return + end + if F.has_rc("CAN_CLASS_SAND_LOAD") then -- remove wagons, step the fc, move wagons to departures + F.remove_rc("CAN_CLASS_SAND_LOAD") + F.add_rc({ + "CAN_HS_W", --departures track has Cpl function built in + "CAN_CLASS_DEPARTURES" + }) + step_fc() + return + end + return +end +F.lane_EOL("CAN",true)
\ No newline at end of file diff --git a/auto_yards/nodes/(-588,26,2534).lua b/auto_yards/nodes/(-590,26,2534).lua index d783815..d783815 100644 --- a/auto_yards/nodes/(-588,26,2534).lua +++ b/auto_yards/nodes/(-590,26,2534).lua diff --git a/auto_yards/nodes/(-630,26,2454).lua b/auto_yards/nodes/(-630,26,2454).lua index 8dd1ff7..4e69484 100644 --- a/auto_yards/nodes/(-630,26,2454).lua +++ b/auto_yards/nodes/(-630,26,2454).lua @@ -5,7 +5,8 @@ local sand_indicator = POS(-572,26,2515) --sand indicator local print_notification = true local sections = { - clay_factory = "327479", + sand_loading = "199126", + dirt_unloading = "541313", departures = "484515" } @@ -28,9 +29,13 @@ local function send_train() "CANNERY", "CAN_COLLECT_DEPARTURES" } - if section_occupancy(sections.clay_factory)[1] and F.indicator(sand_indicator) then - -- step the dirt wagons forward into sand wagons - print("Reshuffling sand export before departure") + if section_occupancy(sections.sand_loading)[1] and F.indicator(sand_indicator) then -- move the loaded sand wagons to the departures track when requested + base_rc[#base_rc+1] = "CAN_INTRA_SHUFFLE" + base_rc[#base_rc+1] = "CAN_HS_W" + base_rc[#base_rc+1] = "CAN_HS_W_AC" + base_rc[#base_rc+1] = "CAN_CLASS_SAND_LOAD" + F.indicator(S.yards.CAN.active_indicator_pos, true) --activate the yard to prevent other trains entering while we're moving around + elseif section_occupancy(sections.dirt_unloading)[1] and not section_occupancy(sections.sand_loading)[1] then -- move the unloaded dirt wagons to the sand track if there's room base_rc[#base_rc+1] = "CAN_INTRA_SHUFFLE" base_rc[#base_rc+1] = "CAN_HS_W" base_rc[#base_rc+1] = "CAN_HS_W_AC" @@ -38,6 +43,7 @@ local function send_train() F.indicator(S.yards.CAN.active_indicator_pos, true) --activate the yard to prevent other trains entering while we're moving around elseif section_occupancy(sections.departures)[1] then --collect departures wagons before departing proper base_rc[#base_rc+1] = "CAN_REENTER_YARD" + F.indicator(ind, false) print("Collecting Departures") else base_rc[#base_rc+1] = "CAN_LIGHT_EXIT" diff --git a/durt/nodes/(-4125,13,-5731).lua b/durt/nodes/(-4125,13,-5731).lua index c3fcc71..3a8d669 100644 --- a/durt/nodes/(-4125,13,-5731).lua +++ b/durt/nodes/(-4125,13,-5731).lua @@ -1,4 +1,5 @@ -- Automatic bouncer for headshunts, assuming longer headshunt than train length. Arrow points into headshunt +-- Modified to bounce all trains. RC Removal still works though local rev_rc = "DLG_HS_N" local rm_rc = true local autocouple = "DLG_HS_N_AC" @@ -26,10 +27,10 @@ if event.train then return end - if not F.has_rc(rev_rc) then --not our train. disregard - atc_set_ars_disable(false) - return - end +-- if not F.has_rc(rev_rc) then --not our train. disregard +-- atc_set_ars_disable(false) +-- return +-- end if rm_rc then F.remove_rc({rev_rc}) end schedule_in(";01",atc_id) return diff --git a/durt/nodes/(-4181,13,-5787).lua b/durt/nodes/(-4181,13,-5787).lua new file mode 100644 index 0000000..15a77da --- /dev/null +++ b/durt/nodes/(-4181,13,-5787).lua @@ -0,0 +1,16 @@ +if not atc_arrow then return end +if F.has_rc("COLLECT") then atc_send("B2CplS2") return end +local options = { + {route = "SHUNT Centre", section = "250710"}, + {route = "SHUNT Right", section = "403524"}, + {route = "SHUNT Left", section = "779419"}, + {route = "SHUNT Far Right", section = "810627"}, +} +for _,v in ipairs(options) do + if not section_occupancy(v.section)[1] then + set_route(POS(-4183,13,-5788),v.route) + atc_set_ars_disable(true) + return + end +end +print("No automatic routes available. Check manually")
\ No newline at end of file diff --git a/durt/nodes/(-4197,13,-5781).lua b/durt/nodes/(-4197,13,-5781).lua new file mode 100644 index 0000000..4f3ca65 --- /dev/null +++ b/durt/nodes/(-4197,13,-5781).lua @@ -0,0 +1,7 @@ +if atc_arrow then + if not F.has_rc("COLLECT") then + split_off_locomotive("A0B0") + end + atc_set_ars_disable(false) + return +end
\ No newline at end of file diff --git a/durt/nodes/(-4197,13,-5784).lua b/durt/nodes/(-4197,13,-5784).lua new file mode 100644 index 0000000..4f3ca65 --- /dev/null +++ b/durt/nodes/(-4197,13,-5784).lua @@ -0,0 +1,7 @@ +if atc_arrow then + if not F.has_rc("COLLECT") then + split_off_locomotive("A0B0") + end + atc_set_ars_disable(false) + return +end
\ No newline at end of file diff --git a/durt/nodes/(-4197,13,-5787).lua b/durt/nodes/(-4197,13,-5787).lua new file mode 100644 index 0000000..4f3ca65 --- /dev/null +++ b/durt/nodes/(-4197,13,-5787).lua @@ -0,0 +1,7 @@ +if atc_arrow then + if not F.has_rc("COLLECT") then + split_off_locomotive("A0B0") + end + atc_set_ars_disable(false) + return +end
\ No newline at end of file diff --git a/durt/nodes/(-4197,13,-5790).lua b/durt/nodes/(-4197,13,-5790).lua new file mode 100644 index 0000000..4f3ca65 --- /dev/null +++ b/durt/nodes/(-4197,13,-5790).lua @@ -0,0 +1,7 @@ +if atc_arrow then + if not F.has_rc("COLLECT") then + split_off_locomotive("A0B0") + end + atc_set_ars_disable(false) + return +end
\ No newline at end of file diff --git a/durt/nodes/(-743,18,2424).lua b/durt/nodes/(-743,18,2424).lua index d922a42..3c5008c 100644 --- a/durt/nodes/(-743,18,2424).lua +++ b/durt/nodes/(-743,18,2424).lua @@ -27,6 +27,7 @@ if event.train then return end if rm_rc then F.remove_rc({rev_rc}) end + atc_send("S3") schedule_in(";01",atc_id) return end diff --git a/ywang/nodes/(-586,26,2534).lua b/ywang/nodes/(-586,26,2534).lua new file mode 100644 index 0000000..d783815 --- /dev/null +++ b/ywang/nodes/(-586,26,2534).lua @@ -0,0 +1,3 @@ +if F.has_rc("CAN_INTRA_SHUFFLE") then atc_send("A0S0WRD5S3A1") return end +-- EOL +F.lane_EOL("CAN",false)
\ No newline at end of file |