Advertisement
dracoix

DM - MB

Sep 6th, 2012
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.96 KB | None | 0 0
  1.     --0123456789ABCDEF0123456789ABCDEF0123456789ABCDE
  2.      
  3.     local aText = {
  4.      "******************",
  5.      "** Dragons' ATM **",
  6.      "******************",
  7.      "We accept:",
  8.      "Diamonds,",
  9.      "Credits,",
  10.      "And Souls.",
  11.     }
  12.      
  13.     local sSide = "back"
  14.      
  15.     local function printCenter(mon, t)
  16.       local w, h = mon.getSize()
  17.       mon.clear()
  18.       local y = math.floor((h / 2) - (#t / 2))
  19.       for i, line in ipairs(t) do
  20.             local x = math.floor((w / 2) - (#line / 2))
  21.             mon.setCursorPos(x, y + i)
  22.             mon.write(line)
  23.       end
  24.     end
  25.      
  26.     local function printLeft(mon, t)
  27.       local w, h = mon.getSize()
  28.       mon.setTextScale(1)
  29.       mon.clear()
  30.       local y = math.floor((h / 2) - (#t / 2))
  31.       for i, line in ipairs(t) do
  32.             local x = 1
  33.             mon.setCursorPos(x, y + i)
  34.             mon.write(line)
  35.       end
  36.     end
  37.      
  38.     printLeft(peripheral.wrap(sSide), aText)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement