ksbd

quick wireless program

Jul 23rd, 2013
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.41 KB | None | 0 0
  1. local senderId, message, distance
  2.  
  3. function netClose()
  4.         rednet.close("right")
  5. end
  6.  
  7. function netOpen()
  8.         netClose()
  9.         rednet.open("right")
  10. end
  11.  
  12. function getData()
  13.         senderId, message, distance = rednet.receive()
  14. end
  15.  
  16. while true do
  17.     netOpen()
  18.     getData()
  19.     if message == open then
  20.         redstone.setOutput("top", true)
  21.     else
  22.         redstone.setOutput("top", false)
  23.     end
  24. sleep(1)
  25. end
Advertisement
Add Comment
Please, Sign In to add comment