diff options
author | autocommitter <autocommitter@linux-forks.de> | 2024-10-15 22:37:32 +0200 |
---|---|---|
committer | autocommitter <autocommitter@linux-forks.de> | 2024-10-15 22:37:32 +0200 |
commit | 5c7f77725394d47ce0b907aabf885ea207a507bd (patch) | |
tree | a1ff9c67ef8f225a259e4c6f4c163a45c58bb870 /durt/nodes/(1843,17,4278).lua | |
parent | b435d1b1b26db6f7c4f3eb589ecf1ed3bb79b57e (diff) | |
download | luaatc_envs-5c7f77725394d47ce0b907aabf885ea207a507bd.tar.gz luaatc_envs-5c7f77725394d47ce0b907aabf885ea207a507bd.tar.bz2 luaatc_envs-5c7f77725394d47ce0b907aabf885ea207a507bd.zip |
State at 2024-10-15
Diffstat (limited to 'durt/nodes/(1843,17,4278).lua')
-rw-r--r-- | durt/nodes/(1843,17,4278).lua | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/durt/nodes/(1843,17,4278).lua b/durt/nodes/(1843,17,4278).lua new file mode 100644 index 0000000..dcfa6d4 --- /dev/null +++ b/durt/nodes/(1843,17,4278).lua @@ -0,0 +1,54 @@ +local notification_id = "OAF Logging" +local ind = POS(1845, 17, 4275) +local print_notification = true +local function send_train() + local cmd = { + "FREIGHT", + "OAF_SHUNTER", + "IYARD", + "IP_RTS", + "IP_COLLECT_OAF_Logging", + "IYARD_TO_OAF" + } + if section_occupancy("186232")[1] then --wagons to collect from local siding before departure + cmd[#cmd+1] = "OAF_HS_S" + cmd[#cmd+1] = "OAF_HS_S_AC" + cmd[#cmd+1] = "OAF_COLLECT_OUTBOUND" + else + cmd[#cmd+1] = "OAF_DEPART_LIGHT" + end + + set_rc(table.concat(cmd, " ")) + atc_send("S0WRD2A1S4D20SM") + F.indicator(ind,false) +end + +__approach_callback_mode = 1 + +if event.approach and not event.has_entered then + atc_set_lzb_tsr(1) + return +end + +if event.ext_int then + if event.message == "notify" then + if print_notification then print(rwt.to_string(rwt.now()).. " "..notification_id.." RX Notification") end + if F.indicator(ind) then return end + if atc_id then + send_train() + return + else + F.indicator(ind,true) + return + end + end +end + +if event.train then + if F.indicator(ind) then + send_train() + return + end + atc_send("B0") + return +end
\ No newline at end of file |