Advertisement
Yorinar

PartyHouseEcho

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