DMeville

Untitled

Jul 8th, 2013
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. spawners = {false, false}
  2.  
  3. function toggle(i)
  4. if spawners[i] == true then spawners[i] = false
  5. else spawners[i] = true
  6. end
  7.  
  8. if spawners[0] == true then redstone.setOutput("top",true)
  9. else redstone.setOutput("top", false)
  10. end
  11. if spawners[1] == true then redstone.setOutput("bottom", true)
  12. else redstone.setOutput("bottom", false)
  13. end
  14. end
  15.  
  16. rednet.open("left")
  17. while true do
  18. senderId, message, distance = rednet.receive()
  19. print("Message recieved: " ..message)
  20. if message == "1" then
  21.   toggle(1)
  22. elseif message == "0" then
  23.   toggle(0)
  24. end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment