From ComputerCraft Wiki
|Loads a user created API from a file located at path.
This function runs the file, collects all global (non-localized) variables from it and puts them into a table into the global (_G) environment. The name of the table in the _G table becomes the name of the file.
|Returns||boolean did the API load successfully?|
|Loads an API saved at "test/myAPI" and runs the global function "hello" from it.|
--test/myAPI: local text = "Hello World!" -- this won't be seen from outside of the API because it is localized function hello () -- this will be seen from outside the API because it is not localized print(text) end
--The program that will use "myAPI" os.loadAPI("test/myAPI") -- load the API myAPI.hello() -- runs the function "hello" from the API