carrots084

Daylight Sensor

Jan 27th, 2018
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. for a, b in pairs(rs.getSides()) do
  2. if peripheral.getType(b) == "modem" then
  3. rednet.open(b)
  4. break
  5. end
  6. end
  7.  
  8. while true do
  9. repeat
  10. os.pullEvent("redstone")
  11. until rs.getInput("right") and rs.getAnalogInput("left") >= 4
  12. rednet.send(64, "SET_TO_DAY", "SarasWeatherProtocol")
  13. print("Sending Command to Database")
  14. id, message, protocol = rednet.receive()
  15. if protocol == "ResponseProtocol1" then
  16. print(message)
  17. else
  18. print("Message Received from Unauthorized Source")
  19. write("Message is as follows: ")
  20. print(message)
  21. end
  22. sleep(1)
  23. end
Advertisement
Add Comment
Please, Sign In to add comment