Advertisement
Twigister

ForAbby/Twig API file

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