Advertisement
Darking560

send&receive

Apr 2nd, 2014
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. rednet.open("back")
  2.  
  3.  
  4. function receive()
  5. while true do
  6. event, id, message = os.pullEvent("rednet_message")
  7. print(id.." envoie ".. message)
  8. end
  9. end
  10.  
  11.  
  12.  
  13. function send()
  14. while true do
  15. print("id :")
  16. id = read()
  17. print("message")
  18. message = read()
  19. rednet.send(id,message)
  20. end
  21. end
  22.  
  23. parallel.waitForAll(receive(), send())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement