Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.wrap("right")
- reactor = peripheral.wrap("left")
- mon.setBackgroundColor(colors.blue)
- while true do
- mon.clear()
- mon.setTextScale(1.5)
- mon.setCursorPos(1,2)
- mon.setTextColor(colors.white)
- mon.write("ReactorOS 1.0")
- mon.setCursorPos(1,4)
- mon.write("1: Reactor On")
- mon.setCursorPos(1,6)
- mon.write("2: Reactor Off")
- mon.setCursorPos(1,8)
- mon.write("3: Check Temperature")
- event, side, x, y = os.pullEvent("monitor_touch")
- if x > 0 and x < 12 and y == 4 then
- print("Reactor On")
- mon.clear()
- reactor.setActive(true)
- mon.setTextScale(2)
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.red)
- mon.write("Reactor Engaged")
- sleep(5)
- else if x > 0 and x < 13 and y == 6 then
- print("Reactor Off")
- mon.clear()
- reactor.setActive(false)
- mon.setTextScale(2)
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.red)
- mon.write("Reactor Disengaged")
- sleep(5)
- else if x > 0 and x < 19 and y == 8 then
- print("Temperature Read")
- mon.clear()
- mon.setTextScale(2)
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.red)
- mon.write("Temperature:")
- mon.setCursorPos(1,4)
- temp = reactor.getFuelTemperature()
- print(temp , " C")
- mon.write(temp)
- mon.setCursorPos(1,5)
- mon.write("Degrees C")
- sleep(5)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment