Advertisement
chand1012

Wireless Computercraft Test

Jul 18th, 2016
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 KB | None | 0 0
  1. local modem = peripheral.wrap("left")
  2. modem.open(3)  -- Open channel 3 so that we can listen on it
  3. local event, modemSide, senderChannel,
  4.   replyChannel, message, senderDistance = os.pullEvent("modem_message")
  5.  
  6. print("I just received a message on channel: "..senderChannel)
  7. print("I should apparently reply on channel: "..replyChannel)
  8. print("The modem receiving this is located on my "..modemSide.." side")
  9. print("The message was: "..message)
  10. print("The sender is: "..(senderDistance or "an unknown number of").." blocks away from me.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement