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)
- monitor.setTextScale(0.5)
- 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.setCursorPos(1,1)
- monitor.clear()
- monitor.setBackgroundColor(bgc)
- monitor.setTextColor(tc)
- monitor.setCursorPos(8, 4)
- monitor.write("Automated Power Control")
- monitor.setCursorPos(8, 5)
- monitor.write("-=-=-=-=-=-=-=-=-=-=-=-")
- monitor.setCursorPos(8, 6)
- monitor.write(mode)
- sleep(1)
- rs.setOutput(side,false)
- term.setCursorPos(1,3)
- end
- while rs.getInput("front") == false
- do
- local speed = rs.getAnalogInput("top")
- if speed == 15
- then
- shift ("right", "Full Power", colors.green, colors.white)
- end
- if speed == 14
- then
- shift ("back", "Low Power", colors.blue, colors.white)
- end
- if speed == 9
- then
- shift ("left", "Standby", colors.yellow, colors.black)
- end
- if speed == 8
- then
- shift ("bottom", "Offline", colors.red, colors.white)
- end
- end
Add Comment
Please, Sign In to add comment