Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2015
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.74 KB | None | 0 0
  1. class "LibraryCheck"
  2.  
  3.     --[[
  4.  
  5.          _      _ _                             _____ _               _    
  6.         | |    (_) |                           / ____| |             | |  
  7.         | |     _| |__  _ __ __ _ _ __ _   _  | |    | |__   ___  ___| | __
  8.         | |    | | '_ \| '__/ _` | '__| | | | | |    | '_ \ / _ \/ __| |/ /
  9.         | |____| | |_) | | | (_| | |  | |_| | | |____| | | |  __/ (__|   <
  10.         |______|_|_.__/|_|  \__,_|_|   \__, |  \_____|_| |_|\___|\___|_|\_\
  11.                                         __/ |                              
  12.                                        |___/                              
  13.  
  14.     ]]--
  15.  
  16.     function LibraryCheck:__init()
  17.  
  18.         self:Load_Vars()
  19.         self:Load_Check()
  20.  
  21.     end
  22.  
  23.  
  24.     function LibraryCheck:Load_Vars()
  25.  
  26.         self.misFiles       = { }
  27.         self.reqFiles       = {
  28.             ["SxOrbWalk.lua"]               = { name = "SxOrbWalk",             link = "https://raw.githubusercontent.com/Superx321/BoL/master/common/SxOrbWalk.lua",           init = function()                       end, req = false,   isPrediction = false    },
  29.             ["ImprovedScriptConfig.lua"]    = { name = "ImprovedScriptConfig",  link = "https://raw.githubusercontent.com/Feez/BoL/master/Common/ImprovedScriptConfig.lua",     init = function()                       end, req = true,    isPrediction = false    },
  30.             ["VPrediction.lua"]             = { name = "VPrediction",           link = "https://raw.githubusercontent.com/SidaBoL/Scripts/master/Common/VPrediction.lua",       init = function() VP = VPrediction()    end, req = true,    isPrediction = true     },
  31.             --["HPrediction.lua"]           = { name = "HPrediction",           link = "https://raw.githubusercontent.com/BolHTTF/BoL/master/HTTF/Common/HPrediction.lua",      init = function() HP = HPrediction()    end, req = true,    isPrediction = true     },
  32.             --["DivinePred.lua"]            = { name = "DivinePred",            link = "http://www.divinetek.rocks/divineprediction/Scripts/Common/DivinePred.lua",             init = function() DP = DivinePred()     end, req = true,    isPrediction = true     },
  33.             --["DivinePred.luac"]           = { name = "DivinePred",            link = "http://www.divinetek.rocks/divineprediction/Scripts/Common/DivinePred.luac",            init = function()                       end, req = false,   isPrediction = false    }
  34.         }
  35.  
  36.         self.Sprites        = {}
  37.         self.SpritesNumber  = 0
  38.         self.SpritesExist   = false
  39.         self.SpritesTable   = {
  40.             "blueleftbot",
  41.             "bluelefttop",
  42.             "bluerightbot",
  43.             "bluerighttop",
  44.  
  45.             "redleftbot",
  46.             "redlefttop",
  47.             "redrightbot",
  48.             "redrighttop",
  49.  
  50.             "greenleftbot",
  51.             "greenlefttop",
  52.             "greenrightbot",
  53.             "greenrighttop",
  54.  
  55.             "orangeleftbot",
  56.             "orangelefttop",
  57.             "orangerightbot",
  58.             "orangerighttop",
  59.  
  60.             "smiteblue",
  61.             "smitegreen",
  62.             "smiteksorange",
  63.             "smiteksred",
  64.  
  65.             "OrbwalkCheckBack",
  66.             "OrbwalkCheckFront"
  67.  
  68.         }
  69.  
  70.     end
  71.  
  72.  
  73.     function LibraryCheck:Load_Check()
  74.  
  75.         for lib, data in pairs(self.reqFiles) do           
  76.             if not FileExist(LIB_PATH .. lib) then
  77.                 table.insert(self.misFiles, "lib")
  78.                 Msg("Series", "Downloading " .. lib .. ", please don't press F9.")
  79.                 DelayAction(function() DownloadFile(data.link.."?rand="..math.random(1,10000), LIB_PATH .. lib, function() Msg("Series", "Successfully downloaded " .. lib .. ", press F9 twice.") end) end, 3)
  80.                 return
  81.             elseif data.req and #self.misFiles == 0 then
  82.                 require(lib:gsub(".lua", ""))
  83.                 data:init()
  84.             end
  85.         end
  86.  
  87.         for _, sprite in pairs(self.SpritesTable) do
  88.             location = "BetterNerfSeries\\" .. sprite .. ".png"
  89.             if FileExist(SPRITE_PATH .. location) then
  90.                 self.Sprites[sprite]    = createSprite(location)
  91.                 self.SpritesExist       = true
  92.                 self.SpritesNumber      = self.SpritesNumber + 1
  93.             end
  94.         end
  95.  
  96.         if self.SpritesNumber == #self.SpritesTable then
  97.             controlpanel = ControlPanel()
  98.         else
  99.             Msg("Series", "Missing " .. #self.SpritesTable - self.SpritesNumber .. " Sprites. Please download latest sprites.")
  100.             return
  101.         end
  102.  
  103.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement