if event.type ~= "punch" then return end local st = {} local function println(str) table.insert(st, str) end local function printf(fmt, ...) return println(string.format(fmt, ...)) end local lines = F.lines local linenames = {} for k in pairs(lines) do table.insert(linenames, k) end table.sort(linenames) for _, linename in ipairs(linenames) do local line = lines[linename] printf("Line: %s", linename) printf("Ring: %s", line.ring) printf("Interval: %s", line.interval or "?") printf("Trip length: %s", line.rtt or "?") for tripnum, trip in ipairs(line) do printf("Trip #%d", tripnum) for _, stn in ipairs(trip) do local stnline = ("%-27s %-3s"):format(F.stnlist[stn[1]] or stn[1], stn[2]) if stn[3] then stnline = stnline .. (" %02d:%02d"):format(math.floor(stn[3]/60), stn[3]%60) end println(stnline) end end println("") end local text = table.concat(st, "\n") digiline_send("mfu", { command = "PRINT", copies = 1, author = "Station Control Center", title = "Timetable", text = text, watermark = "CRT_" .. os.time(), })