-- digiline_send("l14e", "SIS Variant 2 - v1.4 | No info avaliable") local appr_time = 15 local dnnapprt=15 if not appr_tmr then appr_tmr = 0 end local setint = false if event.ext_int then if event.message == "dep1" then if n_appr then in_stn = n_appr + 0 end n_appr = 1 n_wait = nil appr_tmr = appr_time setint=true elseif event.message == "dep4" then if n_appr then in_stn = n_appr + 0 end n_appr = 4 n_wait = nil appr_tmr = appr_time setint=true elseif event.message == "dep44" then if n_appr then in_stn = n_appr + 0 end n_appr = 44 n_wait = nil appr_tmr = appr_time setint=true elseif event.message == "arr1" then n_wait = 1 elseif event.message == "arr4" then n_wait = 4 elseif event.message == "arr44" then n_wait = 44 elseif event.message == "arro" and not in_stn then in_stn = n_appr n_appr = nil elseif event.message == "depo" then in_stn = nil end elseif event.int then appr_tmr = appr_tmr - 5 setint=true elseif event.punch then in_stn=nil n_appr=nil n_wait=nil digiline_send("l14e", "SIS Variant 2 - v1.4 | Please Wait") end -- calculate time for nwaiting train if n_appr then nwt = math.max(appr_tmr, 0) + appr_time elseif n_wait then nwt = math.max(appr_tmr, 0) + 10 + appr_time end --display local seconds = "in "..appr_tmr.." s" if appr_tmr <= 0 then seconds = "now" end local du_line, du_time, dd_line if in_stn then du_line = in_stn du_time = "now" if n_appr then dd_line = n_appr else dd_line = n_wait end elseif n_appr then du_line = n_appr du_time = seconds if n_wait then dd_line = n_wait end elseif n_wait then du_line = n_wait du_time = "in 30 s" end local txt = { [1] = "Windy Mtns.", [4] = "Schwarzs.", [44] = "NYE Sq.", } local line1, line2, line3 = "", "", "" if du_line then line1 = "Line "..du_line line2 = txt[du_line] line3 = du_time end local line4 = "" if dd_line and nwt then line4 = "Line "..(dd_line).." - "..nwt.."s" end digiline_send("l14e", line1.." | "..line2.." | "..line3.." | ----------- | "..line4) digiline_send("l14eint", "in_st:"..(in_stn or "-").." "..appr_tmr.."s".." | n_appr: "..(n_appr or "-").." | n_wait: "..(n_wait or "-").. " | "..event.type.." | "..(event.message or "-")) if (appr_tmr > 0 or nnwaiting) and setint then interrupt(5, "appr") end