summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pad/nodes/(-1053,7,-3336).lua56
-rw-r--r--pad/nodes/(-1061,1,-3321).lua5
-rw-r--r--pad/nodes/(-1107,-5,-3242).lua4
-rw-r--r--pad/nodes/(-1191,-5,-3294).lua4
-rw-r--r--pad/nodes/(-1208,0,-3337).lua56
-rw-r--r--pad/nodes/(-860,-5,-3265).lua3
-rw-r--r--pad/nodes/(-863,-10,-3236).lua3
-rw-r--r--pad/nodes/(-887,-10,-3156).lua5
-rw-r--r--pad/nodes/(-890,-5,-3154).lua63
-rw-r--r--pad/nodes/(-928,-5,-3274).lua3
-rw-r--r--pad/nodes/(-978,-5,-3264).lua3
-rw-r--r--subway/nodes/(-1061,2,-3339).lua6
-rw-r--r--subway/nodes/(-1213,-5,-3335).lua6
-rw-r--r--subway/nodes/(-887,-10,-3156).lua1
14 files changed, 203 insertions, 15 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")
+
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
diff --git a/subway/nodes/(-1061,2,-3339).lua b/subway/nodes/(-1061,2,-3339).lua
index 383e0c9..ce0766f 100644
--- a/subway/nodes/(-1061,2,-3339).lua
+++ b/subway/nodes/(-1061,2,-3339).lua
@@ -1 +1,5 @@
-atc_set_text_outside("Padrana Subway - Lighthouse") \ No newline at end of file
+atc_set_text_outside("Padrana Subway - Lighthouse")
+
+if event.type == "train" then
+ interrupt_pos(POS(-1053,7,-3336), {"arr", event.id})
+end \ No newline at end of file
diff --git a/subway/nodes/(-1213,-5,-3335).lua b/subway/nodes/(-1213,-5,-3335).lua
index c893966..14af370 100644
--- a/subway/nodes/(-1213,-5,-3335).lua
+++ b/subway/nodes/(-1213,-5,-3335).lua
@@ -1 +1,5 @@
-atc_set_text_outside("Padrana Subway - Flatcoast") \ No newline at end of file
+atc_set_text_outside("Padrana Subway - Flatcoast")
+
+if event.type == "train" then
+ interrupt_pos(POS(-1208,0,-3337), {"arr", event.id})
+end \ No newline at end of file
diff --git a/subway/nodes/(-887,-10,-3156).lua b/subway/nodes/(-887,-10,-3156).lua
deleted file mode 100644
index ab5b6f8..0000000
--- a/subway/nodes/(-887,-10,-3156).lua
+++ /dev/null
@@ -1 +0,0 @@
-atc_set_text_outside("Padrana Subway - Greenplain") \ No newline at end of file