Advertisement
DOGGYWOOF

Untitled

Jan 1st, 2024
12
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. rednet.open("left") -- Open the modem on the side you want to use
  2. local channel = 123 -- Set the same channel number as the server
  3.  
  4. local serverID = 100 -- Replace with the ID of the server (check rednet API or use discovery)
  5.  
  6. while true do
  7. print("Enter your message: ")
  8. local message = read() -- Read input from the user
  9.  
  10. rednet.send(serverID, message, channel) -- Send the message to the server
  11.  
  12. -- Optionally, wait for a response from the server
  13. -- local senderId, response, distance = rednet.receive(channel)
  14. -- print("Response from server: " .. response)
  15. end
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement