Avorius1337

Untitled

Dec 24th, 2022
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. modem = peripheral.wrap("right")
  2. rednet.open("right")
  3.  
  4. if rednet.isOpen() then
  5. print("Rednet online")
  6. else
  7. print("Rednet failed to load")
  8. return
  9. end
  10.  
  11. function recSig()
  12. local id, msg = rednet.receive()
  13. if id == 2 or id == 4 or id == 10 then
  14. if msg == "windmill" then
  15. if redstone.getOutput("top") then
  16. redstone.setOutput("top", false)
  17.  
  18. else
  19. redstone.setOutput("top", true)
  20. end
  21. end
  22. end
  23. if msg == nil and redstone.getOutput("top") then
  24. sleep(10)
  25. redstone.setOutput("top", false)
  26. elseif msg == "windmill" and redstone.getOutput("top") then
  27. redstone.setOutput("top", false)
  28. end
  29. end
  30.  
  31. while true do recSig() end
  32.  
  33.  
  34.  
  35.  
Advertisement
Add Comment
Please, Sign In to add comment