summaryrefslogtreecommitdiff
path: root/durt
diff options
context:
space:
mode:
Diffstat (limited to 'durt')
-rw-r--r--durt/init_code.lua9
-rw-r--r--durt/nodes/(-4599,7,-6502).lua17
-rw-r--r--durt/nodes/(-4623,7,-6597).lua26
-rw-r--r--durt/nodes/(-4626,7,-6638).lua23
4 files changed, 75 insertions, 0 deletions
diff --git a/durt/init_code.lua b/durt/init_code.lua
index 3919aa7..625353a 100644
--- a/durt/init_code.lua
+++ b/durt/init_code.lua
@@ -237,6 +237,15 @@ F.get_rc_safe = function()
return get_rc() or ""
end
+F.has_rc = function(query,rc_list)
+ if rc_list == "" or query == nil or query=="" then return false end
+ if not rc_list then rc_list = F.get_rc_safe() end
+ for word in rc_list:gmatch("[^%s]+") do
+ if word == query then return true end
+ end
+ return false
+end
+
F.remove_rc = function(rc_list,arrow_mode)
-- rc_list MUST be a table of rc codes to remove
-- eg: {"rc1","rc2"}
diff --git a/durt/nodes/(-4599,7,-6502).lua b/durt/nodes/(-4599,7,-6502).lua
new file mode 100644
index 0000000..0fa580c
--- /dev/null
+++ b/durt/nodes/(-4599,7,-6502).lua
@@ -0,0 +1,17 @@
+if event.train and atc_arrow then
+ local rc = get_rc() or ""
+ if rc:match("BFT_Mainline_Headshunt") then
+ schedule_in(";01",atc_id)
+ return
+ 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,"B0WRS3")
+ return
+ end
+end \ No newline at end of file
diff --git a/durt/nodes/(-4623,7,-6597).lua b/durt/nodes/(-4623,7,-6597).lua
new file mode 100644
index 0000000..4095975
--- /dev/null
+++ b/durt/nodes/(-4623,7,-6597).lua
@@ -0,0 +1,26 @@
+local split_indicator = POS(-4630,8,-6589)
+__approach_callback_mode = 1
+
+if event.approach and not event.has_entered then
+ if F.has_rc("BFT_around_test") == false then return end
+
+ atc_set_ars_disable(true)
+ atc_set_lzb_tsr(1)
+end
+
+if event.train then
+ if F.has_rc("BFT_around_test") == false then return end
+ if not atc_arrow then return end
+ local state = getstate(split_indicator)
+ if state == "off" then
+ split_off_locomotive("A0B0OL",1)
+ atc_send("S3")
+ atc_set_ars_disable(false)
+ setstate(split_indicator,"on")
+ set_rc((get_rc() or "").." BFT_Siding_B BFT_shunt_around_Track2 BFT_Mainline_Headshunt BFT_Platform1")
+ elseif state == "on" then
+ atc_send("B0WROCA1D2S4D10SM")
+ setstate(split_indicator,"off")
+ F.remove_rc({"BFT_Siding_B","BFT_shunt_around_Track2","BFT_Mainline_Headshunt","BFT_Platform1"})
+ end
+end \ No newline at end of file
diff --git a/durt/nodes/(-4626,7,-6638).lua b/durt/nodes/(-4626,7,-6638).lua
new file mode 100644
index 0000000..17a83e8
--- /dev/null
+++ b/durt/nodes/(-4626,7,-6638).lua
@@ -0,0 +1,23 @@
+local signal = POS(-4626,7,-6616)
+if event.train and atc_arrow then
+ local rc = (get_rc() or "")
+ if rc:match("BFT_shunt_platforms") then
+ local control = {"B0WD2A0R"}
+ if rc:match("BFT_shunt_Platform1") then
+ set_route(signal,"SHUNT Platform 1")
+ control[2] = "S3CplS1"
+ elseif rc:match("BFT_shunt_Track2") then
+ set_route(signal,"SHUNT Track 2")
+ control[2] = "S3CplS1"
+ elseif rc:match("BFT_shunt_around_Track2") then
+ set_route(signal,"Around via Track2")
+ control[2] = "S4"
+ end
+
+ if #control > 1 then
+ control[1] = table.concat(control,"")
+ end
+ atc_send(control[1])
+ return
+ end
+end \ No newline at end of file