From 572b186e28ddc2a630613765c0f0780b4664380f Mon Sep 17 00:00:00 2001 From: autocommitter Date: Tue, 15 Oct 2024 22:37:42 +0200 Subject: State at 2024-10-15 --- durt/nodes/(-2227,8,292).lua | 75 -------------------------------------------- 1 file changed, 75 deletions(-) delete mode 100644 durt/nodes/(-2227,8,292).lua (limited to 'durt/nodes/(-2227,8,292).lua') diff --git a/durt/nodes/(-2227,8,292).lua b/durt/nodes/(-2227,8,292).lua deleted file mode 100644 index 75c39d7..0000000 --- a/durt/nodes/(-2227,8,292).lua +++ /dev/null @@ -1,75 +0,0 @@ --- - -local delta = 4*60+20 -- HERE IS THE VALUE - -local owdata = S.BaHi_T6 -local numval = 5 -local switchbox_cp = { x=-2221,y=14,z=297} - -function save_delay(d) - if not owndata then - owndata = { false, false, false, false, false, false, false, false, } - end - for i=numval,2,-1 do - owndata[i] = owndata[i-1] - end - owndata[1] = d -end - -function delay_text() - if not owndata then - return "" - end - local rg = "" - for i=1,numval do - h = owndata[i] - if not h then h = "" end - rg = rg .. h .." " - end - return rg -end - -if event.type == "train" then - if atc_arrow then - atc_send("B0WOL") -- D20OCD3S2") --- setstate("BaHi_T5_S2","st") --- setstate("BaHi_T5_S1","st") - - if not S.BaHi_T6 then - S.BaHi_T6 = os.time() - end --- interrupt(1,"departure") --- else - now = os.time() - tempdist = now-S.BaHi_T6 - save_delay(tempdist) - delaystr = delay_text() - output = "last: "..S.BaHi_T6 .. "\nnow: " .. now .. "\ndelta: " .. tempdist.. "\n"..delta .. " " .. delaystr - digiline_send("lcd",output) - interrupt_pos( switchbox_cp, { action = "display", data = output } ) - if tempdist > delta then - interrupt(15,"departure") - else - interrupt(-tempdist+delta,"departure") - end --- end - end - return -end - -if event.type == "int" then - if event.msg == "departure" then - -- setstate("BaHi_T5_S2","st") - -- setstate("BaHi_T5_S1","st") - atc_set_text_inside("S23 -> Redwood") - atc_send("ROCD3S2") - now = os.time() - delaystr = delay_text() --- digiline_send("lcd","last: \nnow: " .. now .. "\ndelta: " .. tempdist.. "\n"..delta .. " " .. delaystr) - output = "last: " .. now .. " \n \n \n"..delta.." "..delaystr - digiline_send("lcd",output ) - interrupt_pos( switchbox_cp, { action = "display", data = output } ) - S.BaHi_T6 = now - end - return -end \ No newline at end of file -- cgit v1.2.3