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

API help

Started by Galactica4, 14 July 2013 - 12:33 AM
Galactica4 #1
Posted 14 July 2013 - 02:33 AM
Hello, ANOTHER QUESTION (what can I say, I like learning (some things o_o))
I have scoured the tutorials section for an API tutorial but only found one (I thought there would be more?)
And even that was basically useless :(/>/>
I need an comprehensive tutorial from start to finish. Think that I am an massive NOOB and don't get anything needing help. ;)/>/> :D/>/>
thanks!
Galactica4
Cutecurtain #2
Posted 14 July 2013 - 04:02 AM
I recomend NDFjay's Video:
http://www.youtube.com/watch?v=pRXeVQCf9Iw

He explains it very well ;)/>
Apfeldstrudel #3
Posted 14 July 2013 - 07:02 AM
Basically it's a bunch of functions saved in a normal file loaded using os.loadApi("path")

the functions are called using apiname.functionname(parameters)
Galactica4 #4
Posted 15 July 2013 - 01:27 AM
So I can add the load API thing in a startup file and viola?
albrat #5
Posted 15 July 2013 - 05:32 AM
yes, you could load a bunch of api's from within a startup file and then execute your program.

eg.

os.loadAPI("api1")
os.loadAPI("api2")

shell.run("program, arg1, arg2, arg3")

a perfect example is that I call my server files by using a startup file with

shell.run("monitor top server01") – this runs the monitor program (built in to CC) on the top monitor but executes my servers program on the monitor. (which pretends to be a calendar and time program but is secretly a password server, that grants access to different parts of my base.)