summaryrefslogtreecommitdiff
path: root/durt/nodes
diff options
context:
space:
mode:
authorautocommitter <autocommitter@linux-forks.de>2024-04-22 14:52:14 +0200
committerautocommitter <autocommitter@linux-forks.de>2024-04-22 14:52:14 +0200
commit5f72b7ec62a6f2fb8ce6b9d5379f03a3e4126971 (patch)
tree85f5c29c1dde0bedb823aa60a48015312670396a /durt/nodes
parentc21692e0a830e434675014dd7b54736d180ce71d (diff)
downloadluaatc_envs-5f72b7ec62a6f2fb8ce6b9d5379f03a3e4126971.tar.gz
luaatc_envs-5f72b7ec62a6f2fb8ce6b9d5379f03a3e4126971.tar.bz2
luaatc_envs-5f72b7ec62a6f2fb8ce6b9d5379f03a3e4126971.zip
State at 2020-08-29
Diffstat (limited to 'durt/nodes')
-rw-r--r--durt/nodes/(-2147,20,777).lua7
-rw-r--r--durt/nodes/(-2153,20,769).lua9
-rw-r--r--durt/nodes/(-3588,8,-2277).lua2
-rw-r--r--durt/nodes/(-541,26,2469).lua1
-rw-r--r--durt/nodes/(-541,26,2472).lua1
-rw-r--r--durt/nodes/(-541,26,2475).lua1
-rw-r--r--durt/nodes/(-549,26,2478).lua1
-rw-r--r--durt/nodes/(-585,26,2478).lua1
-rw-r--r--durt/nodes/(-612,28,2482).lua1
-rw-r--r--durt/nodes/(-621,26,2469).lua1
-rw-r--r--durt/nodes/(-621,26,2472).lua1
-rw-r--r--durt/nodes/(-621,26,2475).lua1
-rw-r--r--durt/nodes/(-638,26,2475).lua1
-rw-r--r--durt/nodes/(-646,26,2469).lua6
-rw-r--r--durt/nodes/(-678,20,2478).lua2
-rw-r--r--durt/nodes/(415,17,19).lua1
-rw-r--r--durt/nodes/(527,-3,-1959).lua2
-rw-r--r--durt/nodes/(529,-3,-1954).lua2
18 files changed, 38 insertions, 3 deletions
diff --git a/durt/nodes/(-2147,20,777).lua b/durt/nodes/(-2147,20,777).lua
new file mode 100644
index 0000000..467f0f9
--- /dev/null
+++ b/durt/nodes/(-2147,20,777).lua
@@ -0,0 +1,7 @@
+if event.type == "train" then
+ rc = get_rc()
+ if rc:find("apprentice_leave") ~= nil then
+ rc = rc:gsub("apprentice_leave", "apprentice_unload")
+ end
+ set_rc(rc)
+end \ No newline at end of file
diff --git a/durt/nodes/(-2153,20,769).lua b/durt/nodes/(-2153,20,769).lua
new file mode 100644
index 0000000..27ed074
--- /dev/null
+++ b/durt/nodes/(-2153,20,769).lua
@@ -0,0 +1,9 @@
+if event.type == "train" then
+ local rc = get_rc()
+ if rc:find("apprentice_unload") ~= nil then
+ rc = rc:gsub("apprentice_unload", "apprentice_load")
+ elseif rc:find("apprentice_load") ~= nil then
+ rc = rc:gsub("apprentice_load", "apprentice_leave")
+ end
+ set_rc(rc)
+end \ No newline at end of file
diff --git a/durt/nodes/(-3588,8,-2277).lua b/durt/nodes/(-3588,8,-2277).lua
index 0858265..4e7fb2e 100644
--- a/durt/nodes/(-3588,8,-2277).lua
+++ b/durt/nodes/(-3588,8,-2277).lua
@@ -1 +1 @@
---train splitter track mainline_line = "Maverick2797_diamonds" mainline_rc = "autorun FREIGHT" text_outside = "DURT Logs to Diamonds Conversion Train" loading_stopper_sig = POS(-3594,9,-2277) split_around = function() if ((atc_speed==0) and can_set_route(loading_stopper_sig,"Shunt Around Via Loop")) then split_at_index(2,"") atc_send("S4") set_route(loading_stopper_sig,"Shunt Around Via Loop") return else interrupt(2,"split_around") return end end if event.train then if not atc_arrow then atc_send("B1S1") return end if get_rc() == "split_around" then atc_send("B0") split_around() return else --rejoined from splitting or arriving train atc_send("B0S0WD2RS1") set_line(mainline_line) set_rc(mainline_rc) atc_set_text_outside(text_outside) atc_set_text_inside("Loading Cargo") return end end if event.type=="int" then if event.message=="split_around" then split_around() return end return end \ No newline at end of file
+--train splitter track mainline_line = "Maverick2797_diamonds" mainline_rc = "autorun FREIGHT" text_outside = "DURT Logs to Diamonds Conversion Train" loading_stopper_sig = POS(-3594,9,-2277) split_around = function() if ((atc_speed==0) and can_set_route(loading_stopper_sig,"Shunt Around Via Loop")) then set_autocouple() split_at_index(2,"S0") atc_send("S4") set_route(loading_stopper_sig,"Shunt Around Via Loop") return else interrupt(2,"split_around") return end end if event.train then if not atc_arrow then atc_send("B1S1") return end if get_rc() == "split_around" then atc_send("B0") split_around() return else --rejoined from splitting or arriving train atc_send("B0S0WD2RS1") set_line(mainline_line) set_rc(mainline_rc) atc_set_text_outside(text_outside) atc_set_text_inside("Loading Cargo") unset_autocouple() return end end if event.type=="int" then if event.message=="split_around" then split_around() return end return end \ No newline at end of file
diff --git a/durt/nodes/(-541,26,2469).lua b/durt/nodes/(-541,26,2469).lua
new file mode 100644
index 0000000..ea080ea
--- /dev/null
+++ b/durt/nodes/(-541,26,2469).lua
@@ -0,0 +1 @@
+-- arrow points towards loco HS for Bounce local lane = 1 if S.yard_active then if atc_arrow and S.exiting then set_rc("EXIT") set_route("CANNERY_W"..lane, "EXIT") atc_send("B0WRD1SM") else atc_send("B0WD1RS4") end end \ No newline at end of file
diff --git a/durt/nodes/(-541,26,2472).lua b/durt/nodes/(-541,26,2472).lua
new file mode 100644
index 0000000..d5d7bd4
--- /dev/null
+++ b/durt/nodes/(-541,26,2472).lua
@@ -0,0 +1 @@
+-- arrow points towards loco HS for Bounce local lane = 2 if S.yard_active then if atc_arrow and S.exiting then set_rc("EXIT") set_route("CANNERY_W"..lane, "EXIT") atc_send("B0WRD1SM") else atc_send("B0WD1RS4") end end \ No newline at end of file
diff --git a/durt/nodes/(-541,26,2475).lua b/durt/nodes/(-541,26,2475).lua
new file mode 100644
index 0000000..58c5e8b
--- /dev/null
+++ b/durt/nodes/(-541,26,2475).lua
@@ -0,0 +1 @@
+-- arrow points towards loco HS for Bounce local lane = 3 if S.yard_active then if atc_arrow and S.exiting then set_rc("EXIT") set_route("CANNERY_W"..lane, "EXIT") atc_send("B0WRD1SM") else atc_send("B0WD1RS4") end end \ No newline at end of file
diff --git a/durt/nodes/(-549,26,2478).lua b/durt/nodes/(-549,26,2478).lua
new file mode 100644
index 0000000..90eb7a9
--- /dev/null
+++ b/durt/nodes/(-549,26,2478).lua
@@ -0,0 +1 @@
+--LOCO SPLITTER local lane = 4 if S.yard_active then if not S.first_pass then S.first_pass = true set_route("CANNERY_E"..lane,"HEADSHUNT") split_off_locomotive("B0") set_rc("AROUND") else -- has collected wagons, now bounce back to sorting splitter atc_send("B0WRD1S4") end end \ No newline at end of file
diff --git a/durt/nodes/(-585,26,2478).lua b/durt/nodes/(-585,26,2478).lua
new file mode 100644
index 0000000..23d349b
--- /dev/null
+++ b/durt/nodes/(-585,26,2478).lua
@@ -0,0 +1 @@
+--arrow points west towards working HS local lane = 4 if S.yard_active == true then if atc_arrow then set_route("CANNERY_W"..lane, "HEADSHUNT") -- turnouts should already be set by the train returning from HS local plen = train_length() local rc = split_at_fc("B0") local trc = "CAN_"..rc if plen == train_length() and (rc == "" or S.rc:match(trc)) then S.exiting = true end if rc and rc ~= "" then set_rc("CAN_"..rc) else set_rc(S.rc) S.exiting = true end end end \ No newline at end of file
diff --git a/durt/nodes/(-612,28,2482).lua b/durt/nodes/(-612,28,2482).lua
new file mode 100644
index 0000000..399a841
--- /dev/null
+++ b/durt/nodes/(-612,28,2482).lua
@@ -0,0 +1 @@
+if event.channel=="ops" or event.punch then digiline_send("lcd","Yard Active:"..tostring(S.yard_active).."\nRC:"..tostring(S.rc).."\nfirst_pass:"..tostring(S.first_pass).."\nexiting:"..tostring(S.exiting)) end \ No newline at end of file
diff --git a/durt/nodes/(-621,26,2469).lua b/durt/nodes/(-621,26,2469).lua
new file mode 100644
index 0000000..80f4e52
--- /dev/null
+++ b/durt/nodes/(-621,26,2469).lua
@@ -0,0 +1 @@
+-- arrow points towards Sorting HS for Bounce local lane = 1 if S.yard_active == true then if (atc_arrow and not S.exiting) then split_off_locomotive("B0WR") set_route("CANNERY_W"..lane,"HEADSHUNT") set_rc("PICKUP") elseif atc_arrow and S.exiting then set_route("CANNERY_W"..lane,"EXIT") end end \ No newline at end of file
diff --git a/durt/nodes/(-621,26,2472).lua b/durt/nodes/(-621,26,2472).lua
new file mode 100644
index 0000000..de4552e
--- /dev/null
+++ b/durt/nodes/(-621,26,2472).lua
@@ -0,0 +1 @@
+-- arrow points towards Sorting HS for Bounce local lane = 2 if S.yard_active == true then if (atc_arrow and not S.exiting) then split_off_locomotive("B0WR") set_route("CANNERY_W"..lane,"HEADSHUNT") set_rc("PICKUP") elseif atc_arrow and S.exiting then set_route("CANNERY_W"..lane,"EXIT") end end \ No newline at end of file
diff --git a/durt/nodes/(-621,26,2475).lua b/durt/nodes/(-621,26,2475).lua
new file mode 100644
index 0000000..35e4773
--- /dev/null
+++ b/durt/nodes/(-621,26,2475).lua
@@ -0,0 +1 @@
+-- arrow points towards Sorting HS for Bounce local lane = 3 if S.yard_active == true then if (atc_arrow and not S.exiting) then split_off_locomotive("B0WR") set_route("CANNERY_W"..lane,"HEADSHUNT") set_rc("PICKUP") elseif atc_arrow and S.exiting then set_route("CANNERY_W"..lane,"EXIT") end end \ No newline at end of file
diff --git a/durt/nodes/(-638,26,2475).lua b/durt/nodes/(-638,26,2475).lua
new file mode 100644
index 0000000..2b808a1
--- /dev/null
+++ b/durt/nodes/(-638,26,2475).lua
@@ -0,0 +1 @@
+--Yard Exit --arrow points away from yard if S.yard_active == true then if atc_arrow then --exiting yard after shunt sequence set_rc(S.rc) S.yard_active = nil S.rc = nil S.first_pass = nil S.exiting = nil unset_autocouple() end end \ No newline at end of file
diff --git a/durt/nodes/(-646,26,2469).lua b/durt/nodes/(-646,26,2469).lua
new file mode 100644
index 0000000..1158ddb
--- /dev/null
+++ b/durt/nodes/(-646,26,2469).lua
@@ -0,0 +1,6 @@
+--
+if S.yard_active then
+ if atc_arrow then
+ set_autocouple()
+ end
+end \ No newline at end of file
diff --git a/durt/nodes/(-678,20,2478).lua b/durt/nodes/(-678,20,2478).lua
new file mode 100644
index 0000000..7b0b847
--- /dev/null
+++ b/durt/nodes/(-678,20,2478).lua
@@ -0,0 +1,2 @@
+-- approach siding atc_send("B0") if S.yard_active then interrupt(10, "recheck") else atc_send("S4") S.rc = get_rc() step_fc() S.yard_active = true set_route("CANNERY_WAITING", "APPROACH YARD")
+set_route("CANNERY_APPROACH","PICKUP") end \ No newline at end of file
diff --git a/durt/nodes/(415,17,19).lua b/durt/nodes/(415,17,19).lua
new file mode 100644
index 0000000..be6f093
--- /dev/null
+++ b/durt/nodes/(415,17,19).lua
@@ -0,0 +1 @@
+if event.punch or (event.channel=="clock" and event.msg=="pulse")then local line = "U21" local info = S.lines[line].monitoring digiline_send("status_update",info) end \ No newline at end of file
diff --git a/durt/nodes/(527,-3,-1959).lua b/durt/nodes/(527,-3,-1959).lua
index f137323..e7213ad 100644
--- a/durt/nodes/(527,-3,-1959).lua
+++ b/durt/nodes/(527,-3,-1959).lua
@@ -5,7 +5,7 @@ if atc_arrow then
atc_set_text_inside("DEPOT")
else
atc_send("SM")
- set_line("1")
+ set_line("21")
atc_set_text_outside("Line 21\n---> South Forest")
atc_set_text_inside("Next stop: Bamboo Hills")
end \ No newline at end of file
diff --git a/durt/nodes/(529,-3,-1954).lua b/durt/nodes/(529,-3,-1954).lua
index da5fd9f..f734da7 100644
--- a/durt/nodes/(529,-3,-1954).lua
+++ b/durt/nodes/(529,-3,-1954).lua
@@ -1,6 +1,6 @@
if atc_arrow then
atc_send("SM")
- set_line("1")
+ set_line("21")
atc_set_text_outside("Line 21\n---> Turtle Rock")
atc_set_text_inside("Next stop: Clown Island")
else