The3vilM0nk3y

Shop Ads

Apr 27th, 2015
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. text = {
  2. {
  3. "Get A Cheap",
  4. "AE System Here!"
  5. },
  6. {
  7. "Shop now Open!",
  8. "Come on in."
  9. },
  10. {
  11. "Lots of great",
  12. "Items For",
  13. "Sale Cheap!"
  14. },
  15. {
  16. "Lots of Items",
  17. "in Stock"
  18. },
  19. {
  20. "Stop in now for",
  21. "great deals"
  22. },
  23. {
  24. "More Items to",
  25. "be added soon."
  26. },
  27. {
  28. "Great Steals",
  29. "I mean deals",
  30. "here."
  31. },
  32. {
  33. "Inventory",
  34. "Restocked",
  35. "Often"
  36. },
  37. {
  38. "Obtain some",
  39. "really cheap",
  40. "stuff here"
  41. }
  42. }
  43. symbols = {"#","~","!","@","$","%","*","-","+","=","X",".","&","o","H","W"}
  44. cS = {}
  45. cS[1] = {}
  46. cS[1].textC = colors.white
  47. cS[1].bg = colors.green
  48. cS[2] = {}
  49. cS[2].textC = colors.black
  50. cS[2].bg = colors.white
  51. cS[3] = {}
  52. cS[3].textC = colors.red
  53. cS[3].bg = colors.yellow
  54. cS[4] = {}
  55. cS[4].textC = colors.yellow
  56. cS[4].bg = colors.purple
  57. cS[5] = {}
  58. cS[5].textC = colors.lime
  59. cS[5].bg = colors.black
  60. cS[6] = {}
  61. cS[6].textC = colors.pink
  62. cS[6].bg = colors.lime
  63. cS[7] = {}
  64. cS[7].textC = colors.lime
  65. cS[7].bg = colors.red
  66. cS[8] = {}
  67. cS[8].textC = colors.orange
  68. cS[8].bg = colors.black
  69. cS[9] = {}
  70. cS[9].textC = colors.cyan
  71. cS[9].bg = colors.gray
  72. function center(text)
  73. local w,h = term.getSize()
  74. local x,y = term.getCursorPos()
  75. local len = string.len(text)
  76. term.setCursorPos(math.ceil((w/2)-(len/2)),y)
  77. write(text)
  78. term.setCursorPos(1,y+1)
  79. end
  80. mNames = peripheral.getNames()
  81. m= {}
  82. for i=1, #mNames do
  83. if peripheral.getType(mNames[i]) == "monitor" then
  84. table.insert(m,peripheral.wrap(mNames[i]))
  85. end
  86. end
  87. for i=1, #m do
  88. m[i].setTextScale(4)
  89. end
  90. colorChange = 0
  91. curCS = math.random(#cS)
  92. while true do
  93. for i=1,#m do
  94. curCS = math.random(#cS)
  95. curAd = math.random(#text)
  96. curSym = math.random(#symbols)
  97. term.redirect(m[i])
  98. term.setBackgroundColor(cS[curCS].bg)
  99. term.setTextColor(cS[curCS].textC)
  100. -- term.setTextScale(5)
  101. term.clear()
  102. term.setCursorPos(1,1)
  103. w,h= term.getSize()
  104. for j=1,w do
  105. term.setCursorPos(j,1)
  106. write(symbols[curSym])
  107. term.setCursorPos(j,h)
  108. write(symbols[curSym])
  109. end
  110. for j=1,h-1 do
  111. term.setCursorPos(1,j+1)
  112. write(symbols[curSym])
  113. term.setCursorPos(w,j+1)
  114. write(symbols[curSym])
  115. end
  116. term.setCursorPos(1,2)
  117. center("RedStoner's")
  118. term.setCursorPos(1,3)
  119. center("Stash")
  120. term.setCursorPos(1,5)
  121. for j=1, #text[curAd] do
  122. center(text[curAd][j])
  123. end
  124. colorChange = colorChange + 1
  125. if colorChange > 5 then
  126. colorChange = 0
  127. curCS = math.random(3)
  128. end
  129. sleep(1)
  130. end
  131. end
Advertisement
Add Comment
Please, Sign In to add comment