diff options
author | autocommitter <autocommitter@linux-forks.de> | 2024-04-22 14:56:19 +0200 |
---|---|---|
committer | autocommitter <autocommitter@linux-forks.de> | 2024-04-22 14:56:19 +0200 |
commit | ccbca355d411168e66c025598c0ab65b23ef0423 (patch) | |
tree | 5c39754483e7413687d23d392f9f6d62e1ec8fea /durt/nodes | |
parent | 68131f27640e9bdb6d67c914d354d5fd67675a99 (diff) | |
download | luaatc_envs-ccbca355d411168e66c025598c0ab65b23ef0423.tar.gz luaatc_envs-ccbca355d411168e66c025598c0ab65b23ef0423.tar.bz2 luaatc_envs-ccbca355d411168e66c025598c0ab65b23ef0423.zip |
State at 2022-02-26
Diffstat (limited to 'durt/nodes')
-rw-r--r-- | durt/nodes/(-2080,3,822).lua | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/durt/nodes/(-2080,3,822).lua b/durt/nodes/(-2080,3,822).lua index 26904d3..d450d7d 100644 --- a/durt/nodes/(-2080,3,822).lua +++ b/durt/nodes/(-2080,3,822).lua @@ -1,20 +1,24 @@ local indicator = POS(-2080,6,826) -local rc = (get_rc() or "") +local rc = (get_rc or "") +local shunting_rc = {"ArcLoad_split","ArcLoad_around","ArcLoad_rejoin"} -if rc:match("ArcLoad_NOSHUNT") then return end +if type(rc) == "string" then rc = function() return "" end end +if rc():match("ArcLoad_NOSHUNT") then return end if event.train and atc_arrow then + print(get_rc()) if getstate(indicator) == "green" then - F.remove_rc({"ArcLoad_split","ArcLoad_around","ArcLoad_rejoin"},true) + F.remove_rc(shunting_rc,true) atc_send("S0WRD1A1S2D10SM") setstate(indicator,"red") - set_rc(rc.." ArcLoad_exit") + set_rc(rc().." ArcLoad_exit") else local o_text = atc_get_text_outside() or "" atc_set_text_outside("Waiting for Locomotive") split_off_locomotive("A0B0",1) atc_set_text_outside(o_text) - set_rc(rc.." ArcLoad_split ArcLoad_around ArcLoad_rejoin") + set_rc(rc().." "..table.concat(shunting_rc," ")) setstate(indicator,"green") end + print(get_rc()) end
\ No newline at end of file |