Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("left") -- Open the modem on the side you want to use
- local channel = 123 -- Set the same channel number as the server
- local serverID = 100 -- Replace with the ID of the server (check rednet API or use discovery)
- while true do
- print("Enter your message: ")
- local message = read() -- Read input from the user
- rednet.send(serverID, message, channel) -- Send the message to the server
- -- Optionally, wait for a response from the server
- -- local senderId, response, distance = rednet.receive(channel)
- -- print("Response from server: " .. response)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement