ROMVoid

Untitled

Sep 9th, 2019
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. local tText = {
  2. "Giving away free Ender Mailboxes",
  3. "Please just take 1",
  4. "   ",
  5. "Taking special requests",
  6. "/mail s ROMVoid <request>",
  7. "Price will be determined",
  8. "after request is received",
  9. "     ",
  10. "Purchase will be sent",
  11. "via Ender Mailbox"
  12. }
  13. local sSide = "top"
  14. local nTextSize = 0.5
  15.  
  16. local function printCenter(mon, t)
  17.   local w, h = mon.getSize()
  18.   local y = math.floor((h / 2) - (#t / 2)) - 1
  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 mon = peripheral.wrap(sSide)
  27. mon.setTextScale(nTextSize)
  28. printCenter(mon, tText)
Advertisement
Add Comment
Please, Sign In to add comment