diff options
author | autocommitter <autocommitter@linux-forks.de> | 2024-04-22 14:52:38 +0200 |
---|---|---|
committer | autocommitter <autocommitter@linux-forks.de> | 2024-04-22 14:52:38 +0200 |
commit | cfa65d94f1bc9d9e9efe13791711a9ad044a4a67 (patch) | |
tree | bdecc9982a58cb88367e4e8b1fcd9cfa1f95573e /Crossroads/nodes/(1755,27,943).lua | |
parent | f3da24b214b3337ad63ebd885da29d5b789d4738 (diff) | |
download | luaatc_envs-cfa65d94f1bc9d9e9efe13791711a9ad044a4a67.tar.gz luaatc_envs-cfa65d94f1bc9d9e9efe13791711a9ad044a4a67.tar.bz2 luaatc_envs-cfa65d94f1bc9d9e9efe13791711a9ad044a4a67.zip |
State at 2021-04-04
Diffstat (limited to 'Crossroads/nodes/(1755,27,943).lua')
-rw-r--r-- | Crossroads/nodes/(1755,27,943).lua | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Crossroads/nodes/(1755,27,943).lua b/Crossroads/nodes/(1755,27,943).lua index d09f055..135d7ab 100644 --- a/Crossroads/nodes/(1755,27,943).lua +++ b/Crossroads/nodes/(1755,27,943).lua @@ -1,7 +1,8 @@ -local head = { "V TRAIN LINE STATION", " " } +local head = { "V TRAIN LINE STATION ", " " } local length = 18 if event.type=="digiline" or event.type=="punch" then if event.channel=="upd_main" or event.type=="punch" then + local table = table local start_t = os.clock() if not S.lagrec then S.lagrec = {} end local la = {} @@ -14,16 +15,16 @@ if event.type=="digiline" or event.type=="punch" then for id = 1, #ids, 1 do local st = (S.trains[ids[id] or 0] or "") i = (counter-counter%7)/7*2+((counter%7<3) and 1 or 2) - if not la[i] then la[i] = (i%2==0) and "" or head[1] end - if not lb[i] then lb[i] = (i%2==0) and "" or head[2] end - local n = "[" .. (st.t or "N/A") .. "] " .. (F.stnlist[st.s] or st.s) - la[i] = string.format ("%s\n%02d %06d %-7s %s", la[i], st.v, ids[id], st.l, n) - lb[i] = lb[i] .. "\n" .. (n:len() < 10 and " " or n:sub(10)) + if not la[i] then la[i] = (i%2==0) and {} or {head[1]} end + if not lb[i] then lb[i] = (i%2==0) and {} or {head[2]} end + local n = string.format("[%s] %s", st.t or "?", F.stnlist[st.s] or st.s) + la[i][#la[i]+1] = string.format("%02d %06d %-7s %s", st.v, ids[id], st.l, n) + lb[i][#lb[i]+1] = (n:len() < 10 and " " or n:sub(10)) counter = counter + 1 end for i=1,#la,1 do - digiline_send("d"..tostring(i).."a", la[i] or "") - digiline_send("d"..tostring(i).."b", lb[i] or "") + digiline_send("d"..tostring(i).."a", table.concat(la[i] or {" "," "},"\n")) + digiline_send("d"..tostring(i).."b", table.concat(lb[i] or {" "," "},"\n")) end local end_t = os.clock() S.lagrec[#S.lagrec+1] = end_t - start_t |