Advertisement
Guest User

nuclear

a guest
Apr 4th, 2020
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.70 KB | None | 0 0
  1. condition = 'Excellent'
  2. monitor = peripheral.wrap('right')
  3. rednet.open('back')
  4. y = 1
  5. x = 500
  6. text1 = 'Time Remaining - '
  7. text2 = 'Until Overload'
  8. countdown = false
  9. countup = false
  10. monitor.clear()
  11. monitor.setCursorPos(1,1)
  12. monitor.write('Current Status  - '..condition)
  13.  
  14. --event = os.pullEvent('redstone')
  15. countdown = true
  16. while true do
  17.     rednet.broadcast(x, 'countdown')
  18.     rednet.broadcast(condition, 'condition')
  19.    
  20.     if countdown == true then
  21.         x = x - 1
  22.         sleep(0.6)
  23.     end
  24.    
  25.     if countup == true then
  26.         x = x + 5
  27.         sleep(1)
  28.     end
  29.    
  30.  
  31.     if x > 1000 then
  32.         x = 1000
  33.         countup = false
  34.         countdown = false
  35.         condition = 'Perfect'
  36.         text1 = 'Perfect'
  37.     end
  38.     if rs.getInput('left') == true then
  39.         condition = 'Stable'
  40.         text1 = 'Stabilising '
  41.         text2 = ' '
  42.         countdown = false
  43.         countup = true
  44.         for i=1, 10 do    
  45.             rednet.broadcast(x, 'lead')
  46.             sleep(0.2)
  47.         end
  48.         sleep(6)
  49.     end
  50.    
  51.     if x < 300 and x > 50 then
  52.         condition = 'Critical'
  53.  
  54.     end    
  55.    
  56.     if x < 500 and x > 490 then
  57.         condition = 'Bad'
  58.     end
  59.    
  60.     if x < 50 and x > 1 then
  61.         condition = 'Danger'
  62.     end
  63.    
  64.     if x < 1 then
  65.         x = 0
  66.         condition = 'BOOM!'
  67.     end
  68.    
  69.     if rs.getInput('left') == false then
  70.        
  71.         monitor.clear()
  72.         monitor.setCursorPos(1,1)
  73.         monitor.write("Current Status -- ".. condition)
  74.         monitor.setCursorPos(1,4)
  75.         monitor.write(text1 ..x)
  76.         monitor.setCursorPos(1,5)
  77.         monitor.write(text2)
  78.         sleep(0.5)
  79.     end
  80.     sleep()
  81. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement