Advertisement
Savage_Me55iah

loadAPIs

Jul 19th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.38 KB | None | 0 0
  1. --Script by Savage_Me55iah of CraftAU.com.au--
  2.  
  3. --Other Savage_Me55iah scripts @ http://pastebin.com/u/Savage_Me55iah
  4.  
  5. --INSTRUCTIONS ON USE--
  6. --Instruction video on http://youtube.com/savagemessiah5
  7.  
  8. --Contact Savage_Me55iah @ CraftAU.com.au or http://www.computercraft.info/forums2/ with suggestions/fixes/bugs
  9.  
  10. local scriptName = "loadAPIs"
  11. fileDetail = fileDetail or {}
  12. fileDetail[scriptName] = {["version"] = 0.1, ["pastebin"] = "0FMzFMsP"}
  13.  
  14. local tArgs = {...}
  15. if tArgs[1] == "update" then
  16.     print("UPDATING") shell.run("pastebin get "..fileDetail[scriptName].pastebin.." "..scriptName.."_update")
  17.     if fs.exists(scriptName.."_update") then fs.remove(shell.getRunningProgram()) fs.copy(scriptName.."_update", shell.getRunningProgram()) fs.remove(scriptName.."_update") print("UPDATE SUCCESS") else print("UPDATE FAILED") end
  18. end
  19.  
  20. -----------------------------------------------------------------------------------------------------------
  21. -- Srcipt --
  22. -----------------------------------------------------------------------------------------------------------
  23.  
  24. local apiLoc = "sm_API/"
  25. local requiredApis = {"logger", "generalinfo", "booleanmanip", "tablemanip", "eventmanip", "coroutinemanip", "buttonmanip"}
  26. for a,b in pairs(requiredApis) do
  27.     local result = os.loadAPI(apiLoc..b)
  28.     if not result then error("Fatal Error:- Missing "..b.." API") end
  29. end
  30.  
  31. logger.logSetup("0")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement