Guest User

Untitled

a guest
Dec 10th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.51 KB | None | 0 0
  1. local tText = {
  2. "1. Sorting system",
  3. "2. Quarry",
  4. "3. Build more..."
  5. }
  6.  
  7. local sSide = "top"
  8.  
  9. local function printCenter(mon, t)
  10.   local w, h = mon.getSize()
  11.   local y = math.floor((h / 2) - (#t / 2)) - 1
  12.   for i, line in ipairs(t) do
  13.         local x = math.floor((w / 2) - (#line / 2))
  14.         mon.setCursorPos(x, y + i)
  15.         mon.write(line)
  16.   end
  17. end
  18.  
  19. mon = peripheral.wrap(sSide)
  20. mon.clear()
  21. mon.setCursorPos(1,1)
  22. mon.write("---------- ToDo ----------")
  23. printCenter(peripheral.wrap(sSide), tText)
Add Comment
Please, Sign In to add comment