MarcosKoco

Botania Thermalily

Feb 4th, 2024
935
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.75 KB | None | 0 0
  1. local Back = "back"
  2. local Right = "right"
  3. local Time = 0
  4. local Start = false
  5.  
  6. while true do
  7.    
  8.     local Get = redstone.getAnalogInput(Back)
  9.    
  10.     term.clear()
  11.     term.setCursorPos(25,10)
  12.     print(Time)
  13.    
  14.     if Get > 0 and Start == false then
  15.        
  16.         Time = Get * 20 + 1
  17.         Start = true
  18.        
  19.         term.clear()
  20.         term.setCursorPos(25,10)
  21.         print(Time)
  22.        
  23.     elseif Start == true then
  24.        
  25.         term.clear()
  26.         term.setCursorPos(25,10)
  27.         print(Time)
  28.        
  29.         if Time > 0 then
  30.            
  31.             Time = Time - 1
  32.            
  33.             if Time == 0 then
  34.                
  35.                 term.clear()
  36.                 term.setCursorPos(25,10)
  37.                 print(Time)
  38.                
  39.                 redstone.setOutput(Right, true)
  40.                 sleep(1)
  41.                 redstone.setOutput(Right, false)
  42.                 Start = false
  43.                
  44.             end
  45.            
  46.         end
  47.        
  48.     end
  49.    
  50.     sleep(1)
  51.    
  52. end
  53.  
  54.  
Advertisement
Add Comment
Please, Sign In to add comment