Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- reactor = peripheral.wrap("back")
- mon = peripheral.wrap("bottom")
- term.redirect(mon)
- function parse(cmd)
- if cmd == "activate" then
- reactor.setActive(true)
- elseif cmd == "deactivate" then
- reactor.setActive(false)
- elseif cmd == "exit" then
- exit = true
- end
- end
- function main()
- term.setCursorPos(1,1)
- if reactor.getActive() then
- term.setBackgroundColor(colors.green)
- term.setTextColor(colors.blue)
- term.clear()
- mon.setTextScale(1)
- term.write("Active")
- else
- term.setBackgroundColor(colors.red)
- term.setTextColor(colors.blue)
- term.clear()
- mon.setTextScale(2)
- term.write(" INACTIVE")
- end
- term.setCursorPos(1,2)
- --mon.setTextScale(1)
- term.write("Command:")
- cmd = io.read()
- parse(cmd)
- end
- function timer()
- local myTimer = os.startTimer(10)
- while true do
- local event,timerID = os.pullEvent("timer")
- if timerID == myTimer then break end
- end
- end
- repeat
- parallel.waitForAny(main,timer)
- until exit
- term.restore()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement