summaryrefslogtreecommitdiff
path: root/durt
diff options
context:
space:
mode:
Diffstat (limited to 'durt')
-rw-r--r--durt/nodes/(-1199,13,-2147).lua1
-rw-r--r--durt/nodes/(-1264,10,-2366).lua1
-rw-r--r--durt/nodes/(-1267,10,-2395).lua1
-rw-r--r--durt/nodes/(-1549,11,-2597).lua1
-rw-r--r--durt/nodes/(-1552,11,-2628).lua1
-rw-r--r--durt/nodes/(-1941,13,-2752).lua1
-rw-r--r--durt/nodes/(1865,17,9141).lua2
7 files changed, 7 insertions, 1 deletions
diff --git a/durt/nodes/(-1199,13,-2147).lua b/durt/nodes/(-1199,13,-2147).lua
new file mode 100644
index 0000000..ef42fb4
--- /dev/null
+++ b/durt/nodes/(-1199,13,-2147).lua
@@ -0,0 +1 @@
+if get_line() ~= "MGGR" then return end local stop_delay = "05;00" --5 minutes __approach_callback_mode = 1 if event.approach and not event.has_entered then atc_set_ars_disable(true) atc_set_lzb_tsr(2) atc_set_text_inside("Arriving at: Mom Junction West (TERMINUS)\n".. "Change Here for: E1, E10, S23") end if event.train then atc_send("B0 W OR") atc_set_text_outside("MGGR to Hawking Memorial") schedule_in(stop_delay,"depart") end if event.schedule then if event.msg == "depart" then atc_send("OC D1 R SM") atc_set_text_inside("".. "~~~~---~~~========~~~---~~~~\n".. "Manaugh Great Griefing Railway\n".. "~~~~---~~~========~~~---~~~~") atc_set_ars_disable(false) return end end \ No newline at end of file
diff --git a/durt/nodes/(-1264,10,-2366).lua b/durt/nodes/(-1264,10,-2366).lua
new file mode 100644
index 0000000..dfa8179
--- /dev/null
+++ b/durt/nodes/(-1264,10,-2366).lua
@@ -0,0 +1 @@
+if event.train then if get_line() ~= "MGGR" then return end end local stop_delay = "01;00" --1 minutes __approach_callback_mode = 1 if event.approach and not event.has_entered then atc_set_ars_disable(true) atc_set_lzb_tsr(2) atc_set_text_inside("Arriving at: Shroomsbury") end if event.train then atc_send("B0 W OR") atc_set_text_outside("MGGR to Mom Junction West") schedule_in(stop_delay,"depart") end if event.schedule then if event.msg == "depart" then atc_send("OC SM") atc_set_text_inside("".. "~~~~---~~~========~~~---~~~~\n".. "Manaugh Great Griefing Railway\n".. "~~~~---~~~========~~~---~~~~") atc_set_ars_disable(false) return end end \ No newline at end of file
diff --git a/durt/nodes/(-1267,10,-2395).lua b/durt/nodes/(-1267,10,-2395).lua
new file mode 100644
index 0000000..d6992ab
--- /dev/null
+++ b/durt/nodes/(-1267,10,-2395).lua
@@ -0,0 +1 @@
+if get_line() ~= "MGGR" then return end local stop_delay = "01;00" --1 minute __approach_callback_mode = 1 if event.approach and not event.has_entered then atc_set_ars_disable(true) atc_set_lzb_tsr(2) atc_set_text_inside("Arriving at: Shroomsbury") end if event.train then atc_send("B0 W OR") atc_set_text_outside("MGGR to Hawking Memorial") schedule_in(stop_delay,"depart") end if event.schedule then if event.msg == "depart" then atc_send("OC SM") atc_set_text_inside("".. "~~~~---~~~========~~~---~~~~\n".. "Manaugh Great Griefing Railway\n".. "~~~~---~~~========~~~---~~~~") atc_set_ars_disable(false) return end end \ No newline at end of file
diff --git a/durt/nodes/(-1549,11,-2597).lua b/durt/nodes/(-1549,11,-2597).lua
new file mode 100644
index 0000000..2de1cca
--- /dev/null
+++ b/durt/nodes/(-1549,11,-2597).lua
@@ -0,0 +1 @@
+if event.train then if get_line() ~= "MGGR" then return end end local stop_delay = "01;00" --1 minutes __approach_callback_mode = 1 if event.approach and not event.has_entered then atc_set_ars_disable(true) atc_set_lzb_tsr(1) atc_set_text_inside("Arriving at: East Bend") end if event.train then atc_send("B0 W OR") atc_set_text_outside("MGGR to Mom Junction") schedule_in(stop_delay,"depart") end if event.schedule then if event.msg == "depart" then atc_send("OC SM") atc_set_text_inside("".. "~~~~---~~~========~~~---~~~~\n".. "Manaugh Great Griefing Railway\n".. "~~~~---~~~========~~~---~~~~") atc_set_ars_disable(false) return end end \ No newline at end of file
diff --git a/durt/nodes/(-1552,11,-2628).lua b/durt/nodes/(-1552,11,-2628).lua
new file mode 100644
index 0000000..5d0c843
--- /dev/null
+++ b/durt/nodes/(-1552,11,-2628).lua
@@ -0,0 +1 @@
+if get_line() ~= "MGGR" then return end local stop_delay = "01;00" --1 minutes __approach_callback_mode = 1 if event.approach and not event.has_entered then atc_set_ars_disable(true) atc_set_lzb_tsr(1) atc_set_text_inside("Arriving at: East Bend") end if event.train then atc_send("B0 W OR") atc_set_text_outside("MGGR to Hawking Memorial") schedule_in(stop_delay,"depart") end if event.schedule then if event.msg == "depart" then atc_send("OC SM") atc_set_text_inside("".. "~~~~---~~~========~~~---~~~~\n".. "Manaugh Great Griefing Railway\n".. "~~~~---~~~========~~~---~~~~") atc_set_ars_disable(false) return end end \ No newline at end of file
diff --git a/durt/nodes/(-1941,13,-2752).lua b/durt/nodes/(-1941,13,-2752).lua
new file mode 100644
index 0000000..063a4b7
--- /dev/null
+++ b/durt/nodes/(-1941,13,-2752).lua
@@ -0,0 +1 @@
+if event.train then if get_line() ~= "MGGR" then return end end local stop_delay = "05;00" --5 minutes __approach_callback_mode = 1 if event.approach and not event.has_entered then atc_set_ars_disable(true) atc_set_lzb_tsr(2) atc_set_text_inside("Arriving at: Hawking Memorial\n".. "Change Here for: E31") end if event.train then atc_send("B0 W OR") atc_set_text_outside("MGGR to Mom Junction West") schedule_in(stop_delay,"depart") end if event.schedule then if event.msg == "depart" then atc_send("OC D1 R SM") atc_set_text_inside("".. "~~~~---~~~========~~~---~~~~\n".. "Manaugh Great Griefing Railway\n".. "~~~~---~~~========~~~---~~~~") atc_set_ars_disable(false) return end end \ No newline at end of file
diff --git a/durt/nodes/(1865,17,9141).lua b/durt/nodes/(1865,17,9141).lua
index ab7f545..288f91b 100644
--- a/durt/nodes/(1865,17,9141).lua
+++ b/durt/nodes/(1865,17,9141).lua
@@ -1 +1 @@
-turnouts = { {1870,11,9122},-- Southern headshunt/Goods Shed {1863,11,9122},--Southern Roads {1857,11,9122}, {1851,11,9122}, {1845,11,9122}, {1782,11,9222},--NW Roads {1782,11,9216}, {1782,11,9210}, {1782,11,9204}, {1868,11,9157}, --Eastern Assembly Roads {1860,11,9161}, {1817,11,9237}, {1817,11,9231}, {1822,11,9251}, --Northern Wye {1817,11,9238}, {1806,11,9243}, } routes = { -- max# of routes = 32 (1-31 + R0) --southern headshunt {['matrix']={"1st"}, ['name']="Goods Shed Headshunt"}, --1 {['matrix']={"1cr"}, ['name']="West Assembly Yard"}, --2 --southern road access {['matrix']={"2cr"}, ['name']="East S1"}, --3 {['matrix']={"2st","3cr"}, ['name']="East S2"}, --4 {['matrix']={"2st","3st","4cr"}, ['name']="East S3"}, --5 {['matrix']={"2st","3st","4st","5cr"}, ['name']="East S4"}, --6 {['matrix']={"2st","3st","4st","5st"}, ['name']="East S5"}, --7 --NW road access {['matrix']={"6cr"}, ['name']="East N1"}, --8 {['matrix']={"6st","7cr"}, ['name']="East N2"}, --9 {['matrix']={"6st","7st","8cr"}, ['name']="East N3"}, --10 {['matrix']={"6st","7st","8st","9cr"}, ['name']="East N4"}, --11 {['matrix']={"6st","7st","8st","9st"}, ['name']="East N5"}, --12 --Eastern Assembly Roads {['matrix']={"10st","12cr"}, ['name']="Assembly East"}, --13 {['matrix']={"10cr","11cr","12st","13cr"}, ['name']="Assembly Central"}, --14 {['matrix']={"10cr","11st","12st","13st"}, ['name']="Assembly West"}, --15 --Norther Wye {['matrix']={"15st","14cr"}, ['name']="Assembly<->Station"}, --16 {['matrix']={"15cr","16cr"}, ['name']="Yard Loopback"}, --17 {['matrix']={"14st","16st"}, ['name']="Bypass Yard"}, --18 --testing routes {['matrix']={"1cr","2cr","3cr","4cr","5cr"}, ['name']="[TEST]Southern Cr"}, --19 {['matrix']={"1st","2st","3st","4st","5st"}, ['name']="[TEST]Southern St"}, --20 {['matrix']={"6st","7st","8st","9st"}, ['name']="[TEST]Northern St"}, --21 {['matrix']={"6cr","7cr","8cr","9cr"}, ['name']="[TEST]Northern Cr"}, --22 } local display = "tl1" local debug_screen = "tl2" function tableLength(T) local count = 0 for _ in pairs(T) do count = count + 1 end return count end if event.type=="digiline" then if event.channel=="track_control" then local r = event.msg if r > tableLength(routes) then digiline_send(display,"Input ["..r.."] exceeds #routes||"..tableLength(routes)) -- digiline_send(debug_screen,"Input ["..r.."] exceeds #routes ("..tableLength(routes)..")") return elseif r == 0 then digiline_send(display,"Input 0 is not defined") -- digiline_send(debug_screen,"Input 0 is not defined") return end route = routes[r] -- a = "" for _,v in pairs(route.matrix) do local tid = tonumber(v:match("%d+")) local tpos = turnouts[tid] local turnout = {} turnout.x = tpos[1] turnout.y = tpos[2] turnout.z = tpos[3] local cmd = v:match("%a+") -- a = a..string.format("%s %d,%d,%d\n",cmd,turnout.x,turnout.y,turnout.z) setstate(turnout,cmd) end local verbose = table.concat(route.matrix," ") digiline_send(display,"Route "..r.." set||"..verbose.."||"..route.name) -- digiline_send(debug_screen,a) return end if event.channel=="input" then --show debug info if event.msg=="rwt_get" then digiline_send("rwt_get",rwt.now()) elseif event.msg=="debug" then digiline_send(debug_screen,"#turnouts: "..tableLength(turnouts).."\n#routes: "..tableLength(routes)) elseif event.msg=="occupancy_refresh" then local m = "" for k,v in pairs(S.yards.WOA) do m = m..k..": "..v.car_count.."||" end digiline_send(debug_screen,m) end end end \ No newline at end of file
+turnouts = { {1870,11,9122},-- Southern headshunt/Goods Shed {1863,11,9122},--Southern Roads {1857,11,9122}, {1851,11,9122}, {1845,11,9122}, {1782,11,9222},--NW Roads {1782,11,9216}, {1782,11,9210}, {1782,11,9204}, {1868,11,9157}, --Eastern Assembly Roads {1860,11,9161}, {1817,11,9237}, {1817,11,9231}, {1822,11,9251}, --Northern Wye {1817,11,9238}, {1806,11,9243}, } routes = { -- max# of routes = 32 (1-31 + R0) --southern headshunt {['matrix']={"1st"}, ['name']="Goods Shed Headshunt"}, --1 {['matrix']={"1cr"}, ['name']="West Assembly Yard"}, --2 --southern road access {['matrix']={"2cr"}, ['name']="East S1"}, --3 {['matrix']={"2st","3cr"}, ['name']="East S2"}, --4 {['matrix']={"2st","3st","4cr"}, ['name']="East S3"}, --5 {['matrix']={"2st","3st","4st","5cr"}, ['name']="East S4"}, --6 {['matrix']={"2st","3st","4st","5st"}, ['name']="East S5"}, --7 --NW road access {['matrix']={"6cr"}, ['name']="East N1"}, --8 {['matrix']={"6st","7cr"}, ['name']="East N2"}, --9 {['matrix']={"6st","7st","8cr"}, ['name']="East N3"}, --10 {['matrix']={"6st","7st","8st","9cr"}, ['name']="East N4"}, --11 {['matrix']={"6st","7st","8st","9st"}, ['name']="East N5"}, --12 --Eastern Assembly Roads {['matrix']={"10st","12cr"}, ['name']="Assembly East"}, --13 {['matrix']={"10cr","11cr","12st","13cr"}, ['name']="Assembly Central"}, --14 {['matrix']={"10cr","11st","12st","13st"}, ['name']="Assembly West"}, --15 --Norther Wye {['matrix']={"15st","14cr"}, ['name']="Assembly<->Station"}, --16 {['matrix']={"15cr","16cr"}, ['name']="Yard Loopback"}, --17 {['matrix']={"14st","16st"}, ['name']="Bypass Yard"}, --18 --testing routes {['matrix']={"1cr","2cr","3cr","4cr","5cr"}, ['name']="[TEST]Southern Cr"}, --19 {['matrix']={"1st","2st","3st","4st","5st"}, ['name']="[TEST]Southern St"}, --20 {['matrix']={"6st","7st","8st","9st"}, ['name']="[TEST]Northern St"}, --21 {['matrix']={"6cr","7cr","8cr","9cr"}, ['name']="[TEST]Northern Cr"}, --22 } local display = "tl1" local debug_screen = "tl2" function tableLength(T) local count = 0 for _ in pairs(T) do count = count + 1 end return count end if event.type=="digiline" then if event.channel=="track_control" then local r = event.msg if r > tableLength(routes) then digiline_send(display,"Input ["..r.."] exceeds #routes||"..tableLength(routes)) -- digiline_send(debug_screen,"Input ["..r.."] exceeds #routes ("..tableLength(routes)..")") return elseif r == 0 then digiline_send(display,"Input 0 is not defined") -- digiline_send(debug_screen,"Input 0 is not defined") return end route = routes[r] -- a = "" for _,v in pairs(route.matrix) do local tid = tonumber(v:match("%d+")) local tpos = turnouts[tid] local turnout = {} turnout.x = tpos[1] turnout.y = tpos[2] turnout.z = tpos[3] local cmd = v:match("%a+") -- a = a..string.format("%s %d,%d,%d\n",cmd,turnout.x,turnout.y,turnout.z) setstate(turnout,cmd) end local verbose = table.concat(route.matrix," ") digiline_send(display,"Route "..r.." set||"..verbose.."||"..route.name) -- digiline_send(debug_screen,a) return end if event.channel=="input" then --show debug info if event.msg=="rwt_get" then digiline_send("rwt_get",rwt.now()) elseif event.msg=="debug" then digiline_send(debug_screen,"#turnouts: "..tableLength(turnouts).."\n#routes: "..tableLength(routes)) elseif event.msg=="occupancy_refresh" then local m = "" for k,v in pairs(S.yards.WOA) do if type(v) == "table" then m = m..k..": "..tostring(v.car_count).."||" end end digiline_send(debug_screen,m) end end end \ No newline at end of file