summaryrefslogtreecommitdiff
path: root/durt/nodes
diff options
context:
space:
mode:
Diffstat (limited to 'durt/nodes')
-rw-r--r--durt/nodes/(1902,8,9059).lua26
-rw-r--r--durt/nodes/(1904,8,9057).lua18
-rw-r--r--durt/nodes/(1906,7,9136).lua33
-rw-r--r--durt/nodes/(1920,7,9187).lua26
-rw-r--r--durt/nodes/(1949,7,9112).lua27
-rw-r--r--durt/nodes/(1950,7,9108).lua1
6 files changed, 131 insertions, 0 deletions
diff --git a/durt/nodes/(1902,8,9059).lua b/durt/nodes/(1902,8,9059).lua
new file mode 100644
index 0000000..88b402f
--- /dev/null
+++ b/durt/nodes/(1902,8,9059).lua
@@ -0,0 +1,26 @@
+__approach_callback_mode = 1
+
+if event.approach and not event.has_entered then
+ atc_set_lzb_tsr(4)
+ return
+end
+
+if event.train and atc_arrow then
+ if not F.has_rc("WOA_rev_south") then return end
+ F.remove_rc({"WOA_rev_south"})
+ schedule_in(";01",atc_id)
+ return
+end
+
+if event.schedule then
+ if not atc_id then --bounce the train that just passed
+ atc_send_to_train(event.msg,"B0WRD1A1S3")
+ else
+ if atc_id == event.msg then --train hasn't fully passed yet, wait a bit longer
+ schedule_in(";01",atc_id)
+ else -- somehow another train crossed the controller before the first one returned. Unlikely but possible
+ atc_send_to_train(event.msg,"BBOL")
+ atc_send("BBOL")
+ end
+ end
+end \ No newline at end of file
diff --git a/durt/nodes/(1904,8,9057).lua b/durt/nodes/(1904,8,9057).lua
new file mode 100644
index 0000000..4858c34
--- /dev/null
+++ b/durt/nodes/(1904,8,9057).lua
@@ -0,0 +1,18 @@
+__approach_callback_mode = 1
+if event.approach and not event.has_entered then
+ atc_set_ars_disable(true)
+ atc_set_lzb_tsr(4)
+end
+
+if event.train and atc_arrow then
+ atc_send("S4")
+ if F.has_rc("WOA_mine_around") then
+ if train_length() == 1 then
+ F.remove_rc("FREIGHT")
+ F.add_rc("WOA_ttb_s")
+ else
+ F.add_rc("WOA_freight_left")
+ end
+ end
+ atc_set_ars_disable(false)
+end \ No newline at end of file
diff --git a/durt/nodes/(1906,7,9136).lua b/durt/nodes/(1906,7,9136).lua
new file mode 100644
index 0000000..a80aa6a
--- /dev/null
+++ b/durt/nodes/(1906,7,9136).lua
@@ -0,0 +1,33 @@
+local around_rc_list = {
+ "WOA_around_active",
+ "WOA_rev_north",
+ "WOA_around_station",
+ "WOA_rev_south",
+ "WOA_rejoin_overburden"
+}
+
+__approach_callback_mode = 1
+
+if event.approach and not event.has_entered then
+ atc_set_ars_disable(true)
+ atc_set_lzb_tsr(1)
+ return
+end
+
+if event.train and atc_arrow then
+ if F.has_rc("WOA_mine_around") then
+ if F.has_rc("WOA_around_active") then
+ F.remove_rc(around_rc_list)
+ unset_autocouple()
+ atc_send("B0WRD3SMA1")
+ atc_set_text_outside("Warmonaye Mining Co.")
+ return
+ end
+ atc_set_text_outside("Warmoneaye Mining Co.\nLocomotive Switching Ends")
+ split_off_locomotive("B0A0")
+ set_autocouple()
+ F.add_rc(around_rc_list)
+ atc_send("S4A1")
+ return
+ end
+end \ No newline at end of file
diff --git a/durt/nodes/(1920,7,9187).lua b/durt/nodes/(1920,7,9187).lua
new file mode 100644
index 0000000..d477345
--- /dev/null
+++ b/durt/nodes/(1920,7,9187).lua
@@ -0,0 +1,26 @@
+__approach_callback_mode = 1
+
+if event.approach and not event.has_entered then
+ atc_set_lzb_tsr(1)
+ return
+end
+
+if event.train and atc_arrow then
+ if not F.has_rc("WOA_rev_north") then return end
+ F.remove_rc({"WOA_rev_north"})
+ schedule_in(";01",atc_id)
+ return
+end
+
+if event.schedule then
+ if not atc_id then --bounce the train that just passed
+ atc_send_to_train(event.msg,"B0WRD1A1S3")
+ else
+ if atc_id == event.msg then --train hasn't fully passed yet, wait a bit longer
+ schedule_in(";01",atc_id)
+ else -- somehow another train crossed the controller before the first one returned. Unlikely but possible
+ atc_send_to_train(event.msg,"BBOL")
+ atc_send("BBOL")
+ end
+ end
+end \ No newline at end of file
diff --git a/durt/nodes/(1949,7,9112).lua b/durt/nodes/(1949,7,9112).lua
new file mode 100644
index 0000000..f434548
--- /dev/null
+++ b/durt/nodes/(1949,7,9112).lua
@@ -0,0 +1,27 @@
+local ind = POS(1951,7,9111)
+__approach_callback_mode = 1
+if event.approach and not event.has_entered then
+ atc_set_ars_disable(true)
+ atc_set_lzb_tsr(1)
+end
+
+if event.train and atc_arrow then
+ F.remove_rc({"WOA_ttb_s"})
+ if F.indicator(ind) then
+ schedule_in(";02","send")
+ end
+ atc_send("B0WR")
+end
+
+if (event.channel == "train_ctl" and event.msg == "send") or ((event.ext_int or event.schedule) and event.message == "send") then
+ print("RX Notification")
+ if not atc_id then
+ F.indicator(ind,true)
+ return
+ end
+ F.add_rc("FREIGHT")
+ set_route(POS(1942,8,9102),"Exit South")
+ atc_send("I+S0WRD2;SMA1")
+ F.indicator(ind,false)
+ return
+end \ No newline at end of file
diff --git a/durt/nodes/(1950,7,9108).lua b/durt/nodes/(1950,7,9108).lua
new file mode 100644
index 0000000..a3a64b6
--- /dev/null
+++ b/durt/nodes/(1950,7,9108).lua
@@ -0,0 +1 @@
+interrupt_pos(POS(1949,7,9112),"send") \ No newline at end of file