summaryrefslogtreecommitdiff
path: root/Crossroads/init_code.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Crossroads/init_code.lua')
-rw-r--r--Crossroads/init_code.lua26
1 files changed, 12 insertions, 14 deletions
diff --git a/Crossroads/init_code.lua b/Crossroads/init_code.lua
index 6ef92b6..410b600 100644
--- a/Crossroads/init_code.lua
+++ b/Crossroads/init_code.lua
@@ -350,7 +350,10 @@ end
function F.pdisp(stn, trk, dn)
if not (stn and trk and dn) then return end
- if not F.stndet[stn] or not F.stndet[stn][trk] then return end
+ if not F.stndet[stn] or not F.stndet[stn][trk] then
+ digiline_send("track"..trk, ("Track: %s\nNo departures"):format(trk))
+ return
+ end
if not S.pd[stn] then S.pd[stn] = { [trk] = {[dn] = 0} } end
if not S.pd[stn][trk] then S.pd[stn][trk] = {[dn] = 0} end
if not S.pd[stn][trk][dn] then S.pd[stn][trk][dn] = 0 end
@@ -363,12 +366,14 @@ function F.pdisp(stn, trk, dn)
trk, F.lines[v[1]].name, F.stnlist[v[4] or "N/A"] or v[4] or "N/A",
F.stnlist[v[2] or "N/A"] or v[2] or "N/A")
end
+ if #t == 0 then
+ t[1] = ("Track: %s\nNo departures"):format(trk)
+ end
S.pdt[stn][trk] = t
end
- local n = S.pd[stn][trk][dn] + 1
local t = S.pdt[stn][trk]
+ local n = S.pd[stn][trk][dn] % #t + 1
digiline_send("track"..trk,t[n])
- if n >= #t then n = 0 end
S.pd[stn][trk][dn] = n
end
@@ -466,7 +471,7 @@ F.stnlist = {
occrt = "CRT Office",
ocmushroom = "Mushroom Market",
ocoutskirts = "Ocean City Outskirts",
- phsc = "Southern Crossing",
+ phsc = "Southern Cross",
phwest = "Personhood West",
scc = "Silver Coast Central",
sce = "Silver Coast East",
@@ -500,15 +505,8 @@ F.lines = {
name = "ATL Bronze Line", short = "ATL-B",
ring = false,
interval = 240,
- [1] = { {"crne","3"}, {"cr","34"}, --[[ {"crwm","3"},]] {"scs","N1"}, {"scc","N1"}, {"scn","N1"}, {"cg","1"}, {"thecube","4"}, --[[{"phsc","N"},]] {"grsc", "4"}, {"phwest","1"} },
- [2] = { {"phwest","1"}, {"grsc", "3"}, --[[{"phsc","S"},]] {"thecube","1"}, {"cg","2"}, {"scn","S1"}, {"scc","S1"}, {"scs","S1"}, --[[ {"crwm","4"}, ]] {"cr","31"}, {"crne", "3"} },
- },
- ["ABE"] = {
- name = "[Discontinued]", short = "ATL-B/E",
- ring = false,
- interval = 240,
- [1] = {{"crne","_"}, {"scc","N2"}, {"cg","1"}, {"thecube", "4"}, {"phwest", "2"}},
- [2] = {{"phwest", "2"}, {"thecube", "1"}, {"cg", "2"}, {"scc", "S2"}, {"crne", "_"}},
+ [1] = { {"crne","3"}, {"cr","34"}, --[[ {"crwm","3"},]] {"scs","N1"}, {"scc","N1"}, {"scn","N1"}, {"cg","1"}, {"thecube","4"}, {"phsc","4"}, {"grsc", "4"}, {"phwest","1"} },
+ [2] = { {"phwest","1"}, {"grsc", "3"}, {"phsc","3"}, {"thecube","1"}, {"cg","2"}, {"scn","S1"}, {"scc","S1"}, {"scs","S1"}, --[[ {"crwm","4"}, ]] {"cr","31"}, {"crne", "3"} },
},
["AM"] = {
name = "ATL Mithril Line", short = "ATL-M",
@@ -518,7 +516,7 @@ F.lines = {
[2] = {{"sce","1"}, {"cr","33"}, {"cra", "1"}},
},
["AZ"] = {
- name = "ATL-Z", short = "ATL-Z",
+ name = "ATL Zinc Line", short = "ATL-Z",
ring = false,
interval = 480,
[1] = { {"Bts","3"}, {"evo","N/A"}, {"scs","N1"}, {"scc","N1"}, {"scn","N1"}, {"oc","K1"}, --[[{"elgp","N"}, {"elsf","E"}, {"elchateau","S"}]] },