Advertisement
mikebald

Wireless_Monitor

Jul 19th, 2014
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.60 KB | None | 0 0
  1. local serverID = 0 -- change to the id of the computer that sends the message
  2. local mSide = "back" -- change to the side of the monitor
  3. local rSide = "right"
  4. local sTitle = "====== Remote Display ======"
  5.  
  6. local mon = peripheral.wrap(mSide)
  7. while true do
  8.   rednet.open(rSide)
  9.   local id, msg = rednet.receive()
  10.   if id == serverID then
  11.     mon.clear()
  12.     local obj = textutils.unserialize(msg)
  13.     mon.setCursorPos(1,1)
  14.     mon.write(sTitle)
  15.     local mon_y = 2
  16.     for k,v in pairs(obj) do
  17.         mon.setCursorPos(1, mon_y)
  18.         mon.write(v)
  19.         mon_y = mon_y + 1
  20.     end
  21.   end
  22.   rednet.close(rSide)
  23.   os.sleep(2)
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement