Advertisement
gpgautier

xtreamtech - banned items

Dec 22nd, 2012
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.72 KB | None | 0 0
  1. local title = "XtreamTech Banned Items"
  2.  
  3. local banned = {
  4.   "Blackhole Band, Ring of Ignition, Zero Ring"
  5.   , ""
  6.   , "Gem Armor, Alchemical Tome, Blaze rod, Nova Catalyst"
  7.   , ""
  8.   , "RM Furnace, Block Breaker, Howler Alarm, Musket"
  9.   , ""
  10.   , "Red Morningstar, Red Katar, Mining Laser, Blunderbuss"
  11.   , ""
  12.   , "Nuke, Tnt, HyperKinetic Lens, other Explosives"
  13.   , ""
  14.   , "World Anchor, Dimensional Anchor, Teleport Tether"
  15.   , ""
  16.   , "Red Matter Hammer, Dark Matter Hammer, Warhammers"
  17.   , ""
  18.   , "Cannons, Industrial Alarm, Archangel's Smite"
  19.   , ""
  20.   , "Force Fields, Destruction Catalyst, Catalytic Lens"
  21.   , ""
  22.   , "Watch of flowing time"
  23. }
  24.  
  25. function main()
  26.   term.clear()
  27.  
  28.   local monitor, _, side, width, height, i, padding, line, firstLine
  29.  
  30.   firstLine = 2
  31.  
  32.   for _, side in pairs(rs.getSides()) do
  33.     if peripheral.isPresent(side) then
  34.       if peripheral.getType(side) == "monitor" then
  35.         monitor = peripheral.wrap(side)
  36.       end
  37.     end
  38.   end
  39.  
  40.   if monitor == nil then
  41.     print("Please attach a monitor to any side")
  42.     return
  43.   end
  44.  
  45.   width, height = monitor.getSize()
  46.  
  47.   monitor.clear()
  48.   monitor.setCursorPos(1, firstLine)
  49.  
  50.   for i = 1, width do
  51.     monitor.write("=")
  52.   end
  53.  
  54.   padding = (width / 2) - (#title / 2)
  55.  
  56.   monitor.setCursorPos(1, firstLine + 2)  
  57.   for i = 1, padding do
  58.     monitor.write(" ")
  59.   end
  60.  
  61.   monitor.write(title)
  62.  
  63.   monitor.setCursorPos(1, firstLine + 4)
  64.   for i = 1, width do
  65.     monitor.write("=")
  66.   end
  67.  
  68.   for _, line in pairs(banned) do
  69.     monitor.setCursorPos(1, firstLine + 6 + _)
  70.    
  71.     padding = (width / 2) - (#line / 2)
  72.  
  73.     for i = 1, padding do
  74.       monitor.write(" ")
  75.     end    
  76.  
  77.     monitor.write(line)
  78.   end
  79. end
  80.  
  81. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement