Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --opening rednet modem
- rednet.open("left")
- --wraping the top monitor
- mon = peripheral.wrap("back")
- term.setCursorPos(1,1)
- term.clear()
- while true do
- --waiting to receive a message from the server (server > client transfer)
- prot,id,msg = os.pullEvent("rednet_message")
- if id == 3 then
- if msg ~= "alarm" then
- term.clear()
- term.setCursorPos(1,1)
- mon.clear()
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.white)
- mon.write("Welcome "..msg)
- mon.setCursorPos(1,2)
- mon.write("Have a great Day")
- sleep(4)
- term.clear()
- term.setCursorPos(1,1)
- mon.clear()
- mon.setCursorPos(1,1)
- else
- term.clear()
- term.setCursorPos(1,1)
- mon.clear()
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.red)
- mon.write("Intruder Alert!")
- rs.setOutput("right",true)
- prot,id,msg = os.pullEvent("rednet_message")
- if msg == "stop" then
- term.clear()
- term.setCursorPos(1,1)
- mon.clear()
- mon.setCursorPos(1,1)
- rs.setOutput("right",false)
- os.reboot()
- else
- print(":Warning: Unauthorized transmission has been received")
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement