Guest User

Untitled

a guest
Oct 27th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. rednet.open("right") --enable modem on the right side of the PC
  2. id,message = rednet.receive() --wait until a mesage is received
  3. if id == 1 and message == "Hello world" then
  4. rednet.send(1,"Hello from pc2") -- send a message to only the PC with ID 1
  5. id,message = rednet.receive() -- Wait until a message is received
  6. if message == "How are you" then
  7. rednet.broadcast("Fine thanks") -- Send to all PCs in range
  8. end
  9. end
  10. rednet.close("right") -- disable modem on the right side of the PC
Add Comment
Please, Sign In to add comment