This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
tball146's profile picture

detect if an api is running?

Started by tball146, 21 March 2016 - 09:09 PM
tball146 #1
Posted 21 March 2016 - 10:09 PM
the title says it all
Bomb Bloke #2
Posted 21 March 2016 - 10:19 PM
Not really. What do you mean by "is running"? Are you wondering if an API has been loaded and is ready to use, or do you specifically want to be able to tell if an API's functions are actively being used somewhere?
tball146 #3
Posted 22 March 2016 - 12:47 AM
yes if its loaded
KingofGamesYami #4
Posted 22 March 2016 - 01:02 AM

if (api_name) then
Dragon53535 #5
Posted 22 March 2016 - 02:29 AM

if peripheral then
  --#Peripheral api is loaded
end
if rednet then
  --#Rednet api is loaded
end
Lupus590 #6
Posted 22 March 2016 - 10:16 AM
(not what was asked but related)

if you want to load an API if it's not loaded then you'd do this

if not API_NAME then
  os.load(API_NAME)
end

there is a smarter one of these here: http://www.computercraft.info/forums2/index.php?/topic/24253-monitor-touchscreen-woes/page__p__228877#entry228877