Advertisement
Yorinar

ohouse1

Oct 2nd, 2013
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. local side = "top"
  2. local text = "Mine"
  3. local mon = peripheral.wrap(side)
  4. local last_message = ""
  5. rednet.open("left")
  6.  
  7. mon.setTextScale(3)
  8. while true do
  9.   mon.setCursorPos(1,1)
  10.   mon.write(text..": "..textutils.formatTime(os.time(),false))
  11.   mon.setCursorPos(1,2)
  12.   mon.write(last_message)
  13.  
  14.   id, message = rednet.receive(1)
  15.   if message ~= nil and message ~= 'ACKNOWLEDGED' then
  16.     write("received message from "..id..":\n"..message)
  17.     last_message = message
  18.     rednet.broadcast("ACKNOWLEDGED")
  19.   end
  20.   mon.clear()
  21.   term.setCursorPos(1,1)
  22. end
  23.  
  24. rednet.close("left")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement