mouse03f

online

Mar 3rd, 2021 (edited)
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.34 KB | None | 0 0
  1. function online()
  2. term.clear()
  3. term.setCursorPos(1,1)
  4.  
  5. rednet.open("back")
  6. function receive()
  7.     while(true) do
  8.     local id, msg = rednet.receive()
  9.     print(msg)
  10.     end
  11. end
  12.  
  13. function send()
  14.     while(true) do
  15.     local msg = io.read()
  16.     rednet.broadcast(msg)
  17.     end
  18. end
  19. parallel.waitForAll(receive,send)
  20. end
  21. online()
Add Comment
Please, Sign In to add comment