Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true do
- local tur = peripheral.wrap("BigReactors-Turbine_0")
- local mon = peripheral.wrap("top")
- local low = 1800
- local high = 1850
- local min = 900
- local speed = tur.getRotorSpeed()
- mon.setTextScale(2)
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.white)
- mon.setBackgroundColor(colors.black)
- mon.write(math.floor(speed))
- if tur.getActive() == (true) then
- mon.setCursorPos(1,2)
- mon.clearLine()
- mon.setBackgroundColor(colors.green)
- mon.setTextColor(colors.black)
- mon.write("Turbine")
- else
- mon.setCursorPos(1,2)
- mon.clearLine()
- mon.setBackgroundColor(colors.red)
- mon.setTextColor(colors.black)
- mon.write("Turbine")
- end
- if tur.getInductorEngaged() == (true) then
- mon.setCursorPos(1,3)
- mon.clearLine()
- mon.setBackgroundColor(colors.green)
- mon.setTextColor(colors.black)
- mon.write("Inductor")
- else
- mon.setCursorPos(1,3)
- mon.clearLine()
- mon.setBackgroundColor(colors.red)
- mon.setTextColor(colors.black)
- mon.write("Inductor")
- end
- if speed <= min then
- tur.setInductorEngaged(false)
- end
- if speed > min then
- tur.setInductorEngaged(true)
- end
- if tur.getRotorSpeed() <= low then
- tur.setActive(true)
- end
- if tur.getRotorSpeed() >= high then
- tur.setActive(false)
- end
- sleep(1)
- mon.setBackgroundColor(colors.black)
- mon.clear()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement