diff options
author | autocommitter <autocommitter@linux-forks.de> | 2025-01-20 00:00:02 +0100 |
---|---|---|
committer | autocommitter <autocommitter@linux-forks.de> | 2025-01-20 00:00:02 +0100 |
commit | a3c95401b9081bb86e09fa96407bb5a09952c6c2 (patch) | |
tree | 051ecfe11551f8f455807d4ca2e17a2193be8525 /durt/nodes | |
parent | 0d20b500624044368cade4514087b8fb7a564bc9 (diff) | |
download | luaatc_envs-a3c95401b9081bb86e09fa96407bb5a09952c6c2.tar.gz luaatc_envs-a3c95401b9081bb86e09fa96407bb5a09952c6c2.tar.bz2 luaatc_envs-a3c95401b9081bb86e09fa96407bb5a09952c6c2.zip |
State at 2025-01-20
Diffstat (limited to 'durt/nodes')
-rw-r--r-- | durt/nodes/(-1973,16,800).lua | 2 | ||||
-rw-r--r-- | durt/nodes/(-3593,19,-3930).lua | 2 | ||||
-rw-r--r-- | durt/nodes/(-3596,18,-3920).lua | 2 | ||||
-rw-r--r-- | durt/nodes/(-3597,18,-3926).lua | 28 | ||||
-rw-r--r-- | durt/nodes/(-3602,18,-3962).lua | 46 | ||||
-rw-r--r-- | durt/nodes/(-3604,18,-3958).lua | 1 | ||||
-rw-r--r-- | durt/nodes/(-3642,18,-4002).lua | 1 | ||||
-rw-r--r-- | durt/nodes/(-3818,18,-4761).lua | 10 | ||||
-rw-r--r-- | durt/nodes/(-3820,18,-4728).lua | 5 | ||||
-rw-r--r-- | durt/nodes/(-3820,18,-4757).lua | 14 | ||||
-rw-r--r-- | durt/nodes/(-3821,18,-4730).lua | 8 | ||||
-rw-r--r-- | durt/nodes/(-3823,18,-4774).lua | 7 | ||||
-rw-r--r-- | durt/nodes/(-4818,13,-6820).lua | 46 | ||||
-rw-r--r-- | durt/nodes/(-4896,13,-6820).lua | 28 | ||||
-rw-r--r-- | durt/nodes/(-716,3,1894).lua | 2 |
15 files changed, 150 insertions, 52 deletions
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 |