Guest User

Untitled

a guest
Jul 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.69 KB | None | 0 0
  1. local monitor = peripheral.wrap( "left" )
  2. monitor.write = function(txtout)
  3.     peripheral.call("left","write",txtout)
  4.     column2,row2 = monitor.getCursorPos()
  5.     row2 = row2 + 1
  6.     monitor.setCursorPos(1,row2)
  7. end
  8. rednet.open("right")
  9. rednet.announce()
  10. monitor.write("["..os.computerID().." (You)] connected.")
  11. while true do
  12.     local event, p1, p2, p3, p4, p5 = os.pullEventRaw()
  13.     if event == "rednet_message" then
  14.     if p1 then
  15.         if p2 ~= "" then
  16.             monitor.write("<"..p1.."> "..p2)
  17.         else
  18.             monitor.write("["..p1.."] connected.")
  19.         end
  20.     end
  21.     local send = read()
  22.     if send ~= "/quit" then
  23.         rednet.broadcast(send)
  24.         monitor.write("<"..os.computerID().."> "..send)
  25.     else
  26.         exit()
  27.     end
  28.     end
  29. end
Add Comment
Please, Sign In to add comment