Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local monitor = peripheral.wrap("right")
- rednet.open("left")
- function write_to_screen(sender, function)
- monitor.term.setTextColor(colors.white)
- monitor.write("Received message from: ")
- monitor.term.setTextColor(colors.green)
- monitor.write(sender)
- monitor.term.setTextColor(colors.white)
- monitor.write(", with message: ")
- monitor.term.setTextColor(colors.gray)
- monitor.write(sender)
- end
- --Main
- rednet.host("servers", "main")
- --Infinite main loop
- while true do
- local senderId, message, protocol = rednet.receive()
- write_to_screen(senderId, message)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement