Advertisement
Guest User

ms

a guest
Sep 3rd, 2015
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.55 KB | None | 0 0
  1. function connect()
  2.   rednet.open("left")
  3.   return true
  4. end
  5.  
  6. if connect() == true then
  7.   term.setBackgroundColor(colors.white)
  8.   term.setTextColor(colors.gray)
  9.   term.setCursorPos(1, 1)
  10.   term.clear()
  11.   id = os.computerID()
  12.   print("Your id: "..id.." Input text message.")
  13.   idR1, messageR1 = rednet.receive(5)
  14.     if idR1 ~= nil then
  15.       print(idR1..": "..messageR1)
  16.   end
  17.  
  18.   while true do
  19.     write(id..": ")
  20.     message = read()
  21.     rednet.broadcast(message)
  22.     idR, messageR = rednet.receive()
  23.     print(idR..": "..messageR)
  24.   end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement