Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- settings.set(username,"RedTropics")
- term.clear()
- local modem = peripheral.wrap("top")
- modem.open(3)
- function WriteMessageFromOtherPlayer(message)
- term.setCursorPos(1,3)
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.yellow)
- term.write("You receive a message:")
- term.setCursorPos(1,4)
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- term.write(message)
- end
- while true do
- local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
- term.setCursorPos(1,1)
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- local MessageInput = read()
- WriteMessageFromOtherPlayer(message)
- if message then
- modem.transmit(7, 3, "Hello world!")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement