Advertisement
Guest User

arg

a guest
Aug 18th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.54 KB | None | 0 0
  1. local arg = {...}
  2.  
  3. local function load(api_list)
  4.   local i = 1
  5.  
  6.   while api_list[i] do
  7.     if not os.loadAPI(api_list[i]) then
  8.       print(api_list[i].." could not be loaded.")
  9.       return false
  10.     end
  11.     print(api_list[i].." has been loaded.")
  12.     i=i+1
  13.   end
  14.   return true
  15. end
  16.  
  17. local function unload(api_list)
  18.   local i = 1
  19.  
  20.   while api_list[i] do
  21.     os.unloadAPI(api_list[i])
  22.     i=i+1
  23.   end
  24. end
  25.  
  26. local function main(ac, av)
  27.  
  28. end
  29.  
  30. local api_list = {}
  31.  
  32. if load(api_list) then
  33.   main(#arg, arg)
  34. end
  35. unload(api_list)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement