Silasko

monitor write

Dec 1st, 2020 (edited)
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. function pc_listen()
  2. local monitor = peripheral.wrap("right")
  3. local x=1
  4. local y=1
  5. monitor.clear()
  6. rednet.open("left")
  7. monitor.setCursorPos(x,y)
  8. while true do
  9. id,message = rednet.receive()
  10. print("Device "..id..": ")
  11. print(message)
  12. monitor.write("Turtle "..id..": ")
  13. y=y+1
  14. monitor.setCursorPos(x,y)
  15. monitor.write(message)
  16. y=y+1
  17. monitor.setCursorPos(x,y)
  18. end
  19. end
  20. pc_listen()
Add Comment
Please, Sign In to add comment