Advertisement
dracoix

DM - Deals

Aug 20th, 2012
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.30 KB | None | 0 0
  1. --0123456789ABCDEF0123456789ABCDEF0123456789ABCDE
  2.  
  3. local aText = {
  4.  " ",
  5.  "Dragons' Gifts",
  6.  " ",
  7. }
  8.  
  9. local bText = {
  10.   "We Have Too Many Items",
  11.   "All items here are surplus.",
  12.   "Help us be rid of them.",
  13. }
  14.  
  15. local cText = {
  16.   "Remember: If you don't protect your",
  17.   "land, you will be raided, machines",
  18.   "taken, items lost. However...",
  19. }
  20.  
  21. local dText = {
  22.   "You'll know if it was us, for we",
  23.   "spare all buildings that are not",
  24.   "cobble-hovels. We do not grief.",
  25. }
  26.  
  27. local sSide = "front"
  28.  
  29. local function printCenter(mon, t)
  30.   local w, h = mon.getSize()
  31.   mon.clear()
  32.   local y = math.floor((h / 2) - (#t / 2))
  33.   for i, line in ipairs(t) do
  34.         local x = math.floor((w / 2) - (#line / 2))
  35.         mon.setCursorPos(x, y + i)
  36.         mon.write(line)
  37.   end
  38. end
  39.  
  40. local function printLeft(mon, t)
  41.   local w, h = mon.getSize()
  42.   mon.setTextScale(1)
  43.   mon.clear()
  44.   local y = math.floor((h / 2) - (#t / 2))
  45.   for i, line in ipairs(t) do
  46.         local x = 1
  47.         mon.setCursorPos(x, y + i)
  48.         mon.write(line)
  49.   end
  50. end
  51.  
  52. while 0<1 do
  53. printCenter(peripheral.wrap(sSide), aText)
  54. os.sleep(5)
  55. printCenter(peripheral.wrap(sSide), bText)
  56. os.sleep(5)
  57. printLeft(peripheral.wrap(sSide), cText)
  58. os.sleep(5)
  59. printLeft(peripheral.wrap(sSide), dText)
  60. os.sleep(5)
  61.  
  62. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement