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
- while true do
- repeat
- os.pullEvent("redstone")
- until rs.getInput("right") and rs.getAnalogInput("left") >= 4
- rednet.send(64, "SET_TO_DAY", "SarasWeatherProtocol")
- print("Sending Command to Database")
- id, message, protocol = rednet.receive()
- if protocol == "ResponseProtocol1" then
- print(message)
- else
- print("Message Received from Unauthorized Source")
- write("Message is as follows: ")
- print(message)
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment