Advertisement
Guest User

logger.lua

a guest
Oct 15th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. x,y = term.getSize()
  2. text = "shid and fard came"
  3. scrollat = 7
  4. printed = 0
  5.  
  6. rednet.open("bottom")
  7. term.setBackgroundColor(colors.lightGray)
  8. term.clear()
  9. --term.setCursorPos(1,1)
  10. term.setTextColor(colors.black)
  11.  
  12. term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), 2)
  13. write(text .. "\n\n")
  14.  
  15. while true do
  16.     id,message = rednet.receive()
  17.     message = message .. " [" .. id .. "]"
  18.     local x2,y2 = term.getCursorPos()
  19.     if printed < scrollat then
  20.         printed = printed + 1
  21.         y2 = y2 + 1
  22.     else
  23.         term.scroll(1)
  24.     end
  25.     term.setCursorPos(math.ceil((x / 2) - (message:len() / 2)), y2)
  26.     write(message)
  27.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement