diff options
Diffstat (limited to 'durt/nodes')
191 files changed, 770 insertions, 1208 deletions
diff --git a/durt/nodes/(-1373,10,-2507).lua b/durt/nodes/(-1373,10,-2507).lua index 450ca4a..b48996c 100644 --- a/durt/nodes/(-1373,10,-2507).lua +++ b/durt/nodes/(-1373,10,-2507).lua @@ -1,5 +1,10 @@ -if atc_arrow and F.has_rc("S27_EXP_EXIT") then - F.remove_rc("S27_EXP_EXIT") +if atc_arrow and F.has_rc("S27_EXP_EXIT_N") then + F.remove_rc({ + "S27_EXP_EXIT_N", + "S27_EXPORT_FINAL", + "S27_EXPORT_ACTIVE" + }) + step_fc() atc_send("D10SM") return end
\ No newline at end of file diff --git a/durt/nodes/(-1403,11,-2533).lua b/durt/nodes/(-1403,11,-2533).lua index 898b856..e6f76db 100644 --- a/durt/nodes/(-1403,11,-2533).lua +++ b/durt/nodes/(-1403,11,-2533).lua @@ -1,6 +1,8 @@ -local rev_rc = "S27_REV_East" -local rm_rc = false - +-- Automatic bouncer for headshunts, assuming longer headshunt than train length. Arrow points into headshunt +local rev_rc = "S27_EXP_HS_N" +local rm_rc = true +local autocouple = "S27_EXP_HS_N_AC" +local rm_cpl_rc = true __approach_callback_mode = 1 @@ -10,38 +12,25 @@ if event.approach and not event.has_entered then return end -if event.train and atc_arrow then - if not F.has_rc(rev_rc) then - atc_set_ars_disable(false) +if event.train then + if not atc_arrow then --train has bounced + if F.has_rc("S27_EXPORT_ACTIVE") and not F.has_rc("S27_EXPORT_FINAL") then + if not section_occupancy("254098")[1] then --no more train to shuffle + F.add_rc("S27_EXPORT_FINAL") + end + end + if F.has_rc(autocouple) then + atc_send("CplS0WD2S1") + if rm_cpl_rc then F.remove_rc({autocouple}) end + end return end - if rm_rc then F.remove_rc({rev_rc}) end - if F.has_rc("S27_SHUNTER") then - local stages = { - "S27_EXP_PICKUP", - "S27_EXP_LOAD", - "S27_EXP_DEPART" - } - - for i,v in ipairs(stages) do - if F.has_rc(v) then - unset_autocouple() - F.remove_rc(v) - local next_stage = stages[i == #stages and 1 or i+1] - if next_stage == "S27_EXP_PICKUP" and not section_occupancy("254098")[1] then -- no wagons left to load. store loco - F.add_rc("S27_LOCOSTORE") - break - end - if next_stage ~= "S27_EXP_DEPART" then - set_autocouple() - end - F.add_rc(next_stage) - - break - end - end + if not F.has_rc(rev_rc) then --not our train. disregard + atc_set_ars_disable(false) + return end + if rm_rc then F.remove_rc({rev_rc}) end schedule_in(";01",atc_id) return end diff --git a/durt/nodes/(-1419,11,-2545).lua b/durt/nodes/(-1419,11,-2545).lua new file mode 100644 index 0000000..36c4310 --- /dev/null +++ b/durt/nodes/(-1419,11,-2545).lua @@ -0,0 +1,17 @@ +-- S27 Export Arrivals Splitter +if not F.has_rc("S27_EXPORT_ACTIVE") then return end + +if not atc_arrow then -- loco has rejoined from headshunt + F.remove_rc_match("S27_EXP_DIR_%S+") + return +end + +local fc = split_at_fc("A0B0",2) or "DEPART" --should be either SAND_RAMP or DIRT_LOAD. anything else goes to departures +F.add_rc({ + "S27_EXP_HS_N", + "S27_EXP_DIR_"..fc +}) +if fc == "DEPART" then + F.add_rc("S27_EXP_HS_N_AC") +end +atc_send("S3")
\ No newline at end of file diff --git a/durt/nodes/(-1426,11,-2548).lua b/durt/nodes/(-1426,11,-2548).lua new file mode 100644 index 0000000..127133d --- /dev/null +++ b/durt/nodes/(-1426,11,-2548).lua @@ -0,0 +1,21 @@ +-- S27 Export Departures splitter +if not F.has_rc("S27_SHUNTER") or not F.has_rc("S27_EXPORT_ACTIVE") then return end +if not atc_arrow then + F.remove_rc_match("S27_EXP_DIR_%S+") + return +end + +if not F.has_rc("S27_EXPORT_FINAL") then --still more train to shuffle + split_off_locomotive("A0B0",2) + F.add_rc({ + "S27_EXP_HS_N", + "S27_EXP_HS_N_AC", + "S27_EXP_DIR_ARRIVALS", + }) + return +end + +F.add_rc({ + "S27_EXP_EXIT_N" +}) +atc_send("S3") diff --git a/durt/nodes/(-1433,11,-2563).lua b/durt/nodes/(-1433,11,-2563).lua index 7ac821e..9bccb9e 100644 --- a/durt/nodes/(-1433,11,-2563).lua +++ b/durt/nodes/(-1433,11,-2563).lua @@ -1,25 +1 @@ -__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 not F.has_rc("S27_EXP_WAIT") then - atc_set_ars_disable(false) - return - end - atc_send("S0") - return -end - -if event.ext_int and atc_id then - F.remove_rc("S27_REV_West S27_EXP_WAIT") - F.add_rc("S27_REV_East S27_EXP_DEPART") - atc_send("S3") - atc_set_ars_disable(false) - set_autocouple() - return -end
\ No newline at end of file +F.remove_rc("S27_EXP_AROUND")
\ No newline at end of file diff --git a/durt/nodes/(-1439,11,-2551).lua b/durt/nodes/(-1439,11,-2551).lua new file mode 100644 index 0000000..14b91b4 --- /dev/null +++ b/durt/nodes/(-1439,11,-2551).lua @@ -0,0 +1,17 @@ +-- S27 Load/Unload Ramp +if not F.has_rc("S27_SHUNTER") or not F.has_rc("S27_EXPORT_ACTIVE") then return end +if atc_arrow then + F.remove_rc_match("S27_EXP_DIR_%S+") + step_fc() + local fc = split_at_fc("A0B0",2) or "DEPART" --should be either DIRT_LOAD or DEPART. anything else goes to departures by default + F.add_rc({ + "S27_EXP_HS_N", + "S27_EXP_DIR_"..fc + }) + if fc == "DEPART" then + F.add_rc("S27_EXP_HS_N_AC") + end + atc_send("A1S3") + return +end +atc_send("S1")
\ No newline at end of file diff --git a/durt/nodes/(-1442,11,-2568).lua b/durt/nodes/(-1442,11,-2568).lua index 6888f6b..5346db1 100644 --- a/durt/nodes/(-1442,11,-2568).lua +++ b/durt/nodes/(-1442,11,-2568).lua @@ -1,17 +1,25 @@ -local ind = POS(-1444,10,-2546) -if event.train and atc_arrow then - if not F.has_rc("S27_SHUNTER") then - step_fc() - split_off_locomotive("BBA0") - F.add_rc("S27_REV_West S27_EXP_WAIT S27_EXP_COLLECT") - F.indicator(ind,true) - return - end - unset_autocouple() - atc_send("A0BB") - if train_length() > 2 then -- if length > 2 it would try to discouple the nose - split_at_index(train_length()-1,"BBWRD2S3A1") - return - end - atc_send("BBWRD2S3A1") -end
\ No newline at end of file +--S27 Export Arrivals +if not atc_arrow then return end +if not F.has_rc("S27_SHUNTER") then return end +if train_length() == 1 then --return loco to storage via N headshunt (backwards) + F.add_rc({ + "S27_EXP_LOCOSTORE", + "S27_EXP_HS_N", + }) + atc_send("S0WD3RS3") + return +end +if not F.has_rc("S27_EXPORT_ACTIVE") then --train has just arrived. run around + split_off_locomotive("A0B0",1) + F.add_rc({ + "S27_EXPORT_ACTIVE", + "S27_EXP_HS_S", + "S27_EXP_AROUND", + "S27_EXP_HS_N", + "S27_EXP_HS_N_AC", + "S27_EXP_DIR_ARRIVALS" + }) + return +end +F.remove_rc("S27_EXP_AROUND") +atc_send("S0WD3RS1") --bounce the train
\ No newline at end of file diff --git a/durt/nodes/(-1444,11,-2546).lua b/durt/nodes/(-1444,11,-2546).lua index 235e7d3..aeef76b 100644 --- a/durt/nodes/(-1444,11,-2546).lua +++ b/durt/nodes/(-1444,11,-2546).lua @@ -1,10 +1,23 @@ local ind = POS(-1444,10,-2546) local function send_train() - set_rc("S27_SHUNTER S27_REV_East S27") + local rc = { + "FREIGHT", + "S27_SHUNTER", + "S27_EXP_EXIT_N", + "S27_EXP", + "S23", + "ARC_AUTO", + "ARC_COLLECT_S27_EXPORT", + "ARC_AUTO_S23S", + "MGGR" + } + set_rc(table.concat(rc," ")) atc_send("S0WRD2A1S4") + print(rwt.to_string(rwt.now()).." S27_EXPORT Send Train") F.indicator(ind,false) end if event.ext_int then + print(rwt.to_string(rwt.now()).." S27_EXPORT RX Notification") if F.indicator(ind) then return end if atc_id then send_train() diff --git a/durt/nodes/(-1444,11,-2556).lua b/durt/nodes/(-1444,11,-2556).lua new file mode 100644 index 0000000..14b91b4 --- /dev/null +++ b/durt/nodes/(-1444,11,-2556).lua @@ -0,0 +1,17 @@ +-- S27 Load/Unload Ramp +if not F.has_rc("S27_SHUNTER") or not F.has_rc("S27_EXPORT_ACTIVE") then return end +if atc_arrow then + F.remove_rc_match("S27_EXP_DIR_%S+") + step_fc() + local fc = split_at_fc("A0B0",2) or "DEPART" --should be either DIRT_LOAD or DEPART. anything else goes to departures by default + F.add_rc({ + "S27_EXP_HS_N", + "S27_EXP_DIR_"..fc + }) + if fc == "DEPART" then + F.add_rc("S27_EXP_HS_N_AC") + end + atc_send("A1S3") + return +end +atc_send("S1")
\ No newline at end of file diff --git a/durt/nodes/(-1446,11,-2568).lua b/durt/nodes/(-1446,11,-2568).lua index bca38cc..6db85e3 100644 --- a/durt/nodes/(-1446,11,-2568).lua +++ b/durt/nodes/(-1446,11,-2568).lua @@ -1,7 +1,3 @@ -if event.train and atc_arrow then - if not F.has_rc("S27_SHUNTER") then return end - atc_reset() - atc_set_ars_disable(true) - atc_send("BB") - split_at_index(train_length(),"S0WRD1S3A1") -end
\ No newline at end of file +-- S27 Export Departures Bouncer +if not F.has_rc("S27_SHUNTER") or not F.has_rc("S27_EXPORT_ACTIVE") then return end +if atc_arrow then atc_send("A0B0WRD2S2A1") return end
\ No newline at end of file diff --git a/durt/nodes/(-1457,11,-2573).lua b/durt/nodes/(-1457,11,-2573).lua index 8f984b2..cb9eb3c 100644 --- a/durt/nodes/(-1457,11,-2573).lua +++ b/durt/nodes/(-1457,11,-2573).lua @@ -1,17 +1,27 @@ -local rev_rc = "S27_REV_West" -local rm_rc = false - +-- Automatic bouncer for headshunts, assuming longer headshunt than train length. Arrow points into headshunt +local rev_rc = "S27_EXP_HS_S" +local rm_rc = true +local autocouple = "S27_EXP_HS_S_AC" +local rm_cpl_rc = true __approach_callback_mode = 1 if event.approach and not event.has_entered then - atc_set_lzb_tsr(1) + atc_set_lzb_tsr(3) atc_set_ars_disable(true) return end -if event.train and atc_arrow then - if not F.has_rc(rev_rc) then +if event.train then + if not atc_arrow then --train has bounced + if F.has_rc(autocouple) then + atc_send("CplS0WD2S1") + if rm_cpl_rc then F.remove_rc({autocouple}) end + end + return + end + + if not F.has_rc(rev_rc) then --not our train. disregard atc_set_ars_disable(false) return end diff --git a/durt/nodes/(-1468,11,-2561).lua b/durt/nodes/(-1468,11,-2561).lua index df410b9..04e5a88 100644 --- a/durt/nodes/(-1468,11,-2561).lua +++ b/durt/nodes/(-1468,11,-2561).lua @@ -1,5 +1,5 @@ if event.train and atc_arrow then F.remove_rc({"S27_slag_shed"}) - F.add_rc({"S27_main_yard"}) + F.add_rc({"S27_main_yard", "S27_EXP_HS_N"}) atc_send("A0S0WRD50S3A1") end diff --git a/durt/nodes/(-1476,11,-2588).lua b/durt/nodes/(-1476,11,-2588).lua index 2701812..7c1c1d0 100644 --- a/durt/nodes/(-1476,11,-2588).lua +++ b/durt/nodes/(-1476,11,-2588).lua @@ -1,6 +1,6 @@ __approach_callback_mode = 1 -if event.approach and not event.has_entered then +if event.approach then atc_set_ars_disable(true) atc_set_lzb_tsr(1) end diff --git a/durt/nodes/(-1478,11,-2588).lua b/durt/nodes/(-1478,11,-2588).lua deleted file mode 100644 index 0239c6a..0000000 --- a/durt/nodes/(-1478,11,-2588).lua +++ /dev/null @@ -1,14 +0,0 @@ -__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 then - if atc_arrow then - atc_send("S1") - else - digiline_send("unloader","start") - end -end
\ No newline at end of file diff --git a/durt/nodes/(-1489,11,-2588).lua b/durt/nodes/(-1489,11,-2588).lua deleted file mode 100644 index 0239c6a..0000000 --- a/durt/nodes/(-1489,11,-2588).lua +++ /dev/null @@ -1,14 +0,0 @@ -__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 then - if atc_arrow then - atc_send("S1") - else - digiline_send("unloader","start") - end -end
\ No newline at end of file diff --git a/durt/nodes/(-149,8,-2209).lua b/durt/nodes/(-149,8,-2209).lua deleted file mode 100644 index c5bdaaf..0000000 --- a/durt/nodes/(-149,8,-2209).lua +++ /dev/null @@ -1 +0,0 @@ -F.station("Acm","E")
\ No newline at end of file diff --git a/durt/nodes/(-1497,16,-2594).lua b/durt/nodes/(-1497,16,-2594).lua deleted file mode 100644 index e0ed6bc..0000000 --- a/durt/nodes/(-1497,16,-2594).lua +++ /dev/null @@ -1,6 +0,0 @@ -if event.type=="digiline" then - if event.channel=="shunt_type" then - S.yards.S27.shunt_type = event.msg - digiline_send("lcd","====== | Shunt | Split | "..tostring(S.yards.S27.shunt_type).." | ======") - end -end
\ No newline at end of file diff --git a/durt/nodes/(-1501,11,-2588).lua b/durt/nodes/(-1501,11,-2588).lua index 2701812..7c1c1d0 100644 --- a/durt/nodes/(-1501,11,-2588).lua +++ b/durt/nodes/(-1501,11,-2588).lua @@ -1,6 +1,6 @@ __approach_callback_mode = 1 -if event.approach and not event.has_entered then +if event.approach then atc_set_ars_disable(true) atc_set_lzb_tsr(1) end diff --git a/durt/nodes/(-1506,15,-2599).lua b/durt/nodes/(-1506,15,-2599).lua deleted file mode 100644 index e0ed6bc..0000000 --- a/durt/nodes/(-1506,15,-2599).lua +++ /dev/null @@ -1,6 +0,0 @@ -if event.type=="digiline" then - if event.channel=="shunt_type" then - S.yards.S27.shunt_type = event.msg - digiline_send("lcd","====== | Shunt | Split | "..tostring(S.yards.S27.shunt_type).." | ======") - end -end
\ No newline at end of file diff --git a/durt/nodes/(-151,8,-2196).lua b/durt/nodes/(-151,8,-2196).lua deleted file mode 100644 index 602ea01..0000000 --- a/durt/nodes/(-151,8,-2196).lua +++ /dev/null @@ -1 +0,0 @@ -F.station("Acm","W")
\ No newline at end of file diff --git a/durt/nodes/(-1511,11,-2590).lua b/durt/nodes/(-1511,11,-2590).lua deleted file mode 100644 index 9c41623..0000000 --- a/durt/nodes/(-1511,11,-2590).lua +++ /dev/null @@ -1,67 +0,0 @@ -__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 - if S.yards.S27.shunt_type == true then - - --split and run around properly. player is present to supervise autocouple - local info = { - ['rc'] = get_rc() or " ", - ['ln'] = get_line() or " ", - ['it'] = atc_get_text_inside() or " ", - ['ot'] = atc_get_text_outside() or " " - } - print("Local Info:") - print(info) - print("===========") - if info.rc ~= "S27_HEADSHUNT S27_AROUND" then - S.yards.S27['info'] = info - print("info.rc false --> S.yards.S27: ") - print(S.yards.S27) - print("===========") - split_at_index(2,"BBWR") - set_rc("S27_HEADSHUNT S27_AROUND") - set_autocouple() - else - info = S.yards.S27['info'] - print("info.rc true --> S.yards.S27: ") - print(S.yards.S27) - print("===========") - set_rc(info.rc) - set_line(info.ln) - atc_set_text_inside(info.it) - atc_set_text_outside(info.ot) - - atc_send("BBWD3RD1SM") - end - atc_set_ars_disable(false) - return - elseif S.yards.S27.shunt_type == false then - --reverse around loop. player not present to supervise autocouple operation - local rc = get_rc() or "" - - local action = 0 - local rc_list = {} - for token in rc:gmatch("[^%s]+") do - if token=="S27_LOOP" then - action = 1 - else - table.insert(rc_list,token) - end - end - - if action == 0 then - rc = rc.." S27_LOOP" - else - rc = table.concat(rc_list," ").." S27_EXIT" - end - set_rc(rc) - atc_set_ars_disable(false) - atc_send("B0WRD1S3") - return - end -end
\ No newline at end of file diff --git a/durt/nodes/(-1511,9,-2591).lua b/durt/nodes/(-1511,9,-2591).lua deleted file mode 100644 index e0ed6bc..0000000 --- a/durt/nodes/(-1511,9,-2591).lua +++ /dev/null @@ -1,6 +0,0 @@ -if event.type=="digiline" then - if event.channel=="shunt_type" then - S.yards.S27.shunt_type = event.msg - digiline_send("lcd","====== | Shunt | Split | "..tostring(S.yards.S27.shunt_type).." | ======") - end -end
\ No newline at end of file diff --git a/durt/nodes/(-1513,11,-2588).lua b/durt/nodes/(-1513,11,-2588).lua deleted file mode 100644 index c76d2ce..0000000 --- a/durt/nodes/(-1513,11,-2588).lua +++ /dev/null @@ -1 +0,0 @@ -__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
if S.yards.S27.shunt_type == false then
--reverse around loop. player not present to supervise autocouple
local rc = get_rc() or ""
local action = 0
local rc_list = {}
for token in rc:gmatch("[^%s]+") do
if token=="S27_LOOP" then
action = 1
else
table.insert(rc_list,token)
end
end
if action == 0 then
rc = rc.." S27_LOOP"
else
rc = table.concat(rc_list," ").." S27_EXIT"
end
set_rc(rc)
atc_set_ars_disable(false)
atc_send("B0WRD1S3")
return
elseif S.yards.S27.shunt_type == true then
--split and run around properly. player is present to supervise autocouple
local info = {
['rc'] = get_rc() or "",
['ln'] = get_line() or "",
['it'] = atc_get_text_inside() or "",
['ot'] = atc_get_text_outside() or ""
}
if info.rc == "S27_HEADSHUNT S27_AROUND" then
info = S.yards.S27.info
set_rc(info.rc)
set_line(inf.ln)
atc_set_text_inside(info.it)
atc_set_text_outside(info.ot)
atc_send("BBWD3RD1SM")
else
S.yards.S27[info] = info
split_at_index(2,"BBWR")
set_rc("S27_HEADSHUNT S27_AROUND")
set_autocouple()
end
atc_set_ars_disable(false)
return
end
end
\ No newline at end of file diff --git a/durt/nodes/(-1514,11,-2590).lua b/durt/nodes/(-1514,11,-2590).lua deleted file mode 100644 index c76d2ce..0000000 --- a/durt/nodes/(-1514,11,-2590).lua +++ /dev/null @@ -1 +0,0 @@ -__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
if S.yards.S27.shunt_type == false then
--reverse around loop. player not present to supervise autocouple
local rc = get_rc() or ""
local action = 0
local rc_list = {}
for token in rc:gmatch("[^%s]+") do
if token=="S27_LOOP" then
action = 1
else
table.insert(rc_list,token)
end
end
if action == 0 then
rc = rc.." S27_LOOP"
else
rc = table.concat(rc_list," ").." S27_EXIT"
end
set_rc(rc)
atc_set_ars_disable(false)
atc_send("B0WRD1S3")
return
elseif S.yards.S27.shunt_type == true then
--split and run around properly. player is present to supervise autocouple
local info = {
['rc'] = get_rc() or "",
['ln'] = get_line() or "",
['it'] = atc_get_text_inside() or "",
['ot'] = atc_get_text_outside() or ""
}
if info.rc == "S27_HEADSHUNT S27_AROUND" then
info = S.yards.S27.info
set_rc(info.rc)
set_line(inf.ln)
atc_set_text_inside(info.it)
atc_set_text_outside(info.ot)
atc_send("BBWD3RD1SM")
else
S.yards.S27[info] = info
split_at_index(2,"BBWR")
set_rc("S27_HEADSHUNT S27_AROUND")
set_autocouple()
end
atc_set_ars_disable(false)
return
end
end
\ No newline at end of file diff --git a/durt/nodes/(-1515,11,-2588).lua b/durt/nodes/(-1515,11,-2588).lua deleted file mode 100644 index b3a645f..0000000 --- a/durt/nodes/(-1515,11,-2588).lua +++ /dev/null @@ -1,6 +0,0 @@ -if event.train and atc_arrow then - atc_set_ars_disable(false) - atc_send("S3") - set_rc(get_rc().." S27_EXIT") - return -end
\ No newline at end of file diff --git a/durt/nodes/(-1515,7,-2621).lua b/durt/nodes/(-1515,7,-2621).lua index 0abb68d..5af9c6c 100644 --- a/durt/nodes/(-1515,7,-2621).lua +++ b/durt/nodes/(-1515,7,-2621).lua @@ -1,5 +1,5 @@ if event.train and atc_arrow then F.remove_rc({"S27_main_yard"}) - F.add_rc({"S27_slag_shed"}) + F.add_rc({"S27_slag_shed","S27_EXP_HS_N"}) atc_send("A0S0WRD100S3A1") end diff --git a/durt/nodes/(-1516,11,-2590).lua b/durt/nodes/(-1516,11,-2590).lua deleted file mode 100644 index 7352032..0000000 --- a/durt/nodes/(-1516,11,-2590).lua +++ /dev/null @@ -1 +0,0 @@ -if event.train and atc_arrow then
if S.yards.S27.shunt_type == false then
--reverse around loop. player not present to supervise autocouple operation
local rc = get_rc() or ""
local action = 0
local rc_list = {}
for token in rc:gmatch("[^%s]+") do
if token=="S27_LOOP" then
action = 1
else
table.insert(rc_list,token)
end
end
if action == 0 then
rc = rc.." S27_LOOP"
else
rc = table.concat(rc_list," ").." S27_EXIT"
end
set_rc(rc)
atc_set_ars_disable(false)
atc_send("B0WRD1S3")
return
end
end
\ No newline at end of file diff --git a/durt/nodes/(-168,7,-2053).lua b/durt/nodes/(-168,7,-2053).lua deleted file mode 100644 index f64a829..0000000 --- a/durt/nodes/(-168,7,-2053).lua +++ /dev/null @@ -1 +0,0 @@ -F.station("Ghd","E")
\ No newline at end of file diff --git a/durt/nodes/(-170,7,-2040).lua b/durt/nodes/(-170,7,-2040).lua deleted file mode 100644 index c17ee1f..0000000 --- a/durt/nodes/(-170,7,-2040).lua +++ /dev/null @@ -1 +0,0 @@ -F.station("Ghd","W")
\ No newline at end of file diff --git a/durt/nodes/(-1728,10,-1823).lua b/durt/nodes/(-1728,10,-1823).lua deleted file mode 100644 index 0e7dc6d..0000000 --- a/durt/nodes/(-1728,10,-1823).lua +++ /dev/null @@ -1,4 +0,0 @@ -if get_line() == "S23" or get_line() == "BH" then - atc_set_text_inside("S23 -> Arcadius") - atc_set_text_outside("S23 -> Arcadius") -end
\ No newline at end of file diff --git a/durt/nodes/(-1924,13,-1692).lua b/durt/nodes/(-1924,13,-1692).lua deleted file mode 100644 index 9d2f57f..0000000 --- a/durt/nodes/(-1924,13,-1692).lua +++ /dev/null @@ -1 +0,0 @@ -signal = "foundry_roads_sorting"
if (event.train and atc_arrow) or (event.int and event.message == "check_signal" and atc_id) then
if can_set_route(signal,"Out Road (Loadout)") then
set_route(signal,"Out Road (Loadout)")
elseif can_set_route(signal,"In Road (Fuel In)") then
set_route(signal,"In Road (Fuel In)")
else
if atc_speed > 0 then
atc_send("S0")
else
atc_send("B0")
end
interrupt(5,"check_signal")
return
end
atc_send("S1")
return
end
\ No newline at end of file diff --git a/durt/nodes/(-1973,16,800).lua b/durt/nodes/(-1973,16,800).lua index e6166e8..0e7e05c 100644 --- a/durt/nodes/(-1973,16,800).lua +++ b/durt/nodes/(-1973,16,800).lua @@ -2,11 +2,13 @@ local notification_id = "ARC" local ind = POS(-1954,16,840) local print_notification = true local sections ={ + departures = "262432", -- Destined for Byard store_4 = "032832" -- Destined for Arcadius Basement Loading Dock } local function send_train() - atc_send("S0WRD2A1S4") - local cmd = { -- collect wagons from BYARD, and park loco in loco siding if no departures at ARC + -- define default command to be overwritten if departures/local job available + -- collect wagons from BYARD, and park loco in loco siding if no departures at ARC + local cmd = { "FREIGHT", "ARC_LOCOSTORE", "ARC_AUTO", @@ -20,17 +22,34 @@ local function send_train() "E3S23N", "ARC_LIGHT_EXIT" } - if #section_occupancy(sections.store_4) ~= 0 then - if print_notification then print(rwt.to_string(rwt.now()).. " "..notification_id.." send_train() has local job from STORE_4") end + if #section_occupancy(sections.store_4) > 0 then -- perform local job to Arcadius Basement Loading Dock before taking wagons to BYARD + if print_notification then print(rwt.to_string(rwt.now()).. " "..notification_id.." send_train() has local job from STORE_4") end + cmd = { + "FREIGHT", --because it's freight + "ARC_LOCOSTORE", --technically the loco identifier until we have wagon ID. will be ignored by yard_headshunt because no "ARC_DEPART" etc + "ARC_YARD_REENTRY", --redirect back into the yard from yard_exit controller. will be checked by yard_exit before ARS triggers + "ARC_RTS", --basic yard call + "ARC_COLLECT_ARC_LOAD_DOCK", -- collect req wagons. can be left in place, if train_length == 1 then will return to siding anyway + "ARC_AUTO_LOCAL_LOADING", --direct to ARC Basement Loading Dock + "ARC_LOAD", --trigger the loading track + } + elseif #section_occupancy(sections.departures) > 0 then + -- reenter yard, collect departures and head to Byard + if print_notification then print(rwt.to_string(rwt.now()).. " "..notification_id.." send_train() has local job from DEPARTURES") end cmd = { - "FREIGHT", --because it's freight - "ARC_LOCOSTORE", --technically the loco identifier until we have wagon ID. will be ignored by yard_headshunt because no "ARC_DEPART" etc - "ARC_YARD_REENTRY", --redirect back into the yard from yard_exit controller. will be checked by yard_exit before ARS triggers - "ARC_RTS", --basic yard call - "ARC_COLLECT_ARC_LOAD_DOCK", -- collect req wagons. can be left in place, if train_length == 1 then will return to siding anyway - "ARC_AUTO_LOCAL_LOADING", --direct to ARC Basement Loading Dock - "ARC_LOAD", --trigger the loading track + "FREIGHT", + "ARC_LOCOSTORE", + "ARC_AUTO", + "ARC_YARD_REENTRY", -- trigger yard reentry on light exit + "ARC_2ND_EXIT_ARC_AUTO_S23S", -- exit direction after + "ARC_RTS", + "ARC_COLLECT_ARC_SB", + "S23E3N", + "BYARD", + "BY_RTS", + "BY_COLLECT_ARC", + "E3S23N", } end set_rc(table.concat(cmd," ")) diff --git a/durt/nodes/(-1987,13,-1700).lua b/durt/nodes/(-1987,13,-1700).lua deleted file mode 100644 index fc6a367..0000000 --- a/durt/nodes/(-1987,13,-1700).lua +++ /dev/null @@ -1,4 +0,0 @@ -if event.train and atc_arrow and atc_speed == 1 then - atc_send("SM") -end -F.M27_tracking("Exit Foundry")
\ No newline at end of file diff --git a/durt/nodes/(-1988,13,-1698).lua b/durt/nodes/(-1988,13,-1698).lua deleted file mode 100644 index 3ca3126..0000000 --- a/durt/nodes/(-1988,13,-1698).lua +++ /dev/null @@ -1 +0,0 @@ -F.M27_tracking("Enter Foundry")
\ No newline at end of file diff --git a/durt/nodes/(-20,8,-2319).lua b/durt/nodes/(-20,8,-2319).lua deleted file mode 100644 index c788356..0000000 --- a/durt/nodes/(-20,8,-2319).lua +++ /dev/null @@ -1 +0,0 @@ -F.station("Ghb","E")
\ No newline at end of file diff --git a/durt/nodes/(-2039,19,719).lua b/durt/nodes/(-2039,19,719).lua index 107d03f..5a090ad 100644 --- a/durt/nodes/(-2039,19,719).lua +++ b/durt/nodes/(-2039,19,719).lua @@ -28,6 +28,15 @@ if event.train then end if rm_rc then F.remove_rc({rev_rc}) end schedule_in(";01",atc_id) + + -- remove stray control flags + F.remove_rc_match("ARC_LOCOS_%S+") + F.remove_rc_match("ARC_WAGONS_%S+") + F.remove_rc({ + "ARC_DEPART", + "ARC_FINAL_COLLECT" + }) + return end diff --git a/durt/nodes/(-2077,3,821).lua b/durt/nodes/(-2077,3,821).lua deleted file mode 100644 index eceb40a..0000000 --- a/durt/nodes/(-2077,3,821).lua +++ /dev/null @@ -1,25 +0,0 @@ -local dir_indicator = POS(-2079,7,803) -local this_dir = true - -__approach_callback_mode = 2 -if event.approach and not event.has_entered then - atc_set_lzb_tsr(2) - atc_set_ars_disable(true) - return -end - -if event.train then - if not atc_arrow then - if F.dir(dir_indicator) == this_dir then - atc_send("B1") - end -- no else, should never happen - else - if F.has_rc("ARC_LOAD_load") and (F.dir(dir_indicator) == not this_dir) then - F.remove_rc({"ARC_LOAD_load"}) - F.add_rc("ARC_LOAD_rejoin") - atc_send("B0WRD1S2") - else - atc_send("A1S2") - end - end -end
\ No newline at end of file diff --git a/durt/nodes/(-2080,19,731).lua b/durt/nodes/(-2080,19,731).lua deleted file mode 100644 index 440ca17..0000000 --- a/durt/nodes/(-2080,19,731).lua +++ /dev/null @@ -1,32 +0,0 @@ -local dir_indicator = POS(-2079,7,803) -local this_dir = false - -if event.schedule then - if not atc_id then - atc_send_to_train(event.msg,"B0WRD1S1") - return - end - if event.msg == atc_id then - schedule_in(";01",atc_id) - return - else - atc_send("BB") - atc_send_to_train("BB") - return - end - return -end - -if event.train and atc_arrow then - if F.has_rc("ARC_LOAD_reverse") and F.dir(dir_indicator) == this_dir then - set_autocouple() - schedule_in(";01",atc_id) - return - end - if F.has_rc("ARC_LOAD_exit") then - F.remove_rc({"ARC_LOAD_exit"}) - atc_send("D5SM") - return - end -end - diff --git a/durt/nodes/(-2080,3,787).lua b/durt/nodes/(-2080,3,787).lua deleted file mode 100644 index 79ffde6..0000000 --- a/durt/nodes/(-2080,3,787).lua +++ /dev/null @@ -1,36 +0,0 @@ -local dir_indicator = POS(-2079,7,803) -local this_dir = false - -__approach_callback_mode = 2 -if event.approach and not event.has_entered then - atc_set_lzb_tsr(2) - atc_set_ars_disable(true) - return -end - -if event.train then - if not F.has_rc("ARC_LOAD") then - atc_set_ars_disable(false) - return - end - if F.has_rc("ARC_LOAD_exit") then - atc_set_ars_disable(false) - return - end - if not atc_arrow then - atc_send("S2") - return - end - - if not F.has_rc("ARC_LOAD_rejoin") then - split_at_fc("B0") - F.add_rc("ARC_LOAD_reverse ARC_LOAD_load") - atc_send("A1S2") - F.dir(dir_indicator,this_dir) - else - unset_autocouple() - F.remove_rc({"ARC_LOAD_reverse","ARC_LOAD_rejoin"}) - F.add_rc("ARC_LOAD_exit") - atc_send("B0WRD1S6A1") - end -end
\ No newline at end of file diff --git a/durt/nodes/(-2080,3,822).lua b/durt/nodes/(-2080,3,827).lua index c9d875f..74778f4 100644 --- a/durt/nodes/(-2080,3,822).lua +++ b/durt/nodes/(-2080,3,827).lua @@ -19,5 +19,5 @@ else --loco has rejoined from runaround. push through to headshunt, run over loa "ARC_AUTO" }) end -set_route(POS(-2081,4,825),"Headshunt") +set_route(POS(-2081,4,830),"Headshunt") atc_send("A1S2")
\ No newline at end of file diff --git a/durt/nodes/(-2080,3,834).lua b/durt/nodes/(-2080,3,834).lua deleted file mode 100644 index c983a88..0000000 --- a/durt/nodes/(-2080,3,834).lua +++ /dev/null @@ -1,3 +0,0 @@ -if event.train then - atc_send("S0I+WR;D2S3") -end
\ No newline at end of file diff --git a/durt/nodes/(-2080,3,837).lua b/durt/nodes/(-2080,3,837).lua deleted file mode 100644 index a765227..0000000 --- a/durt/nodes/(-2080,3,837).lua +++ /dev/null @@ -1,3 +0,0 @@ -if event.train and F.has_rc("ARC_LOAD_REVERSE") then - atc_send("S0I+WR;D2S3") -end
\ No newline at end of file diff --git a/durt/nodes/(-2080,3,832).lua b/durt/nodes/(-2080,3,839).lua index 4d71348..4d71348 100644 --- a/durt/nodes/(-2080,3,832).lua +++ b/durt/nodes/(-2080,3,839).lua diff --git a/durt/nodes/(-2081,1,811).lua b/durt/nodes/(-2081,1,811).lua deleted file mode 100644 index 1ee1917..0000000 --- a/durt/nodes/(-2081,1,811).lua +++ /dev/null @@ -1,3 +0,0 @@ -if event.punch then - interrupt_pos(POS(-4144,16,-5792)) -end
\ No newline at end of file diff --git a/durt/nodes/(-2081,19,690).lua b/durt/nodes/(-2081,19,690).lua deleted file mode 100644 index 703d4e4..0000000 --- a/durt/nodes/(-2081,19,690).lua +++ /dev/null @@ -1 +0,0 @@ -F.remove_rc({"ArcLoad_exit"},true)
\ No newline at end of file diff --git a/durt/nodes/(-2083,3,822).lua b/durt/nodes/(-2083,3,822).lua deleted file mode 100644 index 88d416f..0000000 --- a/durt/nodes/(-2083,3,822).lua +++ /dev/null @@ -1,3 +0,0 @@ -if event.punch then - print(getstate(POS(-2078,4,826))) -end
\ No newline at end of file diff --git a/durt/nodes/(-2084,21,851).lua b/durt/nodes/(-2084,21,851).lua deleted file mode 100644 index 555a3ed..0000000 --- a/durt/nodes/(-2084,21,851).lua +++ /dev/null @@ -1,9 +0,0 @@ -if get_line() == "S23" or get_line() == "BH" then - if atc_arrow then - atc_set_text_inside("S23 -> Mom Junction") - atc_set_text_outside("S23 -> Mom Junction") - else - atc_set_text_inside("Terminus: Arcadius/nChange here for S20") - atc_set_text_outside("S23") - end -end
\ No newline at end of file diff --git a/durt/nodes/(-2105,19,829).lua b/durt/nodes/(-2105,19,829).lua deleted file mode 100644 index 06660b9..0000000 --- a/durt/nodes/(-2105,19,829).lua +++ /dev/null @@ -1 +0,0 @@ -print(type(section_occupancy)=="function" and "section_occupancy() is a go" or "no dice yet. still waiting to update")
\ No newline at end of file diff --git a/durt/nodes/(-2132,8,914).lua b/durt/nodes/(-2132,8,914).lua index ec8cd4a..5229dce 100644 --- a/durt/nodes/(-2132,8,914).lua +++ b/durt/nodes/(-2132,8,914).lua @@ -1,17 +1,22 @@ -local trigger = POS(-2130,21,925) -if event.train then - if getstate(trigger)=="off" then return end - digiline_send("ars_set_query",true) - return -end +local ch = { + get = "ars_set_query", + input = "ars_set", + indicator = "ars_indicator", +} -if event.digiline and event.channel=="ars_set" and atc_id then - set_rc(event.msg) - setstate(trigger,"off") +if event.train then + digiline_send(ch.get, "GET") return end -if event.digiline and event.channel=="ars_indicator" then - setstate(trigger,event.msg) - return +if event.digiline then + if event.channel==ch.input then + if not atc_id then + digiline_send(ch.indicator, true) + return + end + set_rc(tostring(event.msg)) + digiline_send(ch.indicator, false) + return + end end
\ No newline at end of file diff --git a/durt/nodes/(-2135,21,920).lua b/durt/nodes/(-2135,21,920).lua deleted file mode 100644 index 74dac88..0000000 --- a/durt/nodes/(-2135,21,920).lua +++ /dev/null @@ -1,25 +0,0 @@ -local ch = { - output = "ars_manual_input", - get = "ars_set_query", - input = "ars_set", - indicator = "ars_indicator", - lcd = "lcd", - debug = "debug" -} - -if event.train then - digiline_send(ch.get, "GET") - return -end - -if event.digiline then - if event.channel==ch.input then - if not atc_id then - digiline_send(ch.indicator, true) - return - end - set_rc(tostring(event.msg)) - digiline_send(ch.indicator, false) - return - end -end
\ No newline at end of file diff --git a/durt/nodes/(-2204,8,-651).lua b/durt/nodes/(-2204,8,-651).lua new file mode 100644 index 0000000..d8539fb --- /dev/null +++ b/durt/nodes/(-2204,8,-651).lua @@ -0,0 +1,26 @@ +local cmd = { + "TREES_RUNAROUND", + "SHUNT_MAINLINE_REV", +} +__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 not F.has_rc("BYARD_NOID_SHUTTLE") then return end -- not our train, disregard + if not F.has_rc("TREES_RUNAROUND") then -- train has arrived from yard, split and runaround + split_off_locomotive("A0B0") --disable ARS to stop the rest of the train engaging the signal + F.add_rc(cmd) --add RC commands tomake the train runaround + atc_send("S3A1") --send the loco on its way to make the runaround + return + end + --else loco has returned from runaround + F.remove_rc(cmd) -- remove runaround RCs + atc_send("S0WRS1") --reverse the train and creep towards the other departure signal + return +end +
\ No newline at end of file diff --git a/durt/nodes/(-2204,8,-676).lua b/durt/nodes/(-2204,8,-676).lua new file mode 100644 index 0000000..834ba6c --- /dev/null +++ b/durt/nodes/(-2204,8,-676).lua @@ -0,0 +1,30 @@ +local notification_id = "NOID" +local ind = POS(-2209,8,-651) -- IMPORTANT NB: remember to update this if you move the indicator mesecon switch +local print_notification = true +local function send_train() + set_rc("FREIGHT BYARD_NOID_SHUTTLE BYARD BY_COLLECT_NOID BY_RTS NIDTH NOIDEA IND TREES") -- RC string to overwrite when departing for the autoyard, remember to include the return RCs as well + step_fc() --step the fc forward to be ready for the autoyard + atc_send("A1SM") + F.indicator(ind,false) +end +if event.ext_int then -- trigger event from the yard itself. + if event.message == "notify" then -- can also be a manual/other message, just edit this if statement + if print_notification then print(rwt.to_string(rwt.now()).. " "..notification_id.." RX Notification") end + if F.indicator(ind) then return end -- indicator is already lit, train hasn't collected the first set yet + if atc_id then --send the train to the yard for collection + send_train() + return + else -- set the indicator to await the returning train + F.indicator(ind,true) + return + end + end +end +if event.train and atc_arrow then + if F.indicator(ind) then + send_train() + return + end + atc_send("B0") + return +end
\ No newline at end of file diff --git a/durt/nodes/(-2209,9,-651).lua b/durt/nodes/(-2209,9,-651).lua new file mode 100644 index 0000000..fdf1611 --- /dev/null +++ b/durt/nodes/(-2209,9,-651).lua @@ -0,0 +1,10 @@ +local users = { +"gabriel", +"survivalg", +"Maverick2797" +} +if event.punch then + for _,name in pairs(users) do + if event.name==name then interrupt_pos(POS(-2204,8,-676),"notify") return end + end +end
\ No newline at end of file diff --git a/durt/nodes/(-2211,8,902).lua b/durt/nodes/(-2211,8,902).lua deleted file mode 100644 index 7e11761..0000000 --- a/durt/nodes/(-2211,8,902).lua +++ /dev/null @@ -1 +0,0 @@ -if event.type=="digiline" then
if event.channel ~= "trainctl" then return end
if event.msg == "send" then
if atc_id and atc_arrow then
atc_send("S0WRS5")
elseif atc_id and atc_arrow == false then
atc_send("S5")
end
end
end
\ No newline at end of file diff --git a/durt/nodes/(-2213,10,-728).lua b/durt/nodes/(-2213,10,-728).lua new file mode 100644 index 0000000..23ac35d --- /dev/null +++ b/durt/nodes/(-2213,10,-728).lua @@ -0,0 +1,2 @@ +if not F.has_rc("TREES_RUNAROUND") then return end +atc_send("CplS1")
\ No newline at end of file diff --git a/durt/nodes/(-2213,8,898).lua b/durt/nodes/(-2213,7,887).lua index 0be631f..2a67431 100644 --- a/durt/nodes/(-2213,8,898).lua +++ b/durt/nodes/(-2213,7,887).lua @@ -1,13 +1,13 @@ if event.type=="digiline" then if event.channel ~= "trainctl" then return end if not atc_id then return end - local cmd = "I+S0WR;S4" + local cmd = "I+S0WR;S3" if event.msg == "send" then atc_send(cmd) return end if event.msg == "send_cpl" then - atc_send(cmd.."CplWS0WRS4") + atc_send(cmd.."CplS0WRS3") return end end
\ No newline at end of file diff --git a/durt/nodes/(-2227,8,290).lua b/durt/nodes/(-2227,8,290).lua deleted file mode 100644 index 6e6f7ef..0000000 --- a/durt/nodes/(-2227,8,290).lua +++ /dev/null @@ -1,3 +0,0 @@ -local msg = "S23 -> Redwood" -atc_set_text_outside(msg) -atc_set_text_inside(msg)
\ No newline at end of file diff --git a/durt/nodes/(-2227,8,292).lua b/durt/nodes/(-2227,8,292).lua deleted file mode 100644 index 75c39d7..0000000 --- a/durt/nodes/(-2227,8,292).lua +++ /dev/null @@ -1,75 +0,0 @@ --- - -local delta = 4*60+20 -- HERE IS THE VALUE - -local owdata = S.BaHi_T6 -local numval = 5 -local switchbox_cp = { x=-2221,y=14,z=297} - -function save_delay(d) - if not owndata then - owndata = { false, false, false, false, false, false, false, false, } - end - for i=numval,2,-1 do - owndata[i] = owndata[i-1] - end - owndata[1] = d -end - -function delay_text() - if not owndata then - return "" - end - local rg = "" - for i=1,numval do - h = owndata[i] - if not h then h = "" end - rg = rg .. h .." " - end - return rg -end - -if event.type == "train" then - if atc_arrow then - atc_send("B0WOL") -- D20OCD3S2") --- setstate("BaHi_T5_S2","st") --- setstate("BaHi_T5_S1","st") - - if not S.BaHi_T6 then - S.BaHi_T6 = os.time() - end --- interrupt(1,"departure") --- else - now = os.time() - tempdist = now-S.BaHi_T6 - save_delay(tempdist) - delaystr = delay_text() - output = "last: "..S.BaHi_T6 .. "\nnow: " .. now .. "\ndelta: " .. tempdist.. "\n"..delta .. " " .. delaystr - digiline_send("lcd",output) - interrupt_pos( switchbox_cp, { action = "display", data = output } ) - if tempdist > delta then - interrupt(15,"departure") - else - interrupt(-tempdist+delta,"departure") - end --- end - end - return -end - -if event.type == "int" then - if event.msg == "departure" then - -- setstate("BaHi_T5_S2","st") - -- setstate("BaHi_T5_S1","st") - atc_set_text_inside("S23 -> Redwood") - atc_send("ROCD3S2") - now = os.time() - delaystr = delay_text() --- digiline_send("lcd","last: \nnow: " .. now .. "\ndelta: " .. tempdist.. "\n"..delta .. " " .. delaystr) - output = "last: " .. now .. " \n \n \n"..delta.." "..delaystr - digiline_send("lcd",output ) - interrupt_pos( switchbox_cp, { action = "display", data = output } ) - S.BaHi_T6 = now - end - return -end
\ No newline at end of file diff --git a/durt/nodes/(-2343,15,-1336).lua b/durt/nodes/(-2343,15,-1336).lua deleted file mode 100644 index c8dc75c..0000000 --- a/durt/nodes/(-2343,15,-1336).lua +++ /dev/null @@ -1 +0,0 @@ -F.M27_tracking("Tanh Depot")
\ No newline at end of file diff --git a/durt/nodes/(-2732,11,891).lua b/durt/nodes/(-2732,11,891).lua deleted file mode 100644 index e69de29..0000000 --- a/durt/nodes/(-2732,11,891).lua +++ /dev/null diff --git a/durt/nodes/(-2734,10,-1693).lua b/durt/nodes/(-2734,10,-1693).lua deleted file mode 100644 index 8043b8c..0000000 --- a/durt/nodes/(-2734,10,-1693).lua +++ /dev/null @@ -1 +0,0 @@ ---Still need to convert to a function rather than trackside
local hs_sig = "M27_Quarry_Headshunt"
local hs_route = "Headshunt"
local exit_sig = "M27_Quarry_Exit"
local exit_route = "Exit to Mainline"
local siding_id = "M27_Quarry_runaround"
local length_prefix = "Loco"
if (event.train and atc_arrow) then
local rc = get_rc() or " "
-- the RC that controls the link to split
-- rc value: "<rc><num_wagons to shunt with>" default is single loco
-- eg "Loco2" for tenders, "Loco3" for
local loco_pos = rc:match(length_prefix.."%d+") or length_prefix.."1"
loco_pos = tonumber(loco_pos:match("%d+"))+1
if not S.runarounds[siding_id].shunting then -- train to be split
--store info for later re-insertion
S.runarounds[siding_id] = {
['shunting'] = true,
['rc'] = rc,
['line'] = get_line() or " "
}
atc_send("B0S0")
interrupt(5,{['cmd'] = "split", ['leng'] = loco_pos})
-- change int time if needed, depends on approach speed slowdown
else -- train has rejoined
--re-insert info to train
if S.runarounds[siding_id].rc then set_rc(S.runarounds[siding_id].rc) end
if S.runarounds[siding_id].line then set_line(S.runarounds[siding_id].line) end
--depart
atc_send("B0WD3RSM")
set_route(exit_sig,exit_route)
S.runarounds[siding_id].shunting = false
end
end
if event.int then
if event.msg.cmd=="split" then
cmd = event.msg
split_at_index(cmd.leng,"")
set_rc(S.runarounds[siding_id].rc .. " shunt_limit")
atc_send("S2")
set_route(hs_sig,hs_route)
end
end
\ No newline at end of file diff --git a/durt/nodes/(-2734,11,891).lua b/durt/nodes/(-2734,11,891).lua deleted file mode 100644 index e69de29..0000000 --- a/durt/nodes/(-2734,11,891).lua +++ /dev/null diff --git a/durt/nodes/(-35,8,-2323).lua b/durt/nodes/(-35,8,-2323).lua deleted file mode 100644 index 401821c..0000000 --- a/durt/nodes/(-35,8,-2323).lua +++ /dev/null @@ -1 +0,0 @@ -F.station("Ghb","W")
\ No newline at end of file diff --git a/durt/nodes/(-3525,8,-2281).lua b/durt/nodes/(-3525,8,-2281).lua deleted file mode 100644 index cb3c02c..0000000 --- a/durt/nodes/(-3525,8,-2281).lua +++ /dev/null @@ -1,8 +0,0 @@ -if event.train then - if not atc_arrow then - atc_send("S1B1") - set_autocouple() - else - digiline_send("lcd",atc_id) - end -end
\ No newline at end of file diff --git a/durt/nodes/(-3530,8,-2267).lua b/durt/nodes/(-3530,8,-2267).lua deleted file mode 100644 index 40c32b6..0000000 --- a/durt/nodes/(-3530,8,-2267).lua +++ /dev/null @@ -1 +0,0 @@ ---control interface
loading_road_control_track = POS(-3544,8,-2277)
entry_exit_road_control = nil --still need to add a track for traffic balancing
if event.ext_int then
digiline_send("train_control_screen",event.message)
return
end
if event.digiline then
if event.channel ~= "train_control" then return end
if event.msg=="rehead" then
digiline_send("train_control_screen","Loco Change Ends")
interrupt_pos(loading_road_control_track,"split_around")
return
end
if event.msg=="depart" then
digiline_send("train_control_screen","Depart via Accelerator")
interrupt_pos(loading_road_control_track,"depart")
return
end
if event.msg=="shuffle_loading" then
digiline_send("train_control_screen","Loading Shuffle")
interrupt_pos(loading_road_control_track,"shuffle")
return
end
return
end
\ No newline at end of file diff --git a/durt/nodes/(-3588,8,-2277).lua b/durt/nodes/(-3588,8,-2277).lua deleted file mode 100644 index fb2ab3a..0000000 --- a/durt/nodes/(-3588,8,-2277).lua +++ /dev/null @@ -1,3 +0,0 @@ -do return end -------------------------------------------------------------------
--West End of Loading Road
local siding_id = "TreeFarm"
local control_interface = POS(-3553,18,-2261)
local hs_sig = POS(-3594,9,-2277)
local hs_route = "Shunt Around Via Loop"
if not S[siding_id] then S[siding_id] = {} end
if not atc_arrow then atc_send("B1") end
if not S[siding_id].yard_active then
if atc_arrow then
S[siding_id].yard_active = true
S[siding_id].info = {
['rc'] = get_rc() or "",
['line'] = get_line() or ""
}
-- set_rc("AROUND") - step_fc()
split_off_locomotive("B0WR")
set_route(hs_sig,hs_route)
atc_send("S4")
end
else
if atc_arrow then -- train has rejoined
atc_send("B0WD2RS1") -- reverse and load train
set_rc(S[siding_id].info.rc)
set_line(S[siding_id].info.line)
unset_autocouple()
interrupt_pos(control_interface,"Train Shunted||Now Loading")
S[siding_id].info.rc = nil
S[siding_id].info.line = nil
S[siding_id].yard_active = nil
end
end
\ No newline at end of file diff --git a/durt/nodes/(-3590,18,-3906).lua b/durt/nodes/(-3590,18,-3906).lua deleted file mode 100644 index f13c279..0000000 --- a/durt/nodes/(-3590,18,-3906).lua +++ /dev/null @@ -1,2 +0,0 @@ --- -F.M27_tracking("DJNC<-->Willow Tunnel")
\ No newline at end of file diff --git a/durt/nodes/(-3593,19,-3930).lua b/durt/nodes/(-3593,19,-3930).lua deleted file mode 100644 index b3993db..0000000 --- a/durt/nodes/(-3593,19,-3930).lua +++ /dev/null @@ -1,2 +0,0 @@ -do return end -local id = "DJnc_4" --change here
if (event.train and atc_arrow) then
setstate(POS(-3596,18,-3927),"st")
if not S.runarounds[id].active then
S.runarounds[id].active = true
atc_set_text_outside("Please Wait\nTrain Changing Ends") --change here
split_off_locomotive("B0WROL")
set_autocouple()
set_rc("runaround") --change here
return
else
S.runarounds[id].active = nil
atc_send("OCB0WRD1SM")
set_rc("sfh_service") --change here
atc_set_text_outside("Sulfur Hills Branch Line -> Sulfur Hills")
set_line("SHBL")
unset_autocouple()
setstate(POS(-3596,18,-3945),"st")
end
end
\ No newline at end of file diff --git a/durt/nodes/(-3596,18,-3920).lua b/durt/nodes/(-3596,18,-3920).lua deleted file mode 100644 index 19149fe..0000000 --- a/durt/nodes/(-3596,18,-3920).lua +++ /dev/null @@ -1,2 +0,0 @@ -do return end -if (event.train and atc_arrow) then
setstate(POS(-3596,18,-3927),"cr")
setstate(POS(-3599,18,-3951),"cr")
atc_send("B0WRD2S4")
end
\ No newline at end of file diff --git a/durt/nodes/(-3596,18,-3930).lua b/durt/nodes/(-3596,18,-3930).lua deleted file mode 100644 index 731b66e..0000000 --- a/durt/nodes/(-3596,18,-3930).lua +++ /dev/null @@ -1 +0,0 @@ -local id = "DJnc_4" --change here
if (event.train and atc_arrow) then
setstate(POS(-3596,18,-3927),"st")
if not S.runarounds[id].active then
S.runarounds[id].active = true
atc_set_text_outside("Please Wait\nTrain Changing Ends") --change here
split_off_locomotive("B0WROL")
set_autocouple()
set_rc("runaround") --change here
return
else
S.runarounds[id].active = nil
atc_send("OCB0WRD1SM")
set_rc("sfh_service") --change here
atc_set_text_outside("Sulfur Hills Branch Line -> Sulfur Hills")
set_line("SHBL")
unset_autocouple()
setstate(POS(-3596,18,-3945),"st")
end
end
\ No newline at end of file diff --git a/durt/nodes/(-3596,8,-2281).lua b/durt/nodes/(-3596,8,-2281).lua deleted file mode 100644 index 230fdd4..0000000 --- a/durt/nodes/(-3596,8,-2281).lua +++ /dev/null @@ -1 +0,0 @@ -control_interface = POS(-3530,8,-2267)
exit_road_signal = POS(-3538,9,-2282)
if event.train then
if not atc_arrow then return end
if atc_speed > 13 then
if can_set_route(exit_road_signal,"Exit to Mainline") then
set_route(exit_road_signal,"Exit to Mainline")
interrupt_pos(control_interface,"Train Merging to Mainline")
return
else
set_route(exit_road_signal,"Train Accelerator Loop")
interrupt_pos(control_interface,"Waiting for Mainline||Unable to set edxit route")
return
end
else
set_route(exit_road_signal,"Train Accelerator Loop")
interrupt_pos(control_interface,"Train too slow to merge||Looping back around")
return
end
end
\ No newline at end of file diff --git a/durt/nodes/(-3597,18,-3926).lua b/durt/nodes/(-3597,18,-3926).lua new file mode 100644 index 0000000..badf4a5 --- /dev/null +++ b/durt/nodes/(-3597,18,-3926).lua @@ -0,0 +1,28 @@ +-- DJNC Runaround +local rejoin_rc = "DJNC_REJOIN" +local runaround_cmd = { + "DJNC_RUNAROUND", --HS_Up access, runaround + "DJNC_HS_D", -- HS_Down access + "DJNC_HS_D_CPL", -- recouple in Up Direction + rejoin_rc -- Up rejoin director +} +__approach_callback_mode = 1 +if event.approach and not event.has_entered then + if not F.has_rc("SFHB") then return end + atc_set_text_inside("Next Station: Desert Junction\nService Terminates Here\nChange Here For Noob Express") + atc_set_lzb_tsr(1) + return +end +if event.train then + if not get_line() == "SFHB" then return end + if not F.has_rc(rejoin_rc) then --train has arrived. Split and run around + atc_set_text_inside("Desert Junction\nService Terminates Here\nChange Here For Noob Express") + split_off_locomotive("A0S0OL") + F.add_rc(runaround_cmd) + return + end + F.remove_rc(runaround_cmd) + atc_send("OCS0WRD5SM") + atc_set_text_inside("") + return +end
\ No newline at end of file diff --git a/durt/nodes/(-3601,18,-3961).lua b/durt/nodes/(-3601,18,-3961).lua deleted file mode 100644 index 84387eb..0000000 --- a/durt/nodes/(-3601,18,-3961).lua +++ /dev/null @@ -1,2 +0,0 @@ --- -F.M27_tracking("DJNC<-->Dcaves")
\ No newline at end of file diff --git a/durt/nodes/(-3602,18,-3962).lua b/durt/nodes/(-3602,18,-3962).lua new file mode 100644 index 0000000..f731225 --- /dev/null +++ b/durt/nodes/(-3602,18,-3962).lua @@ -0,0 +1,46 @@ +-- Automatic bouncer for headshunts, assuming longer headshunt than train length. Arrow points into headshunt +local rev_rc = "DJNC_HS_D" +local rm_rc = true +local autocouple = "DJNC_HS_D_CPL" +local rm_cpl_rc = true + +__approach_callback_mode = 1 + +if event.approach and not event.has_entered then + if not F.has_rc(rev_rc) then return end + atc_set_lzb_tsr(3) + atc_set_ars_disable(true) + return +end + +if event.train then + if not atc_arrow then --train has bounced + if F.has_rc(autocouple) then + atc_send("CplS0WD2S1") + if rm_cpl_rc then F.remove_rc({autocouple}) end + end + return + end + + if not F.has_rc(rev_rc) then --not our train. disregard + atc_set_ars_disable(false) + return + end + F.remove_rc("DJNC_RUNAROUND") + if rm_rc then F.remove_rc({rev_rc}) end + 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/(-3604,18,-3958).lua b/durt/nodes/(-3604,18,-3958).lua deleted file mode 100644 index fa7c445..0000000 --- a/durt/nodes/(-3604,18,-3958).lua +++ /dev/null @@ -1 +0,0 @@ -if (event.train and atc_arrow) then
setstate(POS(-3599,18,-3951),"st")
setstate(POS(-3596,18,-3945),"cr")
atc_send("B0WRD2S1")
end
\ No newline at end of file diff --git a/durt/nodes/(-3670,12,-3742).lua b/durt/nodes/(-3670,12,-3742).lua deleted file mode 100644 index df19540..0000000 --- a/durt/nodes/(-3670,12,-3742).lua +++ /dev/null @@ -1,2 +0,0 @@ --- -F.M27_tracking("Sinensis<-->Willow Tunnel")
\ No newline at end of file diff --git a/durt/nodes/(-3761,12,-3554).lua b/durt/nodes/(-3761,12,-3554).lua deleted file mode 100644 index 118b1c4..0000000 --- a/durt/nodes/(-3761,12,-3554).lua +++ /dev/null @@ -1,2 +0,0 @@ --- -F.M27_tracking("EV_S<-->Sinensis")
\ No newline at end of file diff --git a/durt/nodes/(-3764,12,-3562).lua b/durt/nodes/(-3764,12,-3562).lua deleted file mode 100644 index 118b1c4..0000000 --- a/durt/nodes/(-3764,12,-3562).lua +++ /dev/null @@ -1,2 +0,0 @@ --- -F.M27_tracking("EV_S<-->Sinensis")
\ No newline at end of file diff --git a/durt/nodes/(-3776,11,-4340).lua b/durt/nodes/(-3776,11,-4340).lua deleted file mode 100644 index 228f4d3..0000000 --- a/durt/nodes/(-3776,11,-4340).lua +++ /dev/null @@ -1 +0,0 @@ -if event.train then
if atc_arrow then
atc_send("B1")
--atc_set_text_outside("Unloading Cargo")
F.M27_tracking("Storage Entry")
else
atc_send("SM")
--atc_set_text_outside("M27 Foundries Inc.")
--set_rc("FREIGHT M27 Tanh_loop M27_Foundry autorun M27_tracking")
--set_rc("FREIGHT M27 M27_Quarry autorun M27_tracking")
F.M27_tracking("Storage Exit")
end
end
\ No newline at end of file diff --git a/durt/nodes/(-3818,18,-4761).lua b/durt/nodes/(-3818,18,-4761).lua deleted file mode 100644 index 64f31ae..0000000 --- a/durt/nodes/(-3818,18,-4761).lua +++ /dev/null @@ -1,10 +0,0 @@ -if (event.type == "train") then - local rc = get_rc() - if rc == "sfh_service" then - set_autocouple()
atc_send("B0")
set_rc("sfh_shunt")
interrupt(5, "proceed") - else
atc_send("B0WD3OCRSM") - unset_autocouple() - set_rc("sfh_service") - set_line("SHBL") - atc_set_text_outside("Sulfur Hills Branch Line -> Desert Junction")
end
elseif (event.type == "int") then
set_route("sfh-T1-headshunt", "Enter Headshunt")
split_off_locomotive("B0OL") - setstate("SFH-T2-S", "cr")
atc_send("S2")
end
\ No newline at end of file diff --git a/durt/nodes/(-3820,18,-4728).lua b/durt/nodes/(-3820,18,-4728).lua deleted file mode 100644 index cc4264b..0000000 --- a/durt/nodes/(-3820,18,-4728).lua +++ /dev/null @@ -1,5 +0,0 @@ -if event.train and atc_arrow then - if get_rc() == "sfh_shunt" then - atc_send("S0WRD1S2") - end -end
\ No newline at end of file diff --git a/durt/nodes/(-3820,18,-4730).lua b/durt/nodes/(-3820,18,-4730).lua deleted file mode 100644 index d1f3c8e..0000000 --- a/durt/nodes/(-3820,18,-4730).lua +++ /dev/null @@ -1,8 +0,0 @@ -do return end ---disabled while extension trackwork in progress. Service is stopped anyway - - - -if event.train and atc_arrow and get_rc() == "sfh_shunt" then - setstate("SFH-T1-N", "st")
atc_send("B0WRD1S3") -end
\ No newline at end of file diff --git a/durt/nodes/(-3820,18,-4743).lua b/durt/nodes/(-3820,18,-4743).lua deleted file mode 100644 index 3f5d585..0000000 --- a/durt/nodes/(-3820,18,-4743).lua +++ /dev/null @@ -1,3 +0,0 @@ -if atc_arrow and get_rc() == "sfh_shunt" then - set_rc("sfh_service") -end
\ No newline at end of file diff --git a/durt/nodes/(-3820,18,-4757).lua b/durt/nodes/(-3820,18,-4757).lua deleted file mode 100644 index 2dd69fd..0000000 --- a/durt/nodes/(-3820,18,-4757).lua +++ /dev/null @@ -1,14 +0,0 @@ -if event.train and atc_arrow then - if get_rc() == "sfh_service" then - set_rc("sfh_shunt") - atc_set_text_outside("Sulfur Hills -> Desert Junction") - atc_set_text_inside("Locomotive will return soon\nSulfur Hills -> Desert Junction") - split_off_locomotive("B0WD1OL") - set_autocouple() - set_route("SFH-T1S-sig","Headshunt") - elseif get_rc() =="sfh_shunt" then - atc_send("A0OLBBWRD3OCD1A1S4D10SM") - atc_set_text_inside("") - set_rc("sfh_service") - end -end
\ No newline at end of file diff --git a/durt/nodes/(-3821,18,-4730).lua b/durt/nodes/(-3821,18,-4730).lua deleted file mode 100644 index d1f3c8e..0000000 --- a/durt/nodes/(-3821,18,-4730).lua +++ /dev/null @@ -1,8 +0,0 @@ -do return end ---disabled while extension trackwork in progress. Service is stopped anyway - - - -if event.train and atc_arrow and get_rc() == "sfh_shunt" then - setstate("SFH-T1-N", "st")
atc_send("B0WRD1S3") -end
\ No newline at end of file diff --git a/durt/nodes/(-3821,18,-4761).lua b/durt/nodes/(-3821,18,-4761).lua deleted file mode 100644 index 64f31ae..0000000 --- a/durt/nodes/(-3821,18,-4761).lua +++ /dev/null @@ -1,10 +0,0 @@ -if (event.type == "train") then - local rc = get_rc() - if rc == "sfh_service" then - set_autocouple()
atc_send("B0")
set_rc("sfh_shunt")
interrupt(5, "proceed") - else
atc_send("B0WD3OCRSM") - unset_autocouple() - set_rc("sfh_service") - set_line("SHBL") - atc_set_text_outside("Sulfur Hills Branch Line -> Desert Junction")
end
elseif (event.type == "int") then
set_route("sfh-T1-headshunt", "Enter Headshunt")
split_off_locomotive("B0OL") - setstate("SFH-T2-S", "cr")
atc_send("S2")
end
\ No newline at end of file diff --git a/durt/nodes/(-3823,18,-4774).lua b/durt/nodes/(-3823,18,-4774).lua deleted file mode 100644 index 8ece33e..0000000 --- a/durt/nodes/(-3823,18,-4774).lua +++ /dev/null @@ -1,7 +0,0 @@ -if event.type == "train" and atc_arrow and get_rc() == "sfh_shunt" then - atc_send("B0WRS4") ---setstate("SFH-T2-S", "st") --- interrupt(3, "proceed") ---elseif (event.type == "int") then --- atc_send("R S4") -end
\ No newline at end of file diff --git a/durt/nodes/(-3824,18,-4774).lua b/durt/nodes/(-3824,18,-4774).lua deleted file mode 100644 index 8ece33e..0000000 --- a/durt/nodes/(-3824,18,-4774).lua +++ /dev/null @@ -1,7 +0,0 @@ -if event.type == "train" and atc_arrow and get_rc() == "sfh_shunt" then - atc_send("B0WRS4") ---setstate("SFH-T2-S", "st") --- interrupt(3, "proceed") ---elseif (event.type == "int") then --- atc_send("R S4") -end
\ No newline at end of file diff --git a/durt/nodes/(-3843,20,-4372).lua b/durt/nodes/(-3843,20,-4372).lua deleted file mode 100644 index fa4d49f..0000000 --- a/durt/nodes/(-3843,20,-4372).lua +++ /dev/null @@ -1 +0,0 @@ -if (event.punch or event.channel=="clock") then
--digiline_send("lcd","test")
digiline_send("lcd"," --Foundry Train Status-- \nPrevious: ".. tostring(S.M27_tracking.last or "No Data").."\nCurrent :" ..tostring(S.M27_tracking.now or "No Data"))
end
\ No newline at end of file diff --git a/durt/nodes/(-4002,12,-2768).lua b/durt/nodes/(-4002,12,-2768).lua deleted file mode 100644 index 7d5ef08..0000000 --- a/durt/nodes/(-4002,12,-2768).lua +++ /dev/null @@ -1,2 +0,0 @@ --- -F.M27_tracking("Iceberg On Bamboo")
\ No newline at end of file diff --git a/durt/nodes/(-4117,13,-5765).lua b/durt/nodes/(-4117,13,-5765).lua index 599792f..f1087c7 100644 --- a/durt/nodes/(-4117,13,-5765).lua +++ b/durt/nodes/(-4117,13,-5765).lua @@ -2,6 +2,17 @@ local arrivals_indicator = POS(-4107, 20, -5793) local departures_indicator = POS(-4107, 20, -5791) local road_loco_storage = POS(-4152,13,-5840) + +if event.schedule then + if event.msg=="send_road_loco" then + interrupt_pos(road_loco_storage,"departures") + return + end + return +end +if not event.train then return end + + if not atc_arrow then --clean up RC from directing RC's F.remove_rc_match("DLG_DIR_%S+_N") return @@ -16,8 +27,12 @@ end -- --we'll deal with the yard shunter later if F.has_rc("DLG_SHUNTER") then F.indicator(departures_indicator, true) - interrupt_pos(road_loco_storage,"departures") split_off_locomotive("B0S0A0",1) + schedule_in("0;20","send_road_loco") + local cmd = { + "DLG_HS_N" + } + F.add_rc(cmd) -- if not F.indicator(arrivals_indicator) then --send shunter to its storage siding -- F.add_rc({ -- "DLG_HS_N", diff --git a/durt/nodes/(-4117,16,-5770).lua b/durt/nodes/(-4117,16,-5770).lua deleted file mode 100644 index ee1ea3f..0000000 --- a/durt/nodes/(-4117,16,-5770).lua +++ /dev/null @@ -1 +0,0 @@ -print(get_aspect(POS(-4119,18,-5770)))
\ No newline at end of file diff --git a/durt/nodes/(-4117,16,-5793).lua b/durt/nodes/(-4117,16,-5793).lua deleted file mode 100644 index 8331ec8..0000000 --- a/durt/nodes/(-4117,16,-5793).lua +++ /dev/null @@ -1,2 +0,0 @@ -do return end -if event.train then print(atc_id) end
\ No newline at end of file diff --git a/durt/nodes/(-4120,13,-5818).lua b/durt/nodes/(-4120,13,-5818).lua index ae273e3..2f93993 100644 --- a/durt/nodes/(-4120,13,-5818).lua +++ b/durt/nodes/(-4120,13,-5818).lua @@ -25,7 +25,8 @@ if event.train then split_off_locomotive("B0S0", 3) local cmd = { "DLG_HS_S", - "DLG_HS_KICKBACK", + "DLG_HS_Transfer_S_N2", + "DLG_HS_N2", "DLG_Loco_Storage" } F.add_rc(cmd) --send the road loco to collect departures or storage diff --git a/durt/nodes/(-4125,13,-5731).lua b/durt/nodes/(-4125,13,-5731).lua index c3fcc71..3a8d669 100644 --- a/durt/nodes/(-4125,13,-5731).lua +++ b/durt/nodes/(-4125,13,-5731).lua @@ -1,4 +1,5 @@ -- Automatic bouncer for headshunts, assuming longer headshunt than train length. Arrow points into headshunt +-- Modified to bounce all trains. RC Removal still works though local rev_rc = "DLG_HS_N" local rm_rc = true local autocouple = "DLG_HS_N_AC" @@ -26,10 +27,10 @@ if event.train then return end - if not F.has_rc(rev_rc) then --not our train. disregard - atc_set_ars_disable(false) - return - end +-- if not F.has_rc(rev_rc) then --not our train. disregard +-- atc_set_ars_disable(false) +-- return +-- end if rm_rc then F.remove_rc({rev_rc}) end schedule_in(";01",atc_id) return diff --git a/durt/nodes/(-4127,5,-5624).lua b/durt/nodes/(-4127,5,-5624).lua deleted file mode 100644 index d30218f..0000000 --- a/durt/nodes/(-4127,5,-5624).lua +++ /dev/null @@ -1,24 +0,0 @@ -local lights = { - POS(-4131,5,-5623), - POS(-4127,5,-5623), - POS(-4127,5,-5617), - POS(-4131,5,-5617) -} - -if event.train then - if atc_arrow then - schedule_in(";05",true) - return - end -end - -if event.schedule then - if atc_id then - schedule_in(";05",true) - return - else - for _,v in pairs(lights) do - setstate(v,"off") - end - end -end
\ No newline at end of file diff --git a/durt/nodes/(-4128,5,-5630).lua b/durt/nodes/(-4128,5,-5630).lua deleted file mode 100644 index ef978ad..0000000 --- a/durt/nodes/(-4128,5,-5630).lua +++ /dev/null @@ -1,21 +0,0 @@ -local pt = POS(-4129,5,-5628) -local bt = POS(-4132,4,-5626) -local dir = "l" -if event.train then - if atc_arrow then - setstate(pt,dir) - setstate(bt,"on") - atc_send("S5") - schedule_in(";05",true) - end -end - -if event.schedule then - if atc_id then - schedule_in(";05",true) - return - else - setstate(bt,"off") - return - end -end
\ No newline at end of file diff --git a/durt/nodes/(-4128,6,-5692).lua b/durt/nodes/(-4128,6,-5692).lua deleted file mode 100644 index 19d83df..0000000 --- a/durt/nodes/(-4128,6,-5692).lua +++ /dev/null @@ -1,20 +0,0 @@ -if atc_arrow then - if get_rc():match("DLG_shunt") then - atc_send("BBWRSM") - F.remove_rc({"DLG_shunt"},true) - else - atc_send("BB") - end -end - -if event.channel=="train_ctl" and event.msg=="send" then - if not atc_id or not atc_arrow then - digiline_send("error","Error "..os.time().."\nArrow:"..tostring(atc_arrow).."\nID:"..tostring(atc_id)) - return - end - atc_send("S3") - set_rc((get_rc() or "").." DLG_shunt") - split_at_index(2,"BB") - set_autocouple() - return -end
\ No newline at end of file diff --git a/durt/nodes/(-4129,13,-5726).lua b/durt/nodes/(-4129,13,-5726).lua deleted file mode 100644 index 2f179db..0000000 --- a/durt/nodes/(-4129,13,-5726).lua +++ /dev/null @@ -1,28 +0,0 @@ -if event.train then - if atc_arrow then - if F.has_rc("DLG_exit_north") then - F.remove_rc({"DLG_exit_north"}) - return - end - if F.has_rc("DLG_north_reverse") then - schedule_in(";01",atc_id) - return - end - else - if F.has_rc("DLG_north_reverse_couple") then - atc_send("CplD1S2") - return - end - 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,"S0WRS3") - return - end -end
\ No newline at end of file diff --git a/durt/nodes/(-4129,16,-5745).lua b/durt/nodes/(-4129,16,-5745).lua deleted file mode 100644 index 7ba350f..0000000 --- a/durt/nodes/(-4129,16,-5745).lua +++ /dev/null @@ -1,14 +0,0 @@ -local signal = POS(-4128,16,-5754) -if event.train and atc_arrow then - local rc = (get_rc() or "") - if rc:match("DLG_shunt_platforms") then - atc_send("B0WD2A0RS3CplS1") - if rc:match("DLG_shunt_Platform1") then - set_route(signal,"SHUNT Platform 1") - return - elseif rc:match("DLG_shunt_Platform2") then - set_route(signal,"SHUNT Platform 2") - return - end - end -end
\ No newline at end of file diff --git a/durt/nodes/(-4129,16,-5802).lua b/durt/nodes/(-4129,16,-5802).lua deleted file mode 100644 index 2e1142d..0000000 --- a/durt/nodes/(-4129,16,-5802).lua +++ /dev/null @@ -1,26 +0,0 @@ -local split_indicator = POS(-4128,17,-5768) -__approach_callback_mode = 1 - -if event.approach and not event.has_entered then - if get_line() ~= "DLG_OFB" then return end - - atc_set_ars_disable(true) - atc_set_lzb_tsr(1) -end - -if event.train then - if get_line() ~= "DLG_OFB" then return end - if not atc_arrow then return end - local state = getstate(split_indicator) - if state == "red" then - split_off_locomotive("A0B0OL",1) - atc_send("S3") - atc_set_ars_disable(false) - setstate(split_indicator,"green") - set_rc((get_rc() or "").." DLG_south_reverse DLG_around_short DLG_north_reverse DLG_shunt_platforms DLG_shunt_Platform2") - elseif state == "green" then - atc_send("B0WROCA1D2S4D10SM") - setstate(split_indicator,"red") - F.remove_rc({"DLG_south_reverse","DLG_around_long","DLG_north_reverse","DLG_shunt_platforms","DLG_shunt_Platform2"}) - end -end
\ No newline at end of file diff --git a/durt/nodes/(-4129,5,-5616).lua b/durt/nodes/(-4129,5,-5616).lua deleted file mode 100644 index d30218f..0000000 --- a/durt/nodes/(-4129,5,-5616).lua +++ /dev/null @@ -1,24 +0,0 @@ -local lights = { - POS(-4131,5,-5623), - POS(-4127,5,-5623), - POS(-4127,5,-5617), - POS(-4131,5,-5617) -} - -if event.train then - if atc_arrow then - schedule_in(";05",true) - return - end -end - -if event.schedule then - if atc_id then - schedule_in(";05",true) - return - else - for _,v in pairs(lights) do - setstate(v,"off") - end - end -end
\ No newline at end of file diff --git a/durt/nodes/(-4129,5,-5624).lua b/durt/nodes/(-4129,5,-5624).lua deleted file mode 100644 index d30218f..0000000 --- a/durt/nodes/(-4129,5,-5624).lua +++ /dev/null @@ -1,24 +0,0 @@ -local lights = { - POS(-4131,5,-5623), - POS(-4127,5,-5623), - POS(-4127,5,-5617), - POS(-4131,5,-5617) -} - -if event.train then - if atc_arrow then - schedule_in(";05",true) - return - end -end - -if event.schedule then - if atc_id then - schedule_in(";05",true) - return - else - for _,v in pairs(lights) do - setstate(v,"off") - end - end -end
\ No newline at end of file diff --git a/durt/nodes/(-4129,5,-5626).lua b/durt/nodes/(-4129,5,-5626).lua deleted file mode 100644 index 2dd69c1..0000000 --- a/durt/nodes/(-4129,5,-5626).lua +++ /dev/null @@ -1,12 +0,0 @@ -local lights = { - POS(-4131,5,-5623), - POS(-4127,5,-5623), - POS(-4127,5,-5617), - POS(-4131,5,-5617) -} - -if event.train and atc_arrow then - for _,v in pairs(lights) do - setstate(v,"on") - end -end diff --git a/durt/nodes/(-4129,5,-5630).lua b/durt/nodes/(-4129,5,-5630).lua deleted file mode 100644 index 26a4ecb..0000000 --- a/durt/nodes/(-4129,5,-5630).lua +++ /dev/null @@ -1,21 +0,0 @@ -local pt = POS(-4129,5,-5628) -local bt = POS(-4132,4,-5626) -local dir = "s" -if event.train then - if atc_arrow then - setstate(pt,dir) - setstate(bt,"on") - atc_send("S5") - schedule_in(";05",true) - end -end - -if event.schedule then - if atc_id then - schedule_in(";05",true) - return - else - setstate(bt,"off") - return - end -end
\ No newline at end of file diff --git a/durt/nodes/(-4129,9,-5588).lua b/durt/nodes/(-4129,9,-5588).lua deleted file mode 100644 index 86a9f95..0000000 --- a/durt/nodes/(-4129,9,-5588).lua +++ /dev/null @@ -1,44 +0,0 @@ -local lights = { - POS(-4131,5,-5623), - POS(-4127,5,-5623), - POS(-4127,5,-5617), - POS(-4131,5,-5617) -} -local pt = POS(-4129,5,-5628) -local bt = POS(-4132,4,-5626) - -if event.train then - if atc_arrow then - for _,v in pairs(lights) do - setstate(v,"on") - end - if getstate(bt)=="on" then - atc_send("BB") - schedule_in(";05",true) - else - if (get_rc() or ""):match("CAN_corn") then - setstate(pt,"r") - atc_send("B1") - else - setstate(pt,"s") - atc_send("S3") - end - end - else - if tostring(get_rc() or ""):match("DLG_shunt") then - atc_send("S3D5S0WRD1S3") - else - atc_send("SM") - end - end -end - -if event.schedule then - if getstate(bt)=="on" then - atc_send("BB") - schedule_in(";05",true) - else - setstate(pt,"r") - atc_send("S3") - end -end
\ No newline at end of file diff --git a/durt/nodes/(-4130,5,-5630).lua b/durt/nodes/(-4130,5,-5630).lua deleted file mode 100644 index 0045f17..0000000 --- a/durt/nodes/(-4130,5,-5630).lua +++ /dev/null @@ -1,21 +0,0 @@ -local pt = POS(-4129,5,-5628) -local bt = POS(-4132,4,-5626) -local dir = "r" -if event.train then - if atc_arrow then - setstate(pt,dir) - setstate(bt,"on") - atc_send("S5") - schedule_in(";05",true) - end -end - -if event.schedule then - if atc_id then - schedule_in(";05",true) - return - else - setstate(bt,"off") - return - end -end
\ No newline at end of file diff --git a/durt/nodes/(-4132,6,-5690).lua b/durt/nodes/(-4132,6,-5690).lua deleted file mode 100644 index a30b837..0000000 --- a/durt/nodes/(-4132,6,-5690).lua +++ /dev/null @@ -1,20 +0,0 @@ -if atc_arrow then - if get_rc():match("DLG_shunt") then - atc_send("BBWRSM") - F.remove_rc({"DLG_shunt"},true) - else - atc_send("BB") - end -end - -if event.channel=="train_ctl" and event.msg=="send" then - if not atc_id or not atc_arrow then - digiline_send("error","Error "..os.time()) - return - end - atc_send("S3") - set_rc((get_rc() or "").." DLG_shunt") - split_at_index(2,"BB") - set_autocouple() - return -end
\ No newline at end of file diff --git a/durt/nodes/(-4134,5,-5629).lua b/durt/nodes/(-4134,5,-5629).lua deleted file mode 100644 index 7dab90e..0000000 --- a/durt/nodes/(-4134,5,-5629).lua +++ /dev/null @@ -1,14 +0,0 @@ -local lights = { - POS(-4131,5,-5623), - POS(-4127,5,-5623), - POS(-4127,5,-5617), - POS(-4131,5,-5617) -} - -if event.train then - if atc_arrow then - for _,v in pairs(lights) do - setstate(v,"on") - end - end -end
\ No newline at end of file diff --git a/durt/nodes/(-4134,5,-5631).lua b/durt/nodes/(-4134,5,-5631).lua deleted file mode 100644 index d30218f..0000000 --- a/durt/nodes/(-4134,5,-5631).lua +++ /dev/null @@ -1,24 +0,0 @@ -local lights = { - POS(-4131,5,-5623), - POS(-4127,5,-5623), - POS(-4127,5,-5617), - POS(-4131,5,-5617) -} - -if event.train then - if atc_arrow then - schedule_in(";05",true) - return - end -end - -if event.schedule then - if atc_id then - schedule_in(";05",true) - return - else - for _,v in pairs(lights) do - setstate(v,"off") - end - end -end
\ No newline at end of file diff --git a/durt/nodes/(-4135,16,-5809).lua b/durt/nodes/(-4135,16,-5809).lua deleted file mode 100644 index 28ae5f2..0000000 --- a/durt/nodes/(-4135,16,-5809).lua +++ /dev/null @@ -1,27 +0,0 @@ -local split_indicator = POS(-4134,17,-5811) -__approach_callback_mode = 1 - -if event.approach and not event.has_entered then - if not F.has_rc("DLG_ArcRun") then return end - - atc_set_ars_disable(true) - atc_set_lzb_tsr(1) -end - -if event.train then - if not F.has_rc("DLG_ArcRun") then return end - if not atc_arrow then return end - local state = getstate(split_indicator) - if state == "red" then - split_off_locomotive("A0B0OL",1) - atc_send("S3") - atc_set_ars_disable(false) - setstate(split_indicator,"green") - set_rc(F.get_rc_safe().." DLG_south_reverse DLG_around_long DLG_north_reverse DLG_north_reverse_couple DLG_shunt_platforms DLG_shunt_Freight2") - elseif state == "green" then - atc_send("B0WROCA1D2S4") - setstate(split_indicator,"red") - F.remove_rc({"DLG_south_reverse","DLG_around_long","DLG_north_reverse_couple","DLG_shunt_Freight2"}) - set_rc(F.get_rc_safe().." DLG_shunt_Freight4") - end -end
\ No newline at end of file diff --git a/durt/nodes/(-4138,13,-5778).lua b/durt/nodes/(-4138,13,-5778).lua new file mode 100644 index 0000000..7d57cd6 --- /dev/null +++ b/durt/nodes/(-4138,13,-5778).lua @@ -0,0 +1,7 @@ +print(rwt.to_string(rwt.now())) +local fc_array = get_fc() +for idx,list in ipairs(fc_array) do + fc_array[idx] = list:split("!",true) +end +print(fc_array) +print(get_fc_index())
\ No newline at end of file diff --git a/durt/nodes/(-4142,17,-5792).lua b/durt/nodes/(-4142,17,-5792).lua deleted file mode 100644 index a82d158..0000000 --- a/durt/nodes/(-4142,17,-5792).lua +++ /dev/null @@ -1,4 +0,0 @@ -if event.punch then - interrupt_pos(POS(-4144,16,-5792)) -end -
\ No newline at end of file diff --git a/durt/nodes/(-4142,17,-5841).lua b/durt/nodes/(-4142,17,-5841).lua deleted file mode 100644 index 24270e4..0000000 --- a/durt/nodes/(-4142,17,-5841).lua +++ /dev/null @@ -1,24 +0,0 @@ -if event.train then - if atc_arrow then - if F.has_rc("DLG_south_reverse") then - schedule_in(";01",atc_id) - return - end - else - if F.has_rc("DLG_south_reverse_couple") then - atc_send("CplD1S2") - return - end - 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,"S0WRS3") - return - end -end
\ No newline at end of file diff --git a/durt/nodes/(-4144,13,-5793).lua b/durt/nodes/(-4144,13,-5793).lua new file mode 100644 index 0000000..059c6ef --- /dev/null +++ b/durt/nodes/(-4144,13,-5793).lua @@ -0,0 +1,45 @@ +-- Automatic bouncer for headshunts, assuming longer headshunt than train length. Arrow points into headshunt +local rev_rc = "DLG_HS_N2" +local rm_rc = true +local autocouple = "DLG_HS_N2_AC" +local rm_cpl_rc = true + + +__approach_callback_mode = 1 + +if event.approach and not event.has_entered then + atc_set_lzb_tsr(3) + atc_set_ars_disable(true) + return +end + +if event.train then + if not atc_arrow then --train has bounced + if F.has_rc(autocouple) then + atc_send("CplS0WD2S1") + if rm_cpl_rc then F.remove_rc({autocouple}) end + end + return + end + + if not F.has_rc(rev_rc) then --not our train. disregard + atc_set_ars_disable(false) + return + end + if rm_rc then F.remove_rc({rev_rc}) end + 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/(-4144,16,-5792).lua b/durt/nodes/(-4144,16,-5792).lua deleted file mode 100644 index 53bf8c4..0000000 --- a/durt/nodes/(-4144,16,-5792).lua +++ /dev/null @@ -1,19 +0,0 @@ -if event.ext_int then - if not atc_id then - print("No train") - return - end - F.remove_rc({"DLG_north_reverse","DLG_shunt_platforms","DLG_shunt_Freight4"}) - F.add_rc("DLG_exit_north") - atc_send("I+S0WR;S4D10SM") - print("Train departing DLG\nTrain id: "..atc_id) -end - -__approach_callback_mode = 1 -if event.approach and not event.has_entered then - atc_set_lzb_tsr(1) -end - -if event.train and atc_arrow then - atc_send("S1") -end
\ No newline at end of file diff --git a/durt/nodes/(-4146,16,-5793).lua b/durt/nodes/(-4146,16,-5793).lua deleted file mode 100644 index a82d158..0000000 --- a/durt/nodes/(-4146,16,-5793).lua +++ /dev/null @@ -1,4 +0,0 @@ -if event.punch then - interrupt_pos(POS(-4144,16,-5792)) -end -
\ No newline at end of file diff --git a/durt/nodes/(-4147,19,-5792).lua b/durt/nodes/(-4147,19,-5792).lua deleted file mode 100644 index c53ad9d..0000000 --- a/durt/nodes/(-4147,19,-5792).lua +++ /dev/null @@ -1,3 +0,0 @@ -local track = POS(-4144,16,-5792) -local message = "ArcRun" -if event.punch then interrupt_pos(track,message) end
\ No newline at end of file diff --git a/durt/nodes/(-4152,13,-5840).lua b/durt/nodes/(-4152,13,-5840).lua index 2611c48..8ef8f3d 100644 --- a/durt/nodes/(-4152,13,-5840).lua +++ b/durt/nodes/(-4152,13,-5840).lua @@ -35,13 +35,14 @@ local function send_train() end --no departures to collect, go straight to TYARD set_rc(table.concat(cmd," ")) - atc_send("S0WRD2A1S4") + atc_send("I+S0WR;D2A1S4") F.indicator(TYARD_notify_indicator,false) return true end if event.schedule then - if event.message == "check_again" then + print(rwt.to_string(rwt.now())..tostring(event.msg)) + if event.msg == "check_again" then if not send_train() then --will either send train or continue clock schedule_in("1;0","check_again") return diff --git a/durt/nodes/(-4158,12,-2742).lua b/durt/nodes/(-4158,12,-2742).lua deleted file mode 100644 index b18dc7f..0000000 --- a/durt/nodes/(-4158,12,-2742).lua +++ /dev/null @@ -1 +0,0 @@ ---Still need to convert to a function rather than trackside
local hs_sig = "TheStacks_hs"
local hs_route = "Right to Wye"
local exit_sig = "TheStacks_exit"
local exit_route = "Exit to Mainline"
local siding_id = "TheStacks"
local length_prefix = "Loco"
if (event.train and atc_arrow) then
local rc = get_rc() or " "
-- the RC that controls the link to split
-- rc value: "<rc><num_wagons to shunt with>" default is single loco
-- eg "Loco2" for tenders, "Loco3" for
local loco_pos = rc:match(length_prefix.."%d+") or length_prefix.."1"
loco_pos = tonumber(loco_pos:match("%d+"))+1
if not S.runarounds[siding_id].shunting then -- train to be split
--store info for later re-insertion
S.runarounds[siding_id] = {
['shunting'] = true,
['rc'] = rc,
['line'] = get_line() or " "
}
atc_send("B0S0")
interrupt(5,{['cmd'] = "split", ['leng'] = loco_pos})
-- change int time if needed, depends on approach speed slowdown
else -- train has rejoined
--re-insert info to train
if S.runarounds[siding_id].rc then set_rc(S.runarounds[siding_id].rc) end
if S.runarounds[siding_id].line then set_line(S.runarounds[siding_id].line) end
--depart
atc_send("B0S0WD1RSM")
set_route(exit_sig,exit_route)
S.runarounds[siding_id].shunting = false
end
end
if event.int then
if event.msg.cmd=="split" then
cmd = event.msg
split_at_index(cmd.leng,"")
atc_send("S2")
set_route(hs_sig,hs_route)
end
end
\ No newline at end of file diff --git a/durt/nodes/(-4181,13,-5787).lua b/durt/nodes/(-4181,13,-5787).lua new file mode 100644 index 0000000..15a77da --- /dev/null +++ b/durt/nodes/(-4181,13,-5787).lua @@ -0,0 +1,16 @@ +if not atc_arrow then return end +if F.has_rc("COLLECT") then atc_send("B2CplS2") return end +local options = { + {route = "SHUNT Centre", section = "250710"}, + {route = "SHUNT Right", section = "403524"}, + {route = "SHUNT Left", section = "779419"}, + {route = "SHUNT Far Right", section = "810627"}, +} +for _,v in ipairs(options) do + if not section_occupancy(v.section)[1] then + set_route(POS(-4183,13,-5788),v.route) + atc_set_ars_disable(true) + return + end +end +print("No automatic routes available. Check manually")
\ No newline at end of file diff --git a/durt/nodes/(-4197,13,-5781).lua b/durt/nodes/(-4197,13,-5781).lua new file mode 100644 index 0000000..4f3ca65 --- /dev/null +++ b/durt/nodes/(-4197,13,-5781).lua @@ -0,0 +1,7 @@ +if atc_arrow then + if not F.has_rc("COLLECT") then + split_off_locomotive("A0B0") + end + atc_set_ars_disable(false) + return +end
\ No newline at end of file diff --git a/durt/nodes/(-4197,13,-5784).lua b/durt/nodes/(-4197,13,-5784).lua new file mode 100644 index 0000000..4f3ca65 --- /dev/null +++ b/durt/nodes/(-4197,13,-5784).lua @@ -0,0 +1,7 @@ +if atc_arrow then + if not F.has_rc("COLLECT") then + split_off_locomotive("A0B0") + end + atc_set_ars_disable(false) + return +end
\ No newline at end of file diff --git a/durt/nodes/(-4197,13,-5787).lua b/durt/nodes/(-4197,13,-5787).lua new file mode 100644 index 0000000..4f3ca65 --- /dev/null +++ b/durt/nodes/(-4197,13,-5787).lua @@ -0,0 +1,7 @@ +if atc_arrow then + if not F.has_rc("COLLECT") then + split_off_locomotive("A0B0") + end + atc_set_ars_disable(false) + return +end
\ No newline at end of file diff --git a/durt/nodes/(-4197,13,-5790).lua b/durt/nodes/(-4197,13,-5790).lua new file mode 100644 index 0000000..4f3ca65 --- /dev/null +++ b/durt/nodes/(-4197,13,-5790).lua @@ -0,0 +1,7 @@ +if atc_arrow then + if not F.has_rc("COLLECT") then + split_off_locomotive("A0B0") + end + atc_set_ars_disable(false) + return +end
\ No newline at end of file diff --git a/durt/nodes/(-4599,7,-6502).lua b/durt/nodes/(-4599,7,-6502).lua deleted file mode 100644 index 748b242..0000000 --- a/durt/nodes/(-4599,7,-6502).lua +++ /dev/null @@ -1,24 +0,0 @@ -if event.train then - if atc_arrow == true then - if F.has_rc("BFT_Mainline_Headshunt") then - atc_send("S2") - schedule_in(";01",atc_id) - return - end - else - if F.has_rc("BFT_rejoin_from_north") then - atc_send("CplS1") - return - end - end -end - -if event.schedule then - if atc_id and event.msg == atc_id then - schedule_in(";01",event.msg) - return - else - atc_send_to_train(event.msg,"S0WRS3") - 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 deleted file mode 100644 index 4a4dcb0..0000000 --- a/durt/nodes/(-4623,7,-6597).lua +++ /dev/null @@ -1,35 +0,0 @@ -local split_indicator = POS(-4627,8,-6597) -__approach_callback_mode = 1 - -local shunt_actions = { - "BFT_Siding_B", - "BFT_shunt_platforms", - "BFT_shunt_around_Track2", - "BFT_Mainline_Headshunt", - "BFT_rejoin_from_north", - "BFT_Platform1" -} - -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("A0B0OR",1) - atc_send("S3") - atc_set_ars_disable(false) - setstate(split_indicator,"on") - set_rc(F.get_rc_safe() .." ".. table.concat(shunt_actions," ")) - elseif state == "on" then - atc_send("I>1B0ES0;WROCA1D2S4D10SM") - setstate(split_indicator,"off") - F.remove_rc(shunt_actions) - end -end
\ No newline at end of file diff --git a/durt/nodes/(-4626,7,-6638).lua b/durt/nodes/(-4626,7,-6638).lua deleted file mode 100644 index b22f859..0000000 --- a/durt/nodes/(-4626,7,-6638).lua +++ /dev/null @@ -1,19 +0,0 @@ -local signal = POS(-4626,7,-6616) -if event.train and atc_arrow then - if F.has_rc("BFT_shunt_platforms") then - local control = {"A0S0WD2RA1"} - if F.has_rc("BFT_shunt_Platform1") then - set_route(signal,"SHUNT Platform 1") - control[2] = "S3CplS1" - elseif F.has_rc("BFT_shunt_Track2") then - set_route(signal,"SHUNT Track 2") - control[2] = "S3CplS1" - elseif F.has_rc("BFT_shunt_around_Track2") then - set_route(signal,"Around via Track 2") - control[2] = "S4" - end - control = table.concat(control,"") - atc_send(control) - return - end -end
\ No newline at end of file diff --git a/durt/nodes/(-4818,13,-6820).lua b/durt/nodes/(-4818,13,-6820).lua new file mode 100644 index 0000000..526cb6d --- /dev/null +++ b/durt/nodes/(-4818,13,-6820).lua @@ -0,0 +1,46 @@ +-- Automatic bouncer for headshunts, assuming longer headshunt than train length. Arrow points into headshunt +local rev_rc = "KKD_HS_U" +local rm_rc = true +local autocouple = "KKD_HS_U_CPL" +local rm_cpl_rc = true + +__approach_callback_mode = 1 + +if event.approach and not event.has_entered then + if not F.has_rc(rev_rc) then return end + atc_set_lzb_tsr(3) + atc_set_ars_disable(true) + return +end + +if event.train then + if not atc_arrow then --train has bounced + if F.has_rc(autocouple) then + atc_send("CplS0WD2S1") + if rm_cpl_rc then F.remove_rc({autocouple}) end + end + return + end + + if not F.has_rc(rev_rc) then --not our train. disregard + atc_set_ars_disable(false) + return + end + F.remove_rc("KKD_RUNAROUND") + if rm_rc then F.remove_rc({rev_rc}) end + 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/(-4896,13,-6820).lua b/durt/nodes/(-4896,13,-6820).lua new file mode 100644 index 0000000..103c52f --- /dev/null +++ b/durt/nodes/(-4896,13,-6820).lua @@ -0,0 +1,28 @@ +-- KKD Runaround +local rejoin_rc = "KKD_REJOIN" +local runaround_cmd = { + "KKD_RUNAROUND", --HS_Down access, runaround + "KKD_HS_U", -- HS_Up access + "KKD_HS_U_CPL", -- recouple in Down Direction + rejoin_rc -- Down rejoin director +} +__approach_callback_mode = 1 +if event.approach and not event.has_entered then + if not F.has_rc("SFHB") then return end + atc_set_text_inside("Next Station: Kokardine\nService Terminates Here") + atc_set_lzb_tsr(1) + return +end +if event.train then + if not get_line() == "SFHB" then return end + if not F.has_rc(rejoin_rc) then --train has arrived. Split and run around + atc_set_text_inside("Kokardine\nService Terminates Here") + split_off_locomotive("A0S0OL") + F.add_rc(runaround_cmd) + return + end + F.remove_rc(runaround_cmd) + atc_send("OCS0WRD5SM") + atc_set_text_inside("") + return +end
\ No newline at end of file diff --git a/durt/nodes/(-541,26,2469).lua b/durt/nodes/(-541,26,2469).lua deleted file mode 100644 index ea080ea..0000000 --- a/durt/nodes/(-541,26,2469).lua +++ /dev/null @@ -1 +0,0 @@ --- 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 deleted file mode 100644 index d5d7bd4..0000000 --- a/durt/nodes/(-541,26,2472).lua +++ /dev/null @@ -1 +0,0 @@ --- 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 deleted file mode 100644 index 58c5e8b..0000000 --- a/durt/nodes/(-541,26,2475).lua +++ /dev/null @@ -1 +0,0 @@ --- 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 deleted file mode 100644 index 90eb7a9..0000000 --- a/durt/nodes/(-549,26,2478).lua +++ /dev/null @@ -1 +0,0 @@ ---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/(-571,26,2515).lua b/durt/nodes/(-571,26,2515).lua new file mode 100644 index 0000000..17d8bf3 --- /dev/null +++ b/durt/nodes/(-571,26,2515).lua @@ -0,0 +1,2 @@ +if not (event.name == "Maverick2797" or event.name=="Wile-E-Coyote") then return end +interrupt_pos(POS(-630,26,2454), "notify")
\ No newline at end of file diff --git a/durt/nodes/(-585,26,2478).lua b/durt/nodes/(-585,26,2478).lua deleted file mode 100644 index f79b2c9..0000000 --- a/durt/nodes/(-585,26,2478).lua +++ /dev/null @@ -1 +0,0 @@ ---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",3)
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/(-615,26,2475).lua b/durt/nodes/(-615,26,2475).lua deleted file mode 100644 index 96871b7..0000000 --- a/durt/nodes/(-615,26,2475).lua +++ /dev/null @@ -1,7 +0,0 @@ -__approach_callback_mode = 1 -if event.approach and not event.has_entered then - atc_set_lzb_tsr(1) -end -if event.train and atc_arrow then - atc_send("S1") -end
\ No newline at end of file diff --git a/durt/nodes/(-620,26,2464).lua b/durt/nodes/(-620,26,2464).lua deleted file mode 100644 index cb7688f..0000000 --- a/durt/nodes/(-620,26,2464).lua +++ /dev/null @@ -1,9 +0,0 @@ -__approach_callback_mode = 1 - -if event.approach and not event.has_entered then - atc_set_lzb_tsr(1) -end -if event.train and atc_arrow then - atc_send("S1") -end -if event.digiline and event.channel=="trainctl" then atc_send("I+S0WR;D1S3") end
\ No newline at end of file diff --git a/durt/nodes/(-621,26,2469).lua b/durt/nodes/(-621,26,2469).lua deleted file mode 100644 index 80f4e52..0000000 --- a/durt/nodes/(-621,26,2469).lua +++ /dev/null @@ -1 +0,0 @@ --- 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 deleted file mode 100644 index de4552e..0000000 --- a/durt/nodes/(-621,26,2472).lua +++ /dev/null @@ -1 +0,0 @@ --- 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 deleted file mode 100644 index 35e4773..0000000 --- a/durt/nodes/(-621,26,2475).lua +++ /dev/null @@ -1 +0,0 @@ --- 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 deleted file mode 100644 index 2b808a1..0000000 --- a/durt/nodes/(-638,26,2475).lua +++ /dev/null @@ -1 +0,0 @@ ---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 deleted file mode 100644 index 1158ddb..0000000 --- a/durt/nodes/(-646,26,2469).lua +++ /dev/null @@ -1,6 +0,0 @@ --- -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 deleted file mode 100644 index 9d4e471..0000000 --- a/durt/nodes/(-678,20,2478).lua +++ /dev/null @@ -1,3 +0,0 @@ -do return end --- 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/(-716,3,1894).lua b/durt/nodes/(-716,3,1894).lua index 7345c4a..01123f0 100644 --- a/durt/nodes/(-716,3,1894).lua +++ b/durt/nodes/(-716,3,1894).lua @@ -1,4 +1,4 @@ if event then return end --temporarily disable the track ------------------------------------------------------------------------------------------- -factory_exit_sig = "icebreaker_factory_exit"
inside_maniest = "Cargo: Empty\nOrigin: Icebreaker Factory\nDestination: Auto Plantation"
outside_naming = "DURT Logs to Diamond Conversion Train"
mainline_rc = "autorun FREIGHT"
mainline_ln = "Maverick2797_diamonds"
if event.train then
digiline_send("train_response","Train "..atc_id.." ready||Entered factory:||Speed: "..atc_speed)
set_line(mainline_ln)
set_rc(mainline_rc)
atc_set_text_outside(outside_naming)
atc_set_text_inside(inside_maniest)
end
if event.digiline then
if event.channel=="train_control" then
if not atc_id then
digiline_send("train_response","No Train Detected")
return
end
if event.msg=="shuffle" then
if atc_speed > 0 then
digiline_send("train_response","Please wait:||train still moving||Speed: "..atc_speed)
return
elseif not can_set_route(factory_exit_sig,"Reverse to Breaker-side Siding") then
digiline_send("train_response","Unable to set route to:||Breaker-side Siding")
return
else
set_route(factory_exit_sig,"Reverse to Breaker-side Siding")
atc_send("R S1 D5 SM D13 S0 W R S1")
digiline_send("train_response","Refilling Input Chests||Shuffling Train")
return
end
return
elseif event.msg=="exit" then
if atc_speed > 0 then
digiline_send("train_response","Please wait:||train still moving||Speed: "..atc_speed)
return
elseif not can_set_route(factory_exit_sig,"Exit to Mainline South") then
digiline_send("train_response","Unable to set route to:||Mainline South")
return
else
set_route(factory_exit_sig,"Exit to Mainline South")
atc_send("R SM")
digiline_send("train_response","Train Departing")
return
end
return
elseif event.msg=="rehead" then
if atc_speed > 0 then
digiline_send("train_response","Please wait:||train still moving||Speed: "..atc_speed)
return
elseif not can_set_route(factory_exit_sig,"Reverse for loco run-around") then
digiline_send("train_response","Unable to set route to:||Loco Run Around Sequence")
return
else
set_route(factory_exit_sig,"Reverse for loco run-around")
set_rc("split_around")
atc_send("R SM D15 S0 W R S1")
digiline_send("train_response","Loco Changind Ends")
return
end
return
end
return
end
return
end
\ No newline at end of file +factory_exit_sig = "icebreaker_factory_exit"
inside_maniest = "Cargo: Empty\nOrigin: Icebreaker Factory\nDestination: Auto Plantation"
outside_naming = "DURT Logs to Diamond Conversion Train"
mainline_rc = "autorun FREIGHT"
mainline_ln = "Maverick2797_diamonds"
if event.train then
digiline_send("train_response","Train "..atc_id.." ready||Entered factory:||Speed: "..atc_speed)
set_line(mainline_ln)
set_rc(mainline_rc)
atc_set_text_outside(outside_naming)
atc_set_text_inside(inside_maniest)
end
if event.digiline then
if event.channel=="train_control" then
if not atc_id then
digiline_send("train_response","No Train Detected")
return
end
if event.msg=="shuffle" then
if atc_speed > 0 then
digiline_send("train_response","Please wait:||train still moving||Speed: "..atc_speed)
return
elseif not can_set_route(factory_exit_sig,"Reverse to Breaker-side Siding") then
digiline_send("train_response","Unable to set route to:||Breaker-side Siding")
return
else
set_route(factory_exit_sig,"Reverse to Breaker-side Siding")
atc_send("R S1 D5 SM D13 S0 W R S1")
digiline_send("train_response","Refilling Input Chests||Shuffling Train")
return
end
return
elseif event.msg=="exit" then
if atc_speed > 0 then
digiline_send("train_response","Please wait:||train still moving||Speed: "..atc_speed)
return
elseif not can_set_route(factory_exit_sig,"Exit to Mainline South") then
digiline_send("train_response","Unable to set route to:||Mainline South")
return
else
set_route(factory_exit_sig,"Exit to Mainline South")
atc_send("R SM")
digiline_send("train_response","Train Departing")
return
end
return
elseif event.msg=="rehead" then
if atc_speed > 0 then
digiline_send("train_response","Please wait:||train still moving||Speed: "..atc_speed)
return
elseif not can_set_route(factory_exit_sig,"Reverse for loco run-around") then
digiline_send("train_response","Unable to set route to:||Loco Run Around Sequence")
return
else
set_route(factory_exit_sig,"Reverse for loco run-around")
set_rc("split_around")
atc_send("R SM D15 S0 W R S1")
digiline_send("train_response","Loco Changing Ends")
return
end
return
end
return
end
return
end
\ No newline at end of file diff --git a/durt/nodes/(-736,3,1857).lua b/durt/nodes/(-736,3,1857).lua deleted file mode 100644 index b40529e..0000000 --- a/durt/nodes/(-736,3,1857).lua +++ /dev/null @@ -1 +0,0 @@ -mainline_rc = "autorun FREIGHT"
mainline_ln = "Maverick2797_diamonds"
function speed_check()
if atc_speed > 0 then
interrupt(1,"speed_check")
return
else
interrupt(1,"split_train")
return
end
end
if event.train then
if atc_arrow then
if get_rc()=="split_around" then
if atc_speed > 0 then
speed_check()
end
return
else
set_rc(mainline_rc)
set_line(mainline_ln)
set_route("icebreaker_shunt1","return to factory")
atc_send("S3")
return
end
return
end
return
end
if event.int then
if event.message == "speed_check" then speed_check() end
if event.message=="split_train" then
atc_send("S0")
split_at_index(2,"")
set_route("icebreaker_shunt1","split->headhunt")
atc_send("S3")
return
end
return
end
\ No newline at end of file diff --git a/durt/nodes/(-743,18,2424).lua b/durt/nodes/(-743,18,2424).lua new file mode 100644 index 0000000..3c5008c --- /dev/null +++ b/durt/nodes/(-743,18,2424).lua @@ -0,0 +1,46 @@ +-- Automatic bouncer for headshunts, assuming longer headshunt than train length. Arrow points into headshunt +local rev_rc = "CAN_REENTER_YARD" +local rm_rc = true +-- local autocouple = "ARC_LOAD_HS_N_AC" +-- local rm_cpl_rc = true + +__approach_callback_mode = 1 + +if event.approach and not event.has_entered then + if not F.has_rc("CAN_REENTER_YARD") then return end + atc_set_lzb_tsr(3) + atc_set_ars_disable(true) + return +end + +if event.train then + if not atc_arrow then --train has bounced + -- if F.has_rc(autocouple) then + -- atc_send("CplS0WD2S1") + -- if rm_cpl_rc then F.remove_rc({autocouple}) end + -- end + return + end + + if not F.has_rc(rev_rc) then --not our train. disregard + atc_set_ars_disable(false) + return + end + if rm_rc then F.remove_rc({rev_rc}) end + atc_send("S3") + 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/(-743,3,1888).lua b/durt/nodes/(-743,3,1888).lua deleted file mode 100644 index 7489acc..0000000 --- a/durt/nodes/(-743,3,1888).lua +++ /dev/null @@ -1 +0,0 @@ ---
\ No newline at end of file diff --git a/durt/nodes/(-759,3,1861).lua b/durt/nodes/(-759,3,1861).lua deleted file mode 100644 index 117ee31..0000000 --- a/durt/nodes/(-759,3,1861).lua +++ /dev/null @@ -1,6 +0,0 @@ -if (event.train and atc_arrow) then - set_rc("merge_from_shunt") - atc_set_text_inside("merge_from_shunt") - atc_send("S0WRS3") - return -end
\ No newline at end of file diff --git a/durt/nodes/(-799,3,1863).lua b/durt/nodes/(-799,3,1863).lua deleted file mode 100644 index 77cc579..0000000 --- a/durt/nodes/(-799,3,1863).lua +++ /dev/null @@ -1 +0,0 @@ -if event.train then
if get_rc() ~= "mainline_running_code" then
set_rc("mainline_running_code")
atc_set_text_inside("mainline_running_code")
atc_send("S0WRS3")
return
end
return
end
if event.digiline then
if event.msg=="switch_ends" then
if not atc_id then return end
if atc_speed > 0 then return end
atc_send("S0")
interrupt(1,"braking delay")
return
end
return
end
if event.int then
if event.message=="braking delay" then
split_at_index(2,"")
set_route(POS(-802,4,1864),"to wye")
interrupt(1,"split delay")
return
end
if event.message=="split delay" then
atc_set_text_inside("engine")
atc_send("S3")
return
end
return
end
\ No newline at end of file diff --git a/durt/nodes/(139,8,-2054).lua b/durt/nodes/(139,8,-2054).lua deleted file mode 100644 index da88c32..0000000 --- a/durt/nodes/(139,8,-2054).lua +++ /dev/null @@ -1 +0,0 @@ -F.station("Gcl","W")
\ No newline at end of file diff --git a/durt/nodes/(151,8,-2046).lua b/durt/nodes/(151,8,-2046).lua deleted file mode 100644 index 24a6c0b..0000000 --- a/durt/nodes/(151,8,-2046).lua +++ /dev/null @@ -1 +0,0 @@ -F.station("Gcl","E")
\ No newline at end of file diff --git a/durt/nodes/(1704,17,4652).lua b/durt/nodes/(1704,17,4652).lua new file mode 100644 index 0000000..ca0506c --- /dev/null +++ b/durt/nodes/(1704,17,4652).lua @@ -0,0 +1,44 @@ +-- Automatic bouncer for headshunts, assuming longer headshunt than train length. Arrow points into headshunt +local rev_rc = "MCR_HS_W" +local rm_rc = true +local autocouple = "MCR_HS_W_AC" +local rm_cpl_rc = true + +__approach_callback_mode = 1 + +if event.approach and not event.has_entered then + atc_set_lzb_tsr(3) + atc_set_ars_disable(true) + return +end + +if event.train then + if not atc_arrow then --train has bounced + if F.has_rc(autocouple) then + atc_send("CplS0WD2S1") + if rm_cpl_rc then F.remove_rc({autocouple}) end + end + return + end + -- -- commented out as we want all trains to bounce here + -- if not F.has_rc(rev_rc) then --not our train. disregard + -- atc_set_ars_disable(false) + -- return + -- end + if rm_rc then F.remove_rc({rev_rc}) end + 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/(1710,17,4637).lua b/durt/nodes/(1710,17,4637).lua new file mode 100644 index 0000000..69bc3a1 --- /dev/null +++ b/durt/nodes/(1710,17,4637).lua @@ -0,0 +1,17 @@ +-- MCR Arrivals track +local rc = "MCR_runaround" +local list = { + rc, + "MCR_HS_W", + "MCR_HS_E", + "MCR_HS_E_AC" +} +if not F.has_rc(rc) then + split_off_locomotive("A0B0") + F.add_rc(list) + set_route(POS(1706,18,4638), "Headshunt") + atc_send("A1S3") + return +end +F.remove_rc(list) +atc_send("A0S0WD5RS2")
\ No newline at end of file diff --git a/durt/nodes/(1740,17,4636).lua b/durt/nodes/(1740,17,4636).lua new file mode 100644 index 0000000..3bab629 --- /dev/null +++ b/durt/nodes/(1740,17,4636).lua @@ -0,0 +1,15 @@ +if event.train then + if not atc_arrow then return end + local fc = split_at_fc("A0B0", 2) + local cmd = { + "MCR_HS_E", + "MCR_HS_E_AC", + "MCR_DIR_"..fc + } + if #section_occupancy("115343") == 1 then + table.insert(cmd, "MCR_LAST_SORT") + end + F.add_rc(cmd) + atc_send("A1S3") + return +end
\ No newline at end of file diff --git a/durt/nodes/(-3594,18,-3954).lua b/durt/nodes/(1742,17,4642).lua index 7489acc..7489acc 100644 --- a/durt/nodes/(-3594,18,-3954).lua +++ b/durt/nodes/(1742,17,4642).lua diff --git a/durt/nodes/(-3642,18,-4002).lua b/durt/nodes/(1751,17,4655).lua index 7489acc..7489acc 100644 --- a/durt/nodes/(-3642,18,-4002).lua +++ b/durt/nodes/(1751,17,4655).lua diff --git a/durt/nodes/(1759,17,4623).lua b/durt/nodes/(1759,17,4623).lua new file mode 100644 index 0000000..c8a4bbd --- /dev/null +++ b/durt/nodes/(1759,17,4623).lua @@ -0,0 +1,44 @@ +-- Automatic bouncer for headshunts, assuming longer headshunt than train length. Arrow points into headshunt +local rev_rc = "MCR_HS_E" +local rm_rc = true +local autocouple = "MCR_HS_E_AC" +local rm_cpl_rc = true + +__approach_callback_mode = 1 + +if event.approach and not event.has_entered then + atc_set_lzb_tsr(3) + atc_set_ars_disable(true) + return +end + +if event.train then + if not atc_arrow then --train has bounced + if F.has_rc(autocouple) then + atc_send("CplS0WD2S1") + if rm_cpl_rc then F.remove_rc({autocouple}) end + end + return + end + + if not F.has_rc(rev_rc) then --not our train. disregard + atc_set_ars_disable(false) + return + end + if rm_rc then F.remove_rc({rev_rc}) end + 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/(-4138,16,-5809).lua b/durt/nodes/(1780,18,4595).lua index 7489acc..7489acc 100644 --- a/durt/nodes/(-4138,16,-5809).lua +++ b/durt/nodes/(1780,18,4595).lua diff --git a/durt/nodes/(1852,8,9034).lua b/durt/nodes/(1852,8,9034).lua deleted file mode 100644 index 7489acc..0000000 --- a/durt/nodes/(1852,8,9034).lua +++ /dev/null @@ -1 +0,0 @@ ---
\ No newline at end of file diff --git a/durt/nodes/(1858,17,4242).lua b/durt/nodes/(1858,17,4242).lua index 4f60fe8..e40678b 100644 --- a/durt/nodes/(1858,17,4242).lua +++ b/durt/nodes/(1858,17,4242).lua @@ -67,14 +67,28 @@ if event.schedule then if not F.has_rc("OAF_BRANCH_REVERSE_RECOUPLED") then if dir == "SHOVE" then -- loco first into platform, run around to shove out -- split_off_locomotive("S0OLA0",2) --ideally each pax wagon has a generic FC, but not likely as few people use them at all - split_at_index(2,"S0OLA0") - atc_send("S3") - F.add_rc(movelist[dir]) + if train_length() > 1 then + split_at_index(2,"B0S0OLA0") + atc_send("S3") + F.add_rc(movelist[dir]) + else + -- don't bother splitting, there's nothing to split anyway! + -- depart light (fallback) + F.add_rc("OAF_BRANCH_REVERSE_DONE") --triggers the ARS to depart + atc_send("SM") + print("DEPARTING LIGHT") + end else --dir == "HEAD" --shoved into platform, run around to put loco first F.add_rc(movelist[dir]) - split_at_index(train_length(),"S0WRA1S3") - F.remove_rc(movelist[dir]) - atc_send("S0WROR") + if train_length() > 1 then + split_at_index(train_length(),"S0WRA1S3") + F.remove_rc(movelist[dir]) + atc_send("S0WROR") + else --don't bother splitting, there's nothing to split anyway! + F.add_rc("OAF_BRANCH_REVERSE_DONE") --triggers the ARS to depart + atc_send("SM") + print("DEPARTING LIGHT") + end end print("SPLIT") return diff --git a/durt/nodes/(1864,17,4296).lua b/durt/nodes/(1864,17,4296).lua index b0f62d1..1f0d6ff 100644 --- a/durt/nodes/(1864,17,4296).lua +++ b/durt/nodes/(1864,17,4296).lua @@ -67,14 +67,28 @@ if event.schedule then if not F.has_rc("OAF_BRANCH_REVERSE_RECOUPLED") then if dir == "SHOVE" then -- loco first into platform, run around to shove out -- split_off_locomotive("S0OLA0",2) --ideally each pax wagon has a generic FC, but not likely as few people use them at all - split_at_index(2,"S0OLA0") - atc_send("S3") - F.add_rc(movelist[dir]) + if train_length() > 1 then + split_at_index(2,"B0S0OLA0") + atc_send("S3") + F.add_rc(movelist[dir]) + else + -- don't bother splitting, there's nothing to split anyway! + -- depart light (fallback) + F.add_rc("OAF_BRANCH_REVERSE_DONE") --triggers the ARS to depart + atc_send("SM") + print("DEPARTING LIGHT") + end else --dir == "HEAD" --shoved into platform, run around to put loco first F.add_rc(movelist[dir]) - split_at_index(train_length(),"S0WRA1S3") - F.remove_rc(movelist[dir]) - atc_send("S0WROR") + if train_length() > 1 then + split_at_index(train_length(),"S0WRA1S3") + F.remove_rc(movelist[dir]) + atc_send("S0WROR") + else --don't bother splitting, there's nothing to split anyway! + F.add_rc("OAF_BRANCH_REVERSE_DONE") --triggers the ARS to depart + atc_send("SM") + print("DEPARTING LIGHT") + end end print("SPLIT") return diff --git a/durt/nodes/(1894,23,4548).lua b/durt/nodes/(1894,23,4548).lua index 5245388..c27d386 100644 --- a/durt/nodes/(1894,23,4548).lua +++ b/durt/nodes/(1894,23,4548).lua @@ -7,6 +7,7 @@ end if event.train then if not atc_arrow then return end if not F.has_rc("OAF_BRANCH_REVERSE") then return end + atc_send("S2") schedule_in(";01",atc_id) print("start ping") return @@ -18,7 +19,7 @@ if event.schedule then return end print("end ping") - atc_send_to_train(event.msg, "S0WRD2SM") + atc_send_to_train(event.msg, "B0WRD2SM") local newstate = getstate(POS(1894, 21, 4548)) setstate(POS(1892, 23, 4547)) return diff --git a/durt/nodes/(1904,7,9133).lua b/durt/nodes/(1904,7,9133).lua deleted file mode 100644 index 64329a2..0000000 --- a/durt/nodes/(1904,7,9133).lua +++ /dev/null @@ -1 +0,0 @@ -local yard_id = "WOA"
__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 then
local init = false
if not S.WOA_stats then
S.WOA_stats = true
init = true
end
F.stat("WOA_mine",init)
end
\ No newline at end of file diff --git a/durt/nodes/(1904,8,9057).lua b/durt/nodes/(1904,8,9057).lua deleted file mode 100644 index 0851b53..0000000 --- a/durt/nodes/(1904,8,9057).lua +++ /dev/null @@ -1,17 +0,0 @@ -__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.add_rc("WOA_ttb_s") - else - F.add_rc("WOA_shed_left") - end - end - atc_set_ars_disable(false) -end
\ No newline at end of file diff --git a/durt/nodes/(1905,0,9143).lua b/durt/nodes/(1905,0,9143).lua deleted file mode 100644 index 500f0a0..0000000 --- a/durt/nodes/(1905,0,9143).lua +++ /dev/null @@ -1,5 +0,0 @@ -if event.punch then - S.yards.WOA.mine_count = 1 - print("WOA Mine: reset counter") - digiline_send("train_ctl","send") -end
\ No newline at end of file diff --git a/durt/nodes/(1907,9,9129).lua b/durt/nodes/(1907,9,9129).lua deleted file mode 100644 index e4e4500..0000000 --- a/durt/nodes/(1907,9,9129).lua +++ /dev/null @@ -1,3 +0,0 @@ -local yard_id = "WOA"
if event.schedule then
local now = rwt.now()
local last = S.yards[yard_id].last_pass1
local dtime = rwt.diff(last,now)
local rtt = rwt.diff(S.yards[yard_id].last_pass2,last)
digiline_send("lcd",string.format("Now: %s |Last Pass: %s |ID: %s Delta: %s |TBT: %s ",rwt.to_string(now),rwt.to_string(last),S.yards.WOA.last_id,rwt.to_string(dtime),rwt.to_string(rtt)))
schedule(rwt.next_rpt(rwt.now(), "0;05", 0))
end
if event.punch then - schedule(rwt.next_rpt(rwt.now(), "0;05", 0)) - if S.WOA_stats == true then S.WOA_stats = false end
end
\ No newline at end of file diff --git a/durt/nodes/(1909,8,9115).lua b/durt/nodes/(1909,8,9115).lua deleted file mode 100644 index 224bafc..0000000 --- a/durt/nodes/(1909,8,9115).lua +++ /dev/null @@ -1,5 +0,0 @@ -do return end - - - -local foundry_track = POS(-1962,13,-1709)
local warmoneaye_track = POS(1918,7,9099)
if event.ext_int then
if type(event.msg) == "string" then digiline_send("lcd",event.msg) end
if type(event.msg) == "table" then
local m = event.msg
local location = m.location
local message = m.msg
digiline_send(location,message)
return
end
end
if event.digiline then
if event.channel=="send" then
-- interrupt_pos(foundry_track,"send")
interrupt_pos(warmoneaye_track,"send")
end
end
if event.punch then
digiline_send("Foundry","test")
digiline_send("Warmoneaye","test")
end
\ No newline at end of file diff --git a/durt/nodes/(1918,7,9099).lua b/durt/nodes/(1918,7,9099).lua deleted file mode 100644 index 3df43db..0000000 --- a/durt/nodes/(1918,7,9099).lua +++ /dev/null @@ -1 +0,0 @@ -local location = "Warmoneaye"
local ctl_pan = POS(1919,7,9093)
local signal = POS(1919,10,9094)
local route = "Exit South"
err = interrupt_pos
if event.ext_int then
if not atc_id then
err(ctl_pan,{['location'] = location, ['msg'] = " | No Train"})
end
if event.msg == "send" then
set_route(signal,route)
if atc_arrow then
atc_send("SM")
else
atc_send("S0WRSM")
end
end
end
\ No newline at end of file diff --git a/durt/nodes/(1918,7,9147).lua b/durt/nodes/(1918,7,9147).lua deleted file mode 100644 index 7489acc..0000000 --- a/durt/nodes/(1918,7,9147).lua +++ /dev/null @@ -1 +0,0 @@ ---
\ No newline at end of file diff --git a/durt/nodes/(1921,7,9148).lua b/durt/nodes/(1921,7,9148).lua deleted file mode 100644 index 7489acc..0000000 --- a/durt/nodes/(1921,7,9148).lua +++ /dev/null @@ -1 +0,0 @@ ---
\ No newline at end of file diff --git a/durt/nodes/(1950,7,9108).lua b/durt/nodes/(1950,7,9108).lua deleted file mode 100644 index a3a64b6..0000000 --- a/durt/nodes/(1950,7,9108).lua +++ /dev/null @@ -1 +0,0 @@ -interrupt_pos(POS(1949,7,9112),"send")
\ No newline at end of file diff --git a/durt/nodes/(258,2,-2054).lua b/durt/nodes/(258,2,-2054).lua deleted file mode 100644 index 23e79be..0000000 --- a/durt/nodes/(258,2,-2054).lua +++ /dev/null @@ -1 +0,0 @@ -F.station("Sfs","W")
\ No newline at end of file diff --git a/durt/nodes/(273,2,-2046).lua b/durt/nodes/(273,2,-2046).lua deleted file mode 100644 index 36cbad2..0000000 --- a/durt/nodes/(273,2,-2046).lua +++ /dev/null @@ -1 +0,0 @@ -F.station("Sfs","E")
\ No newline at end of file diff --git a/durt/nodes/(363,-3,-2026).lua b/durt/nodes/(363,-3,-2026).lua deleted file mode 100644 index a15195a..0000000 --- a/durt/nodes/(363,-3,-2026).lua +++ /dev/null @@ -1 +0,0 @@ -F.station("Jms","W")
\ No newline at end of file diff --git a/durt/nodes/(377,-3,-2018).lua b/durt/nodes/(377,-3,-2018).lua deleted file mode 100644 index a06c323..0000000 --- a/durt/nodes/(377,-3,-2018).lua +++ /dev/null @@ -1 +0,0 @@ -F.station("Jms","E")
\ No newline at end of file diff --git a/durt/nodes/(430,17,19).lua b/durt/nodes/(430,17,19).lua deleted file mode 100644 index ed65c79..0000000 --- a/durt/nodes/(430,17,19).lua +++ /dev/null @@ -1 +0,0 @@ -local line = "S23"
if event.punch or (event.channel=="clock" and event.msg=="pulse")then
digiline_send("status_update",S.lines[line].monitoring)
end
\ No newline at end of file diff --git a/durt/nodes/(430,17,7).lua b/durt/nodes/(430,17,7).lua deleted file mode 100644 index 07c8260..0000000 --- a/durt/nodes/(430,17,7).lua +++ /dev/null @@ -1 +0,0 @@ -local line = "U21"
if event.punch or (event.channel=="clock" and event.msg=="pulse")then
digiline_send("status_update",S.lines[line].monitoring)
end
\ No newline at end of file diff --git a/durt/nodes/(501,-3,-2026).lua b/durt/nodes/(501,-3,-2026).lua deleted file mode 100644 index 708c331..0000000 --- a/durt/nodes/(501,-3,-2026).lua +++ /dev/null @@ -1 +0,0 @@ -F.station("Bam","W")
\ No newline at end of file diff --git a/durt/nodes/(515,-3,-2018).lua b/durt/nodes/(515,-3,-2018).lua deleted file mode 100644 index ef7d6a4..0000000 --- a/durt/nodes/(515,-3,-2018).lua +++ /dev/null @@ -1 +0,0 @@ -F.station("Bam","E")
\ No newline at end of file diff --git a/durt/nodes/(596,-3,-1963).lua b/durt/nodes/(596,-3,-1963).lua deleted file mode 100644 index ef232c3..0000000 --- a/durt/nodes/(596,-3,-1963).lua +++ /dev/null @@ -1 +0,0 @@ -F.station("Cli","W")
\ No newline at end of file diff --git a/durt/nodes/(608,-3,-1957).lua b/durt/nodes/(608,-3,-1957).lua deleted file mode 100644 index 37f35ff..0000000 --- a/durt/nodes/(608,-3,-1957).lua +++ /dev/null @@ -1 +0,0 @@ -F.station("Cli","E")
\ No newline at end of file diff --git a/durt/nodes/(686,-3,-1961).lua b/durt/nodes/(686,-3,-1961).lua deleted file mode 100644 index 94c23fb..0000000 --- a/durt/nodes/(686,-3,-1961).lua +++ /dev/null @@ -1 +0,0 @@ -F.station("Wat","W")
\ No newline at end of file diff --git a/durt/nodes/(698,-3,-1959).lua b/durt/nodes/(698,-3,-1959).lua deleted file mode 100644 index f646518..0000000 --- a/durt/nodes/(698,-3,-1959).lua +++ /dev/null @@ -1 +0,0 @@ -F.station("Wat","E")
\ No newline at end of file diff --git a/durt/nodes/(74,8,-2124).lua b/durt/nodes/(74,8,-2124).lua deleted file mode 100644 index 4589804..0000000 --- a/durt/nodes/(74,8,-2124).lua +++ /dev/null @@ -1 +0,0 @@ -F.station("Dri","E")
\ No newline at end of file diff --git a/durt/nodes/(74,8,-2297).lua b/durt/nodes/(74,8,-2297).lua deleted file mode 100644 index 02cba9c..0000000 --- a/durt/nodes/(74,8,-2297).lua +++ /dev/null @@ -1 +0,0 @@ -F.station("Ged","E")
\ No newline at end of file diff --git a/durt/nodes/(770,6,-1938).lua b/durt/nodes/(770,6,-1938).lua deleted file mode 100644 index af2e64f..0000000 --- a/durt/nodes/(770,6,-1938).lua +++ /dev/null @@ -1 +0,0 @@ -F.station("Duf", "W")
\ No newline at end of file diff --git a/durt/nodes/(771,25,8503).lua b/durt/nodes/(771,25,8503).lua deleted file mode 100644 index 58252f0..0000000 --- a/durt/nodes/(771,25,8503).lua +++ /dev/null @@ -1,3 +0,0 @@ -if atc_arrow == true and get_line() == "DTLS1" then - atc_set_text_outside("DTL S1 -> Azena Transirejo") -end
\ No newline at end of file diff --git a/durt/nodes/(78,8,-2139).lua b/durt/nodes/(78,8,-2139).lua deleted file mode 100644 index d16d287..0000000 --- a/durt/nodes/(78,8,-2139).lua +++ /dev/null @@ -1 +0,0 @@ -F.station("Dri","W")
\ No newline at end of file diff --git a/durt/nodes/(78,8,-2312).lua b/durt/nodes/(78,8,-2312).lua deleted file mode 100644 index 6a061ac..0000000 --- a/durt/nodes/(78,8,-2312).lua +++ /dev/null @@ -1 +0,0 @@ -F.station("Ged","W")
\ No newline at end of file diff --git a/durt/nodes/(782,6,-1930).lua b/durt/nodes/(782,6,-1930).lua deleted file mode 100644 index 56e8aa5..0000000 --- a/durt/nodes/(782,6,-1930).lua +++ /dev/null @@ -1 +0,0 @@ -F.station("Duf","E")
\ No newline at end of file |