diff options
author | autocommitter <autocommitter@linux-forks.de> | 2024-04-22 14:57:48 +0200 |
---|---|---|
committer | autocommitter <autocommitter@linux-forks.de> | 2024-04-22 14:57:48 +0200 |
commit | 68dd87842504e16bd25b33500b80f7c0d3e4f7f0 (patch) | |
tree | fcb8b989a0dc4fb56d762249c826298f1ee9e2f9 /auto_yards | |
parent | f7b6c1d04fe86be0d71b1936f1e7df4ad8a486db (diff) | |
download | luaatc_envs-68dd87842504e16bd25b33500b80f7c0d3e4f7f0.tar.gz luaatc_envs-68dd87842504e16bd25b33500b80f7c0d3e4f7f0.tar.bz2 luaatc_envs-68dd87842504e16bd25b33500b80f7c0d3e4f7f0.zip |
State at 2022-06-25
Diffstat (limited to 'auto_yards')
-rw-r--r-- | auto_yards/init_code.lua | 18 | ||||
-rw-r--r-- | auto_yards/nodes/(-2004,3,-1099).lua | 3 | ||||
-rw-r--r-- | auto_yards/nodes/(-2006,3,-1099).lua | 2 |
3 files changed, 22 insertions, 1 deletions
diff --git a/auto_yards/init_code.lua b/auto_yards/init_code.lua index 689b7e3..ebab6e2 100644 --- a/auto_yards/init_code.lua +++ b/auto_yards/init_code.lua @@ -9,7 +9,8 @@ if event.init then dir_indicator_pos = POS(), error_indicator_pos = POS(), headshunt_max = number, - + notify = empty table, + notify_pos = pos, }, ]]-- TY = { @@ -23,6 +24,8 @@ if event.init then dir_indicator_pos = POS(-2009,3,-1101), error_indicator_pos = POS(-1999,3,-1099), headshunt_max = 5, + notify = {}, + notify_pos = POS(-2006,3,-1099) }, IP = { active_indicator_pos = POS(1179,16,3848), @@ -164,6 +167,7 @@ F.yard_arrival = function(yard_id,this_dir) -- arrow points towards yard atc_set_ars_disable(false) atc_send("S6") print("YARD: "..yard_id..": Train "..atc_id.." enters from the "..tostring(this_dir).." direction and "..((rts and "will") or "won't").." return in the same direction") + print("YARD: "..yard_id..": Length "..train_length()) return end @@ -352,6 +356,13 @@ F.headshunt_exit = function(yard_id,this_dir) -- arrow points out of yard F.remove_rc({yard_id.."_FINAL_COLLECT",yard_id.."_DEPART"}) F.remove_rc_match(yard_id.."_LOCOS_%d+") F.remove_rc_match(yard_id.."_WAGONS_%d+") + + if yard.notify_pos and yard.notify then + if #yard.notify > 0 then + interrupt_pos(yard.notify_pos,"notify") + end + end + if F.has_rc(yard_id.."_HAS_RTS") then --reinsert the RTS flag to fully return RC list to starting F.remove_rc(yard_id.."_HAS_RTS") F.add_rc({yard_id.."_RTS"}) @@ -406,6 +417,11 @@ F.lane_EOL = function(yard_id,this_dir) -- arrow points towards headshunt else if F.indicator(yard.dir_indicator_pos) == this_dir then F.remove_rc_match(yard_id.."_CLASS_%S+") + local fc = F.get_rc_safe():match(yard_id.."_CLASS_(%S+)") + if not fc then return end + if fc == "*" then return end + if F.has_rc(yard_id.."_COLLECT_"..fc) then return end + S.yards[yard_id].notify[fc] = true else --this should never come into play as it means the train has entered from the wrong end somehow atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required F.indicator(yard.error_indicator_pos,true) diff --git a/auto_yards/nodes/(-2004,3,-1099).lua b/auto_yards/nodes/(-2004,3,-1099).lua new file mode 100644 index 0000000..bc283b9 --- /dev/null +++ b/auto_yards/nodes/(-2004,3,-1099).lua @@ -0,0 +1,3 @@ +local s = rwt.to_string(rwt.now()).."\n--"..table.concat(S.yards.BY.notify,", ").."--" +print(s) +digiline_send("",s)
\ No newline at end of file diff --git a/auto_yards/nodes/(-2006,3,-1099).lua b/auto_yards/nodes/(-2006,3,-1099).lua new file mode 100644 index 0000000..4109711 --- /dev/null +++ b/auto_yards/nodes/(-2006,3,-1099).lua @@ -0,0 +1,2 @@ +if event.digiline then return end +print(event)
\ No newline at end of file |