Guest User

ads

a guest
Aug 28th, 2015
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.53 KB | None | 0 0
  1. changeDelay = 1
  2. text = {
  3.   {
  4.   "Get A Cheap",
  5.   "AE System Here!"
  6.   },
  7.   {
  8.   "Shop now Open!",
  9.   "Come on in."
  10.   },
  11.   {
  12.   "Lots of great",
  13.   "Items For",
  14.   "Sale Cheap!"
  15.   },
  16.   {
  17.   "Lots of Items",
  18.   "in Stock"
  19.   },
  20.   {
  21.   "Stop in now for",
  22.   "great deals"
  23.   },
  24.   {
  25.   "More Items to",
  26.   "be added soon."
  27.   },
  28.   {
  29.   "Great Steals",
  30.   "I mean deals",
  31.   "here."
  32.   },
  33.   {
  34.   "Inventory",
  35.   "Restocked",
  36.   "Often"
  37.   },
  38.   {
  39.   "Obtain some",
  40.   "really cheap",
  41.   "stuff here"
  42.   },
  43.   {
  44.   "Supplies",
  45.   "for wings",
  46.   "sold here"
  47.   },
  48.   {
  49.   "Nether",
  50.   "Stars",
  51.   "Sold",
  52.   "Here"
  53.   },
  54.   {
  55.   "Cursed",
  56.   "Earth In",
  57.   "Stock Now"
  58.   },
  59.   {
  60.   "Advanced",
  61.   "Metals",
  62.   "Sold Here"
  63.   },
  64.   {
  65.   "Conduits",
  66.   "Now On",
  67.   "Sale"
  68.   },
  69.   {
  70.   "Resonant",
  71.   "Ender Tanks",
  72.   "Available",
  73.   "Now"
  74.   },
  75.   {
  76.   "A Tech's",
  77.   "One-Stop",
  78.   "Shop"
  79.   },
  80.   {
  81.   "Tanks of",
  82.   "Gelid",
  83.   "Cryotheum",
  84.   "Sold Here"
  85.   },
  86.   {
  87.   "Private",
  88.   "Tesseracts",
  89.   "In Stock"
  90.   },
  91.   {
  92.   "ME Quantum",
  93.   "Bridges and",
  94.   "Singularities",
  95.   "Sold Here"
  96.   },
  97.   {
  98.   "Deep Storage",
  99.   "Units Now",
  100.   "Available"
  101.   },
  102.   {
  103.   "Get Your",
  104.   "QED And",
  105.   "Ender Flux",
  106.   "Crystals Here"
  107.   },
  108.   {
  109.   "Selling",
  110.   "Division",
  111.   "Sigils",
  112.   "At A Low Price"
  113.   },
  114.   {
  115.   "Store More",
  116.   "Fluid With A",
  117.   "Bedrockium",
  118.   "Drum"
  119.   }
  120.  
  121. }
  122. symbols = {"#","~","!","@","$","%","*","-","+","=","X",".","&","o","H","W",":","|"}
  123. cS = {}
  124. cS[1] = {}
  125. cS[1].textC = colors.white
  126. cS[1].bg = colors.green
  127. cS[2] = {}
  128. cS[2].textC = colors.black
  129. cS[2].bg = colors.white
  130. cS[3] = {}
  131. cS[3].textC = colors.red
  132. cS[3].bg = colors.yellow
  133. cS[4] = {}
  134. cS[4].textC = colors.yellow
  135. cS[4].bg = colors.purple
  136. cS[5] = {}
  137. cS[5].textC = colors.lime
  138. cS[5].bg = colors.black
  139. cS[6] = {}
  140. cS[6].textC = colors.pink
  141. cS[6].bg = colors.lime
  142. cS[7] = {}
  143. cS[7].textC = colors.lime
  144. cS[7].bg = colors.red
  145. cS[8] = {}
  146. cS[8].textC = colors.orange
  147. cS[8].bg = colors.black
  148. cS[9] = {}
  149. cS[9].textC = colors.cyan
  150. cS[9].bg = colors.gray
  151. cS[10] = {}
  152. cS[10].textC = colors.black
  153. cS[10].bg = colors.lime
  154. function center(text)
  155.   local w,h = term.getSize()
  156.   local x,y = term.getCursorPos()
  157.   local len = string.len(text)
  158.   term.setCursorPos(math.ceil((w/2)-(len/2)),y)
  159.   write(text)
  160.   term.setCursorPos(1,y+1)
  161. end
  162. mNames = peripheral.getNames()
  163. m= {}
  164. for i=1, #mNames do
  165.   if peripheral.getType(mNames[i]) == "monitor" then
  166.     table.insert(m,peripheral.wrap(mNames[i]))
  167.   end
  168. end
  169. for i=1, #m do
  170.   m[i].setTextScale(4)
  171. end
  172. colorChange = 0
  173. curCS = math.random(#cS)
  174. while true do
  175.   for i=1,#m do
  176.     curCS = math.random(#cS)
  177.     curAd = math.random(#text)
  178.     curSym = math.random(#symbols)
  179.     term.redirect(m[i])
  180.     term.setBackgroundColor(cS[curCS].bg)
  181.     term.setTextColor(cS[curCS].textC)
  182. --    term.setTextScale(5)
  183.     term.clear()
  184.     term.setCursorPos(1,1)
  185.     w,h= term.getSize()
  186.     for j=1,w do
  187.       term.setCursorPos(j,1)
  188.       write(symbols[curSym])
  189.       term.setCursorPos(j,h)
  190.       write(symbols[curSym])
  191.     end
  192.     for j=1,h-1 do
  193.       term.setCursorPos(1,j+1)
  194.       write(symbols[curSym])
  195.       term.setCursorPos(w,j+1)
  196.       write(symbols[curSym])
  197.     end
  198.     term.setCursorPos(1,2)
  199.     center("RedStoner's")
  200.     term.setCursorPos(1,3)
  201.     center("Stash")
  202.     term.setCursorPos(1,5)
  203.     for j=1, #text[curAd] do
  204.       center(text[curAd][j])
  205.     end
  206.     colorChange = colorChange + 1
  207.     if colorChange > 5 then
  208.       colorChange = 0
  209.       curCS = math.random(3)
  210.     end
  211.   sleep(changeDelay)
  212.   end
  213. end
Advertisement
Add Comment
Please, Sign In to add comment