diff options
Diffstat (limited to 'subway')
-rw-r--r-- | subway/init_code.lua | 10 | ||||
-rw-r--r-- | subway/nodes/(-1025,10,226).lua | 2 | ||||
-rw-r--r-- | subway/nodes/(10,0,-10).lua | 4 | ||||
-rw-r--r-- | subway/nodes/(787,8,-103).lua | 3 |
4 files changed, 15 insertions, 4 deletions
diff --git a/subway/init_code.lua b/subway/init_code.lua index 2eb400e..ebe0781 100644 --- a/subway/init_code.lua +++ b/subway/init_code.lua @@ -304,26 +304,34 @@ F.stat=function(line, init) if init then reftrain = atc_id a_tbt = 30 +a_tbtmax = 30 a_rtt = 500 a_not = 0 c_not = 0 +c_tbtmax = 0 time_lt = os.time() time_rt=os.time() end +if not a_tbtmax then a_tbtmax = 30 end +if not c_tbtmax then c_tbtmax = 0 end --real code if event.train then local time = os.time() c_not = c_not + 1 a_tbt = (a_tbt + (time - time_lt)) / 2 +c_tbtmax = math.max(c_tbtmax, (time - time_lt)) if atc_id == reftrain then a_rtt = (a_rtt*0.2 + (time - time_rt)*0.8) a_not = c_not c_not = 0 + a_tbtmax = (a_tbtmax + c_tbtmax) / 2 + c_tbtmax = 0 end digiline_send("stats", "Stat: "..line.. " NoT:"..a_not.."("..c_not..")".. " TbT:"..math.floor(a_tbt).."("..(time-time_lt)..")".. - " RTT: "..math.floor(a_rtt).."("..(time - time_rt)..")" + " Tmx:"..math.floor(a_tbtmax).."("..c_tbtmax..")".. + " R:"..math.floor(a_rtt).."("..(time - time_rt)..")" ) time_lt = time if atc_id == reftrain then diff --git a/subway/nodes/(-1025,10,226).lua b/subway/nodes/(-1025,10,226).lua index 6c765e1..83dd2b8 100644 --- a/subway/nodes/(-1025,10,226).lua +++ b/subway/nodes/(-1025,10,226).lua @@ -1,2 +1,2 @@ F.stn_return("Ahr3N", "Ahz3R", "Ahr3S", "L", "Ahz3ES", "cr") -F.lineset("3", "N")
\ No newline at end of file +F.lineset("3", "S")
\ No newline at end of file diff --git a/subway/nodes/(10,0,-10).lua b/subway/nodes/(10,0,-10).lua index 0585cbf..bc56a91 100644 --- a/subway/nodes/(10,0,-10).lua +++ b/subway/nodes/(10,0,-10).lua @@ -1,6 +1,6 @@ -- digiline_send("l14e", "SIS Variant 2 - v1.4 | No info avaliable") -local appr_time = 20 +local appr_time = 15 local dnnapprt=15 if not appr_tmr then appr_tmr = 0 end local setint = false @@ -87,7 +87,7 @@ if dd_line and nwt then end digiline_send("l14e", line1.." | "..line2.." | "..line3.." | ----------- | "..line4) -digiline_send("l14eint", "in_stn: "..(in_stn or "-").." "..appr_tmr.."s".." | n_appr: "..(n_appr or "-").." | n_wait: "..(n_wait or "-").. " | "..event.type.." | "..(event.message or "-")) +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") diff --git a/subway/nodes/(787,8,-103).lua b/subway/nodes/(787,8,-103).lua new file mode 100644 index 0000000..34d04ad --- /dev/null +++ b/subway/nodes/(787,8,-103).lua @@ -0,0 +1,3 @@ +--F.stn_return("Dam2N", "Dam2R", "Dam2S", "R", "Dam2ES", "cr", 6, nil, 20) +F.stat("Line 2", false) +atc_set_text_outside("Line 2 - Chasm of Segfault")
\ No newline at end of file |