diff options
29 files changed, 158 insertions, 63 deletions
diff --git a/auto_yards/init_code.lua b/auto_yards/init_code.lua index f3b4282..3d442bc 100644 --- a/auto_yards/init_code.lua +++ b/auto_yards/init_code.lua @@ -86,8 +86,9 @@ if event.init then S.known_trains = { ['120684'] = "LHF #1", --Maverick2797 ['249165'] = "LHF #2", --Maverick2797 - ['734206'] = "ARC-BY", --Maverick2797 + ['368003'] = "ARC-BY", --Maverick2797 ['588750'] = "MMF-TY", --survivalg/erstazi + ['879136'] = "ERS-SNS", --erstazi ['543381'] = "WOA-IP", --Maverick2797 ['834721'] = "S27-ARC", --Maverick2797 ['513598'] = "S27EX-ARC", --Maverick2797 diff --git a/auto_yards/nodes/(-1933,16,806).lua b/auto_yards/nodes/(-1932,16,807).lua index 4503e25..4503e25 100644 --- a/auto_yards/nodes/(-1933,16,806).lua +++ b/auto_yards/nodes/(-1932,16,807).lua diff --git a/auto_yards/nodes/(-1938,16,805).lua b/auto_yards/nodes/(-1937,16,806).lua index 4503e25..4503e25 100644 --- a/auto_yards/nodes/(-1938,16,805).lua +++ b/auto_yards/nodes/(-1937,16,806).lua diff --git a/auto_yards/nodes/(-1946,16,801).lua b/auto_yards/nodes/(-1945,16,802).lua index 4503e25..4503e25 100644 --- a/auto_yards/nodes/(-1946,16,801).lua +++ b/auto_yards/nodes/(-1945,16,802).lua diff --git a/auto_yards/nodes/(-1954,16,797).lua b/auto_yards/nodes/(-1953,16,798).lua index 4503e25..4503e25 100644 --- a/auto_yards/nodes/(-1954,16,797).lua +++ b/auto_yards/nodes/(-1953,16,798).lua diff --git a/durt/init_code.lua b/durt/init_code.lua index cf4207c..291285a 100644 --- a/durt/init_code.lua +++ b/durt/init_code.lua @@ -1,9 +1,5 @@ --[[ Misc Code ]]-- -S.runarounds = { - ["M27_Breaker_Factory"] = {}, - ["DJnc_4"] = {}, -} if event.init then local list_of_yards = { ["WOA"] = {}, diff --git a/durt/nodes/(-1973,16,800).lua b/durt/nodes/(-1973,16,800).lua index 5456ccc..e886d2b 100644 --- a/durt/nodes/(-1973,16,800).lua +++ b/durt/nodes/(-1973,16,800).lua @@ -34,7 +34,7 @@ local function send_train() "ARC_LOAD", --trigger the loading track } elseif #section_occupancy(sections.departures) > 0 then - if print_notification then print(rwt.to_string(rwt.now()).. " "..notification_id.." send_train() has local job from STORE_4") end + if print_notification then print(rwt.to_string(rwt.now()).. " "..notification_id.." send_train() has local job from DEPARTURES") end cmd = { -- collect wagons from BYARD, and park loco in loco siding if no departures at ARC "FREIGHT", "ARC_LOCOSTORE", 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/(-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/(-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/(-3642,18,-4002).lua b/durt/nodes/(-3642,18,-4002).lua deleted file mode 100644 index 7489acc..0000000 --- a/durt/nodes/(-3642,18,-4002).lua +++ /dev/null @@ -1 +0,0 @@ ---
\ 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,-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/(-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/(-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/(-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/far/nodes/(1753,8,1570).lua b/far/nodes/(1753,8,1570).lua index e6e9bd4..de0abbe 100644 --- a/far/nodes/(1753,8,1570).lua +++ b/far/nodes/(1753,8,1570).lua @@ -7,7 +7,7 @@ F.save_train(POS(1755,8,1570), "west") F.ttp_begin({ stn = "Salt Factory", -- station name tt = "FAR_E", -- timetable ID - depint = "13;00", --departure slot interval + depint = "12;00", --departure slot interval depoff = "00;00", --departure slot offset doorside = "L", reverse = true, diff --git a/far/nodes/(30856,15,1814).lua b/far/nodes/(30856,15,1814).lua index f8811e3..21c8a05 100644 --- a/far/nodes/(30856,15,1814).lua +++ b/far/nodes/(30856,15,1814).lua @@ -7,7 +7,7 @@ F.save_train(POS(30856,15,1814), "east") F.ttp_begin({ stn = "Fareast End", -- station name tt = "FAR_W", -- timetable ID - depint = "13;00", --departure slot interval + depint = "12;00", --departure slot interval depoff = "00;00", --departure slot offset doorside = "R", reverse = false, diff --git a/far/nodes/(30863,15,1807).lua b/far/nodes/(30863,15,1807).lua index 955f13d..bdcac10 100644 --- a/far/nodes/(30863,15,1807).lua +++ b/far/nodes/(30863,15,1807).lua @@ -7,7 +7,7 @@ F.save_train(POS(30863,15,1807), "east") F.ttp_begin({ stn = "Fareast End", -- station name tt = "FAR_W", -- timetable ID - depint = "13;00", --departure slot interval + depint = "12;00", --departure slot interval depoff = "00;00", --departure slot offset doorside = "R", reverse = false, diff --git a/far/nodes/(30870,15,1800).lua b/far/nodes/(30870,15,1800).lua index 13f4924..60180b5 100644 --- a/far/nodes/(30870,15,1800).lua +++ b/far/nodes/(30870,15,1800).lua @@ -7,7 +7,7 @@ F.save_train(POS(30870,15,1800), "east") F.ttp_begin({ stn = "Fareast End", -- station name tt = "FAR_W", -- timetable ID - depint = "13;00", --departure slot interval + depint = "12;00", --departure slot interval depoff = "00;00", --departure slot offset doorside = "R", reverse = false, diff --git a/il_timetable/nodes/(-1937,21,-4581).lua b/il_timetable/nodes/(-1937,21,-4581).lua index 007736b..fcdffda 100644 --- a/il_timetable/nodes/(-1937,21,-4581).lua +++ b/il_timetable/nodes/(-1937,21,-4581).lua @@ -8,5 +8,6 @@ F.ttp_station_display({ -- interval = 15, display1 = "d1", -- display2 = "d2", + --show_trainid = true, }) end
\ No newline at end of file diff --git a/il_timetable/nodes/(1199,18,6127).lua b/il_timetable/nodes/(1187,21,6115).lua index 47bed36..47bed36 100644 --- a/il_timetable/nodes/(1199,18,6127).lua +++ b/il_timetable/nodes/(1187,21,6115).lua diff --git a/il_timetable/nodes/(983,22,1053).lua b/il_timetable/nodes/(983,22,1053).lua index 23b5dea..860f22a 100644 --- a/il_timetable/nodes/(983,22,1053).lua +++ b/il_timetable/nodes/(983,22,1053).lua @@ -1 +1 @@ -S.ttt["187794"] = nil
\ No newline at end of file +S.ttt["506708"] = nil
\ No newline at end of file diff --git a/subway/nodes/(-1392,13,-321).lua b/subway/nodes/(-1392,13,-321).lua deleted file mode 100644 index 4de8346..0000000 --- a/subway/nodes/(-1392,13,-321).lua +++ /dev/null @@ -1 +0,0 @@ -F.stn_return_free("LihXN", "Lhsw", "st")
\ No newline at end of file |