Slaide

Untitled

Mar 31st, 2023
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. local modem = peripheral.find("modem") or error("No modem attached", 0)
  2. modem.open(43) -- Open 43 so we can receive replies
  3.  
  4. -- Send our message
  5. modem.transmit(15, 43, "Hello, world!")
  6.  
  7. -- And wait for a reply
  8. local event, side, channel, replyChannel, message, distance
  9. repeat
  10. event, side, channel, replyChannel, message, distance = os.pullEvent("modem_message")
  11. until channel == 43
  12.  
  13. print("Received a reply: " .. tostring(message))
Add Comment
Please, Sign In to add comment