151 posts
Location
Earth
Posted 30 March 2017 - 09:00 PM
Does LUA already have a function for checking if a program is using an certain API?
I want to make an updater program and API that people can add to there programs to let people use my program and when you go to run the program it'd be like 'update PROGRAM'. I know how to do the rest.
3057 posts
Location
United States of America
Posted 30 March 2017 - 11:25 PM
Well, if the API is loaded via os.loadAPI there's a good chance that it's being used by a program. However, your API will not be able to know which program is loading it, as os.loadAPI does not provide a shell instance to the API being loaded.
8543 posts
Posted 31 March 2017 - 01:01 AM
I think we may be able to provide better help if you can more clearly define what qualifies as a program "using" an API. Honestly, it may just be best to lay out in much greater detail how you envision this update system working and how each piece of it interacts.
797 posts
Posted 31 March 2017 - 07:09 PM
You could always make an update() function in the API and then the developer would call updateAPI.update(someID) at the beginning of their code (I'm assuming you'd want a way of identifying the program, hence the someID param). I think this is what you want?