Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for a,b in pairs(rs.getSides()) do
- if peripheral.getType(b) == "modem" then
- rednet.open(b)
- break
- end
- end
- function _setOuput(side)
- rs.setOutput(side, true)
- sleep(1)
- rs.setOutput(side, false)
- end
- while true do
- id, message, protocol = rednet.receive()
- if protocol == "SarasMessage Protocol" then
- if message == "SET_TO_DAY" then
- print("Setting to day")
- rednet.send(id, "Message Received", "ResponseProtocol1")
- _setOutput("left")
- else if message == "SET_TO_CLEAR" then
- print("Setting the weather to clear")
- rednet.send(id, "Message Received", "ResponseProtocol1")
- _setOutput("right")
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment