BruceWplays

mix test

Jan 12th, 2023 (edited)
796
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.31 KB | None | 0 0
  1. trans_time = 300000
  2. term.clear()
  3. col_prev_time = os.epoch()
  4. function mix(mix_end, mix_start)
  5.     if (((os.epoch() - (col_prev_time - trans_time)) / trans_time) - 1) > 1 then
  6.         return mix_end
  7.     end
  8.  
  9.     --local temp_start = mix_start * (((os.epoch() - (col_prev_time - trans_time)) / trans_time) - 1)
  10.     --local temp_end = mix_end * (1 - (((os.epoch() - (col_prev_time - trans_time)) / trans_time) - 1))
  11.    
  12.     local temp_start = mix_start * (1 - (((os.epoch() - (col_prev_time - trans_time)) / trans_time) - 1))
  13.     local temp_end = mix_end * (((os.epoch() - (col_prev_time - trans_time)) / trans_time) - 1)
  14.     term.setCursorPos(1,2)
  15.     term.clearLine()
  16.     print(1 - (((os.epoch() - (col_prev_time - trans_time)) / trans_time) - 1))
  17.     term.setCursorPos(1,3)
  18.     term.clearLine()
  19.     print(temp_end)
  20.  
  21.     term.setCursorPos(1,5)
  22.     term.clearLine()
  23.     print(((os.epoch() - (col_prev_time - trans_time)) / trans_time) - 1)
  24.     return temp_start + temp_end
  25. end
  26.  
  27. while stop_prog ~= 1 do
  28.     test = mix(255,1)
  29.    
  30.     term.setCursorPos(1,1)
  31.     term.clearLine()
  32.     print(test)
  33.     if test >= 255 then
  34.         col_prev_time = os.epoch()
  35.  
  36.     end
  37.     --test = -1
  38.     if test < 0 then
  39.         stop_prog = 1
  40.         term.setCursorPos(1,9)
  41.         print("exit")
  42.     end
  43. sleep(0)
  44. end
  45.  
  46.  
Advertisement
Add Comment
Please, Sign In to add comment