Advertisement
Guest User

rang

a guest
Mar 1st, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.35 KB | None | 0 0
  1.  
  2. function main()
  3.   local xText = {
  4.   "RÃ¥A4nge - Banned Items"
  5.   }
  6.  
  7.   local tText = {
  8.   " ",
  9.   " ",
  10.   " ",
  11.   " ",
  12.   " ",
  13.   " ",
  14.  
  15.   }
  16.   local sSide = "back"
  17.   local nTextSize = 1
  18.   local cTextColor = (colors.white)
  19.   local bgColor = colors.black
  20.   local frColor = colors.orange
  21.  
  22.   function frame(mon)
  23.     local w, h = mon.getSize()
  24.    
  25.     mon.setCursorPos(4,5)
  26.     mon.write("Block breaker")
  27.     mon.setCursorPos(23,5)
  28.     mon.write("Armor stand")
  29.     mon.setCursorPos(42,5)
  30.     mon.write("Nuke")
  31.     mon.setCursorPos(60,5)
  32.     mon.write("World Anchor")
  33.     mon.setCursorPos(4,7)
  34.     mon.setBackgroundColor(colors.orange)
  35.     mon.write("Quarry")
  36.     mon.setBackgroundColor(colors.black)
  37.     mon.setCursorPos(23,7)
  38.     mon.write("Chunk Loader")
  39.     mon.setCursorPos(42,7)
  40.     mon.write("Spot Loader")
  41.     mon.setCursorPos(60,7)
  42.     mon.setBackgroundColor(colors.purple)
  43.     mon.write("Wands")
  44.     mon.setBackgroundColor(colors.black)
  45.     mon.setCursorPos(4,9)
  46.     mon.write("Cloak of Dist.")
  47.     mon.setCursorPos(23,9)
  48.     mon.write("Crystl Chest")
  49.     mon.setCursorPos(42,9)
  50.     mon.setBackgroundColor(colors.red)
  51.     mon.write("Sword of Zypher")
  52.     mon.setBackgroundColor(colors.black)
  53.     mon.setCursorPos(60,9)
  54.     mon.write("Unifier")
  55.     mon.setCursorPos(4,11)
  56.     mon.setBackgroundColor(colors.orange)
  57.     mon.write("Turtles")
  58.     mon.setBackgroundColor(colors.black)
  59.     mon.setCursorPos(23,11)
  60.     mon.write("Col. CanvasBags")
  61.     mon.setCursorPos(42,11)
  62.     mon.write("Indexer")
  63.     mon.setCursorPos(60,11)
  64.     mon.setBackgroundColor(colors.red)
  65.     mon.write("Filler")
  66.     mon.setBackgroundColor(colors.black)
  67.     mon.setCursorPos(4,13)
  68.     mon.write("MFFS")
  69.     mon.setCursorPos(23,13)
  70.     mon.setBackgroundColor(colors.red)
  71.     mon.write("Power Suit")
  72.     mon.setBackgroundColor(colors.black)
  73.     mon.setCursorPos(42,13)
  74.     mon.setBackgroundColor(colors.orange)
  75.     mon.write("Mining Turtle")
  76.     mon.setBackgroundColor(colors.black)
  77.     mon.setCursorPos(60,13)
  78.     mon.write("Modem")
  79.     mon.setCursorPos(4,15)
  80.     mon.write("Terraformer")
  81.     mon.setCursorPos(23,15)
  82.     mon.setBackgroundColor(colors.red)
  83.     mon.write("Minium Stone")
  84.     mon.setBackgroundColor(colors.black)
  85.     mon.setCursorPos(42,15)
  86.     mon.write("Letter")
  87.     mon.setCursorPos(60,15)
  88.     mon.write("Quantum Chest")
  89.     mon.setCursorPos(4,17)
  90.     mon.write("Anti Builder")
  91.     mon.setCursorPos(23,17)
  92.     mon.write("Item Tesseract")
  93.     mon.setCursorPos(42,17)
  94.     mon.write("Vajra")
  95.     mon.setCursorPos(60,17)
  96.     mon.setBackgroundColor(colors.red)
  97.     mon.write("Builder")
  98.     mon.setBackgroundColor(colors.black)
  99.     mon.setCursorPos(4,19)
  100.     mon.write("Crumble Horn")
  101.     mon.setCursorPos(23,19)
  102.     mon.write("Rainmaker")
  103.     mon.setCursorPos(42,19)
  104.     mon.write("Portable Hole")
  105.     mon.setCursorPos(60,19)
  106.     mon.write("XY Craft")
  107.    
  108.     for l = 3, w-3 do
  109.       for i = 1, 9 do
  110.       j = 2 * i - 1
  111.       mon.setTextColor(frColor)
  112.       mon.setCursorPos(l,3 + j)
  113.       mon.write("-")
  114.       end
  115.     end
  116.    
  117.     for l = 4, h-6  do
  118.       mon.setCursorPos(3,l)
  119.       if l%2 == 0 then
  120.         mon.write("+")
  121.       else
  122.         mon.write("|")
  123.       end
  124.       mon.setCursorPos(w-3,l)
  125.       if l%2 == 0 then
  126.         mon.write("+")
  127.       else
  128.         mon.write("|")
  129.       end
  130.      
  131.       mon.setCursorPos((w/4)+2,l)
  132.       if l%2 == 0 then
  133.         mon.write("+")
  134.       else
  135.         mon.write("|")
  136.       end
  137.      
  138.       mon.setCursorPos(2*(w/4),l)
  139.       if l%2 == 0 then
  140.         mon.write("+")
  141.       else
  142.         mon.write("|")
  143.       end
  144.      
  145.       mon.setCursorPos(3*(w/4)-2,l)
  146.       if l%2 == 0 then
  147.         mon.write("+")
  148.       else
  149.         mon.write("|")
  150.       end
  151.     end
  152.    
  153.     mon.setCursorPos(4,22)
  154.     mon.setBackgroundColor(colors.orange)
  155.     mon.setTextColor(colors.orange)
  156.     mon.write("hi")
  157.     mon.setCursorPos(4,23)
  158.     mon.setBackgroundColor(colors.red)
  159.     mon.setTextColor(colors.red)
  160.     mon.write("hi")
  161.     mon.setCursorPos(4,24)
  162.     mon.setBackgroundColor(colors.purple)
  163.     mon.setTextColor(colors.purple)
  164.     mon.write("hi")
  165.    
  166.    
  167.     mon.setBackgroundColor(colors.black)
  168.     mon.setTextColor(colors.white)
  169.     mon.setCursorPos(8,22)
  170.     mon.write("Spieler                                   ")
  171.     mon.setCursorPos(8,23)
  172.     mon.write("Einwohner  3600 Spielminuten               Eure Spielzeit koennt ihr mit")
  173.     mon.setCursorPos(8,24)
  174.     mon.write("Aeltester 30000 Spielminuten               /ranker stats abrufen")
  175.    
  176.   end
  177.  
  178.  
  179.   local function printCenter(mon, t)
  180.     local w, h = mon.getSize()
  181.     local y = 1
  182.     for i, line in ipairs(t) do
  183.           local x = math.floor((w / 2) - (#line / 2))
  184.           mon.setCursorPos(x, y + i)
  185.           mon.write(line)
  186.     end
  187.   end
  188.  
  189.   local function print(mon, t, u)
  190.     local z = 5
  191.     for j, line in ipairs(t) do
  192.       mon.setCursorPos(u, z + j)
  193.       mon.write(line)
  194.     end
  195.   end
  196.  
  197.  
  198.   local mon = peripheral.wrap(sSide)
  199.   mon.setBackgroundColor(bgColor)
  200.  
  201.   mon.clear()
  202.  
  203.   mon.setTextScale(nTextSize)
  204.   mon.setTextColor(cTextColor)
  205.   printCenter(mon, xText)
  206.   print(mon, tText, 1)
  207.   frame(mon)
  208. end
  209.  
  210. function listener()
  211.    while true do
  212.       if rs.getInput("right") then
  213.         os.reboot()
  214.       end
  215.       sleep(5)
  216.    end
  217. end
  218.  
  219. parallel.waitForAll( listener, main )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement