--[[ @title stopwatch @param a split time (1)/lap time(0) @default a 1 ]] function format_nn(n) r=tostring(n) if n<10 then r= "0" .. n end return r end function to_time() if(a==0) then ztime=(get_tick_count()-count_a) count_a=get_tick_count() else ztime=(get_tick_count()-count_a) end h = (ztime /10) % 100 s = (ztime /1000) % 60 m = (ztime /1000/ 60) % 60 hh = (ztime /1000/ 3600) % 24 print("> "..format_nn(hh)..":"..format_nn(m)..":"..format_nn(s)..":"..format_nn(h)) end --start script if (a~=1 and a~=0) then a=1 end i=1 ztime=0 count_a=0 cls() print("[SET] start") while(i==1) do wait_click(0) if is_pressed "set" then count_a=get_tick_count() i=0 end end i=1 while(i==1) do cls() print("[MD] time") print() print("started") repeat Erkennung = 0 Erkennung = md_detect_motion(6, 4, 1, 5000, 1, 24, 0, 0, 0, 1, 1, 6, 4, 0, 5, 0) until Erkennung > 0 cls() print("[SET] time [MENU] end") print() to_time() wait_click(0) if is_pressed "menu" then cls() to_time() print("finished") sleep(3000) i=0 end end