Advertisement
Guest User

startup

a guest
Jan 4th, 2020
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.39 KB | None | 0 0
  1. while true do
  2. local tur = peripheral.wrap("BigReactors-Turbine_0")
  3. local mon = peripheral.wrap("top")
  4. local low = 1800
  5. local high = 1850
  6. local min = 900
  7. local speed = tur.getRotorSpeed()
  8. mon.setTextScale(2)
  9. mon.setCursorPos(1,1)
  10. mon.setTextColor(colors.white)
  11. mon.setBackgroundColor(colors.black)
  12. mon.write(math.floor(speed))
  13. if tur.getActive() == (true) then
  14.     mon.setCursorPos(1,2)
  15.     mon.clearLine()
  16.     mon.setBackgroundColor(colors.green)
  17.     mon.setTextColor(colors.black)
  18.     mon.write("Turbine")
  19.     else
  20.     mon.setCursorPos(1,2)
  21.     mon.clearLine()
  22.     mon.setBackgroundColor(colors.red)
  23.     mon.setTextColor(colors.black)
  24.     mon.write("Turbine")
  25.     end
  26. if tur.getInductorEngaged() == (true) then
  27.     mon.setCursorPos(1,3)
  28.     mon.clearLine()
  29.     mon.setBackgroundColor(colors.green)
  30.     mon.setTextColor(colors.black)
  31.     mon.write("Inductor")
  32.     else
  33.     mon.setCursorPos(1,3)
  34.     mon.clearLine()
  35.     mon.setBackgroundColor(colors.red)
  36.     mon.setTextColor(colors.black)
  37.     mon.write("Inductor")
  38.     end
  39.    
  40.  
  41. if speed <= min then
  42.     tur.setInductorEngaged(false)
  43.     end
  44. if speed > min then
  45.     tur.setInductorEngaged(true)
  46.    end
  47.    
  48. if tur.getRotorSpeed() <= low then
  49.     tur.setActive(true)
  50.     end
  51. if tur.getRotorSpeed() >= high then
  52.     tur.setActive(false)
  53.     end
  54.     sleep(1)
  55.     mon.setBackgroundColor(colors.black)
  56.     mon.clear()
  57. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement