summaryrefslogtreecommitdiff
path: root/pad/nodes/(-1053,7,-3336).lua
diff options
context:
space:
mode:
authorautocommitter <autocommitter@linux-forks.de>2025-12-30 00:00:03 +0100
committerautocommitter <autocommitter@linux-forks.de>2025-12-30 00:00:03 +0100
commita04feb7e044e74be81ce28806dcc89ad59a4b23c (patch)
treed50cd72bdb51e83aa5fa17c4b3051a2e48da7c9f /pad/nodes/(-1053,7,-3336).lua
parent2e31eb42ab5c92e9937dff9af8d2dff88d6eba06 (diff)
State at 2025-12-30
Diffstat (limited to 'pad/nodes/(-1053,7,-3336).lua')
-rw-r--r--pad/nodes/(-1053,7,-3336).lua56
1 files changed, 56 insertions, 0 deletions
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")
+