Advertisement
Guest User

startup

a guest
Mar 31st, 2015
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.88 KB | None | 0 0
  1. turbine = peripheral.wrap("bottom")
  2.  
  3. while true do
  4. turbine.setActive(true)
  5. speed = turbine.getRotorSpeed()
  6. state = turbine.getActive()
  7. term.clear()
  8.  
  9. term.setCursorPos(1,1)
  10. term.write(math.floor(speed))
  11. sleep(0.15)
  12. turbine.setFluidFlowRateMax(2000)
  13. stringSpeed = tostring(math.floor(speed))
  14. shell.run("label", "set", stringSpeed)
  15.  
  16.  
  17.   if speed <= 1846 then
  18.     term.setTextColor(colors.red)
  19.   elseif speed >= 1847 and speed < 1850 then
  20.     term.setTextColor(colors.lime)
  21.   elseif speed >= 1850 then
  22.     term.setTextColor(colors.red)
  23.   end
  24.  
  25.   if speed < 1846 then
  26.     turbine.setInductorEngaged(false)
  27.   elseif speed > 1848 then
  28.     turbine.setInductorEngaged(true)
  29.   elseif speed < 1850 then
  30.     turbine.setFluidFlowRateMax(2000)
  31.   end
  32.  
  33.   if speed > 1850 then
  34.     turbine.setFluidFlowRateMax(0)
  35.   elseif speed < 1845 then
  36.     turbine.setVentOverflow()
  37.   end    
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement