os.loadAPI

From ComputerCraft
Jump to: navigation, search

os.loadAPI
Function
Syntax
os.loadAPI()
Returns boolean
API os
Source CC:Tweaked
This function is deprecated. Use of this function will pollute the global table, use require instead.

Globally loads a user created program as a table of functions, using the name of the file as the reference to put the table under.

ExampleExampleLoading a user created API
Loads an API from a file called myAPI.lua in the base directory. All functions in the 'myAPI.lua' API will be accessible through the use of myAPI.<function name>
Code
isLoaded = os.loadAPI("/myAPI.lua")
if isLoaded then
  print("myAPI is ready to use!")
end
Output
myAPI is ready to use!