From 4590cc6504d625404f0af394da41bb71fc2dec45 Mon Sep 17 00:00:00 2001 From: autocommitter Date: Mon, 22 Apr 2024 14:56:58 +0200 Subject: State at 2022-04-20 --- Tyard/nodes/(-4039,12,-2655).lua | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'Tyard/nodes/(-4039,12,-2655).lua') diff --git a/Tyard/nodes/(-4039,12,-2655).lua b/Tyard/nodes/(-4039,12,-2655).lua index 7489acc..512ce80 100644 --- a/Tyard/nodes/(-4039,12,-2655).lua +++ b/Tyard/nodes/(-4039,12,-2655).lua @@ -1 +1,30 @@ --- \ No newline at end of file +--EOL code +local this_dir = true -- true = F.dir arrow points north +local error_indicator = POS(-4025,13,-2671) +if F.yard_active() then + if atc_arrow then + if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it + if F.has_rc("TY_FINAL_COLLECT") then -- take the whole rake to the exit + F.remove({"TY_FINAL_COLLECT") + F.add_rc({"TY_DEPART"}) + else -- disconnect loco and return to pickup + split_off_locomotive("A0B0") + F.add_rc({"TY_PICKUP"}) + end + else --train needs to bounce + atc_send("B0WRD1S4") + end + else + if F.dir() == this_dir then + --train is clasifying wagons, let it pass and couple to the rest of the rake + local rm = {} + for v in F.get_rc_safe():gmatch("(TY_CLASS_%S+)") do + table.insert(rm,v) + end + F.remove_rc(rm) + 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 + setstate(error_indicator,"on") + end + end +end \ No newline at end of file -- cgit v1.2.3