Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.wrap("bottom") -- set monitor side
- rednet.open("right") -- set rednet side
- console = 146 -- enter ID of computer attached to the touch screen
- nir = 147 -- enter ID of computer attached to the Nuclear information reader
- maxTemp = 5000
- temp = 1000
- rctrStatus = "off"
- while true do
- a,b = rednet.receive()
- if a == console then
- if b == "on" then
- rs.setOutput("back", true)
- rctrStatus = "on"
- break
- elseif b == "off" then
- break
- end
- end
- end
- while true do
- if temp >= maxTemp then
- rs.setOutput("back", false)
- -- elseif temp >= 7500 then
- -- rs.setOutput("back" ,false)
- end
- a,b = rednet.receive()
- if a == nir then
- temp = tonumber(b)
- elseif a == console then
- if b == "maxTemp" then
- rednet.send(console, "ping")
- id, message = rednet.receive()
- message = tonumber(message)
- --if message < 7500 and
- if id == console then
- maxTemp = message
- rednet.send(console, "true")
- else
- rednet.send(console, "false")
- end
- elseif b == "on" then
- if temp < maxTemp then
- rs.setOutput("back", true)
- rednet.send(console, "true")
- rctrStatus = "on"
- print("On received")
- else
- rednet.send(console, "false")
- end
- elseif b == "off" then
- rs.setOutput("back", false)
- rednet.send(console, "true")
- rctrStatus ="Off"
- end
- end
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("Reactor: "..rctrStatus)
- mon.setCursorPos(1,3)
- mon.write("Current Temp: "..temp)
- end
Advertisement
Add Comment
Please, Sign In to add comment