Avorius1337

Untitled

Dec 24th, 2022
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 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. elseif msg == nil and redstone.getOutput("top") then
  22. sleep(10)
  23. redstone.setOutput("top", false)
  24. elseif msg == "windmill" and redstone.getOutput("top") then
  25. redstone.setOutput("top", false)
  26. end
  27. end
  28. end
  29.  
  30. while true do recSig() end
  31.  
  32.  
  33.  
  34.  
Advertisement
Add Comment
Please, Sign In to add comment