Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local turbine
- local rotorspeed
- local maxrotorspeed = 1820
- local minrotorspeed = 1780
- local turbineactive
- local turbinemanip
- while true do
- turbine= peripheral.wrap("back")
- rotorspeed= turbine.getRotorSpeed()
- write (rotorspeed)
- turbineactive= turbine.getActive()
- if rotorspeed > maxrotorspeed then
- write ("Turbine above max speed. Shutting down")
- turbine.setActive(false)
- turbinemanip= true
- elseif rotorspeed < minrotorspeed then
- write ("Turbine below max speed. Starting up.")
- turbine.setActive(true)
- elseif turbinemanip == true then
- write ("RPM acceptable levels. Turning back on.")
- end
- sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement