Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modem = peripheral.find("modem")
- local monitor = peripheral.wrap("front")
- monitor.clear()
- monitor.setCursorPos(1,1)
- term.clear()
- term.setCursorPos(1,1)
- print("Running...")
- local function shift(side, mode, bgc, tc)
- rs.setOutput(side, true)
- modem.transmit(2,3,mode)
- monitor.setBackgroundColor(bgc)
- monitor.setCursorPos(1,1)
- monitor.clear()
- monitor.setBackgroundColor(bgc)
- monitor.setTextColor(tc)
- monitor.setCursorPos(4, 2)
- monitor.write("Turbine #1")
- monitor.setCursorPos(2, 3)
- monitor.write("-=-=-=-=-=-=-=-")
- monitor.setCursorPos(5, 4)
- monitor.write(mode)
- term.setCursorPos(1,3)
- sleep(1)
- end
- while rs.getInput("front") == false
- do
- if rs.getAnalogInput("top") == 0
- then
- rs.setOutput("back", false)
- shift ("bottom", "Offline", colors.red, colors.white)
- elseif rs.getAnalogInput("top") >= 1 and rs.getAnalogInput("top") <=8
- then
- rs.setOutput("back", false)
- shift ("bottom", "Low RPM", colors.orange, colors.black)
- sleep(10)
- elseif rs.getAnalogInput("top") >= 9
- then
- shift ("back", "Engaged", colors.green, colors.white)
- else
- return
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement