Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function centertext(text)
- local w,h = term.getSize()
- term.setCursorPos(math.floor(w/2-text:len()/2+.5), math.floor(h/2+.5))
- io.write(text)
- end
- local function centertextx
- local w,h = term.getSize()
- term.setCursorPos(math.floor(w/2-text:len()/2+.5), 1
- io.write(text)
- end
- term.clear
- term.setCursorPos(1,1)
- rednet.open("pos")
- centertextx("Computer ID: "..os.getComputerID())
- print()
- print()
- while true do
- id,message = rednet.receive()
- local nTime = os.Time
- time_line = textutils.formatTime(nTime,false)
- print(time_line.." > "..message)
- monitor = peripheral.wrap("monitorpos")
- term.redirect(monitor)
- term.setCursorBlink(false)
- term.setTextColors(colors.white)
- term.setBackgroundColor(colors.black)
- term.clear()
- term.setCursorPos(1,1)
- centertext(message)
- term.restaure()
- end
Add Comment
Please, Sign In to add comment