From a04feb7e044e74be81ce28806dcc89ad59a4b23c Mon Sep 17 00:00:00 2001 From: autocommitter Date: Tue, 30 Dec 2025 00:00:03 +0100 Subject: State at 2025-12-30 --- pad/nodes/(-1053,7,-3336).lua | 56 +++++++++++++++++++++++++++++++++++++ pad/nodes/(-1061,1,-3321).lua | 5 ++++ pad/nodes/(-1107,-5,-3242).lua | 4 +++ pad/nodes/(-1191,-5,-3294).lua | 4 +++ pad/nodes/(-1208,0,-3337).lua | 56 +++++++++++++++++++++++++++++++++++++ pad/nodes/(-860,-5,-3265).lua | 3 +- pad/nodes/(-863,-10,-3236).lua | 3 ++ pad/nodes/(-887,-10,-3156).lua | 5 ++++ pad/nodes/(-890,-5,-3154).lua | 63 ++++++++++++++++++++++++++++++++++-------- pad/nodes/(-928,-5,-3274).lua | 3 ++ pad/nodes/(-978,-5,-3264).lua | 3 ++ 11 files changed, 193 insertions(+), 12 deletions(-) create mode 100644 pad/nodes/(-1053,7,-3336).lua create mode 100644 pad/nodes/(-1061,1,-3321).lua create mode 100644 pad/nodes/(-1107,-5,-3242).lua create mode 100644 pad/nodes/(-1191,-5,-3294).lua create mode 100644 pad/nodes/(-1208,0,-3337).lua create mode 100644 pad/nodes/(-863,-10,-3236).lua create mode 100644 pad/nodes/(-887,-10,-3156).lua create mode 100644 pad/nodes/(-928,-5,-3274).lua create mode 100644 pad/nodes/(-978,-5,-3264).lua (limited to 'pad/nodes') diff --git a/pad/nodes/(-1053,7,-3336).lua b/pad/nodes/(-1053,7,-3336).lua new file mode 100644 index 0000000..f9bc218 --- /dev/null +++ b/pad/nodes/(-1053,7,-3336).lua @@ -0,0 +1,56 @@ +function printLcd(t) + local str = "" + for _, i in ipairs(t) do + str = str .. i .. "\n" + end + + digiline_send("lcd", str) +end + +if not time_table then time_table = {} end + +if event.ext_int then + local catch = event.message + + if catch[1] == "arr1" then + time_table[catch[2]] = 25 + elseif catch[1] == "arr2" then + time_table[catch[2]] = 45 + elseif catch[1] == "arr3" then + + elseif catch[1] == "dep1" then + time_table[catch[2]] = 210 + elseif catch[1] == "dep2" then + time_table[catch[2]] = 180 + elseif catch[1] == "dep3" then + elseif catch[1] == "arr" then + time_table[catch[2]] = 0 + end +elseif event.int and event.msg == "d" then + txt = {" === Next trains ==="} + for i, j in pairs(time_table) do + local approx = "" + + if j > 0 then + time_table[i] = time_table[i] - 5 + end + + if j < 15 then + approx = ">>" + elseif j < 60 then + approx = j .. "s" + else + approx = math.floor(j / 60) .. "m" + end + + table.insert(txt, string.format("Lighthouse %s", approx)) + end + + printLcd(txt) +elseif event.punch then + time_table = {} + digiline_send("lcd", "This is a test") +end + +interrupt_safe(5, "d") + diff --git a/pad/nodes/(-1061,1,-3321).lua b/pad/nodes/(-1061,1,-3321).lua new file mode 100644 index 0000000..0c6783a --- /dev/null +++ b/pad/nodes/(-1061,1,-3321).lua @@ -0,0 +1,5 @@ +if event.type == "train" then + interrupt_pos(POS(-890,-5,-3154), {"arr2", event.id}) + interrupt_pos(POS(-1208,0,-3337), {"dep2", event.id}) + interrupt_pos(POS(-1053,7,-3336), {"dep1", event.id}) +end \ No newline at end of file diff --git a/pad/nodes/(-1107,-5,-3242).lua b/pad/nodes/(-1107,-5,-3242).lua new file mode 100644 index 0000000..9492c11 --- /dev/null +++ b/pad/nodes/(-1107,-5,-3242).lua @@ -0,0 +1,4 @@ +if event.type == "train" then + interrupt_pos(POS(-890,-5,-3154), {"dep2", event.id}) + interrupt_pos(POS(-1208,0,-3337), {"arr1", event.id}) +end \ No newline at end of file diff --git a/pad/nodes/(-1191,-5,-3294).lua b/pad/nodes/(-1191,-5,-3294).lua new file mode 100644 index 0000000..ee184b6 --- /dev/null +++ b/pad/nodes/(-1191,-5,-3294).lua @@ -0,0 +1,4 @@ +if event.type == "train" then + interrupt_pos(POS(-1208,0,-3337), {"dep1", event.id}) + interrupt_pos(POS(-1053,7,-3336), {"arr2", event.id}) +end \ No newline at end of file diff --git a/pad/nodes/(-1208,0,-3337).lua b/pad/nodes/(-1208,0,-3337).lua new file mode 100644 index 0000000..8d6cdfe --- /dev/null +++ b/pad/nodes/(-1208,0,-3337).lua @@ -0,0 +1,56 @@ +function printLcd(t) + local str = "" + for _, i in ipairs(t) do + str = str .. i .. "\n" + end + + digiline_send("lcd", str) +end + +if not time_table then time_table = {} end + +if event.ext_int then + local catch = event.message + + if catch[1] == "arr1" then + time_table[catch[2]] = 15 + elseif catch[1] == "arr2" then + time_table[catch[2]] = 45 + elseif catch[1] == "arr3" then + + elseif catch[1] == "dep1" then + time_table[catch[2]] = 210 + elseif catch[1] == "dep2" then + time_table[catch[2]] = 140 + elseif catch[1] == "dep3" then + elseif catch[1] == "arr" then + time_table[catch[2]] = 0 + end +elseif event.int and event.msg == "d" then + txt = {" === Next trains ==="} + for i, j in pairs(time_table) do + local approx = "" + + if j > 0 then + time_table[i] = time_table[i] - 5 + end + + if j < 15 then + approx = ">>" + elseif j < 60 then + approx = j .. "s" + else + approx = math.floor(j / 60) .. "m" + end + + table.insert(txt, string.format("Flatcoast %s", approx)) + end + + printLcd(txt) +elseif event.punch then + time_table = {} + digiline_send("lcd", "Initializing TTP...") +end + +interrupt_safe(5, "d") + diff --git a/pad/nodes/(-860,-5,-3265).lua b/pad/nodes/(-860,-5,-3265).lua index a808f3e..18502c2 100644 --- a/pad/nodes/(-860,-5,-3265).lua +++ b/pad/nodes/(-860,-5,-3265).lua @@ -1,3 +1,4 @@ if event.type == "train" then - interrupt_pos(POS(-890,-5,-3154), true) + interrupt_pos(POS(-890,-5,-3154), {"arr1", event.id}) + interrupt_pos(POS(-1053,7,-3336), {"dep2", event.id}) end \ No newline at end of file diff --git a/pad/nodes/(-863,-10,-3236).lua b/pad/nodes/(-863,-10,-3236).lua new file mode 100644 index 0000000..afaffa2 --- /dev/null +++ b/pad/nodes/(-863,-10,-3236).lua @@ -0,0 +1,3 @@ +if event.type == "train" then + interrupt_pos(POS(-890,-5,-3154), {"dep1", event.id}) +end \ No newline at end of file diff --git a/pad/nodes/(-887,-10,-3156).lua b/pad/nodes/(-887,-10,-3156).lua new file mode 100644 index 0000000..c1cfee3 --- /dev/null +++ b/pad/nodes/(-887,-10,-3156).lua @@ -0,0 +1,5 @@ +atc_set_text_outside("Padrana Subway - Greenplain") + +if event.type == "train" then + interrupt_pos(POS(-890,-5,-3154), {event.id, "arr"}) +end \ No newline at end of file diff --git a/pad/nodes/(-890,-5,-3154).lua b/pad/nodes/(-890,-5,-3154).lua index 175487c..74680a0 100644 --- a/pad/nodes/(-890,-5,-3154).lua +++ b/pad/nodes/(-890,-5,-3154).lua @@ -1,15 +1,56 @@ -time_left = 0 +function printLcd(t) + local str = "" + for _, i in ipairs(t) do + str = str .. i .. "\n" + end + + digiline_send("lcd", str) +end + +if not time_table then time_table = {} end if event.ext_int then - if event.message == "arr1" then - time_left = 15 - elseif event.message == "arr2" then - elseif event.message == "arr3" then - elseif event.message == "dep1" then - elseif event.message == "dep2" then - elseif event.message == "dep3" then - elseif event.message == "arr" then + local catch = event.message + + if catch[1] == "arr1" then + time_table[catch[2]] = 15 + elseif catch[1] == "arr2" then + time_table[catch[2]] = 50 + elseif catch[1] == "arr3" then + + elseif catch[1] == "dep1" then + time_table[catch[2]] = 210 + elseif catch[1] == "dep2" then + time_table[catch[2]] = 160 + elseif catch[1] == "dep3" then + elseif catch[1] == "arr" then + time_table[catch[2]] = 0 end +elseif event.int and event.msg == "d" then + txt = {" === Next trains ==="} + for i, j in pairs(time_table) do + local approx = "" + + if j > 0 then + time_table[i] = time_table[i] - 5 + end + + if j < 15 then + approx = ">>" + elseif j < 60 then + approx = j .. "s" + else + approx = math.floor(j / 60) .. "m" + end + + table.insert(txt, string.format("Greenplain %s", approx)) + end + + printLcd(txt) elseif event.punch then - digiline_send("lcd", "This is a test") -end \ No newline at end of file + time_table = {} + digiline_send("lcd", "Initializing TTP...") +end + +interrupt_safe(5, "d") + diff --git a/pad/nodes/(-928,-5,-3274).lua b/pad/nodes/(-928,-5,-3274).lua new file mode 100644 index 0000000..3171e88 --- /dev/null +++ b/pad/nodes/(-928,-5,-3274).lua @@ -0,0 +1,3 @@ +if event.type == "train" then + interrupt_pos(POS(-1208,0,-3337), {"arr2", event.id}) +end \ No newline at end of file diff --git a/pad/nodes/(-978,-5,-3264).lua b/pad/nodes/(-978,-5,-3264).lua new file mode 100644 index 0000000..1b812fb --- /dev/null +++ b/pad/nodes/(-978,-5,-3264).lua @@ -0,0 +1,3 @@ +if event.type == "train" then + interrupt_pos(POS(-1053,7,-3336), {"arr1", event.id}) +end \ No newline at end of file -- cgit v1.2.3