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

Question on writing your own apis

Started by tacomental, 11 January 2013 - 12:44 PM
tacomental #1
Posted 11 January 2013 - 01:44 PM
I poked around on the wiki and read a bunch of threads here in this api section and have yet to figure this out. I'm trying to figure out how to put some global api's onto turtles.

For example I want a dig api. For now it has 2 functions. Dig.beeline(length) and dig.branch(length). one digs a 1x1 line the other is a 3x1 branch. Very simple for now.

Then i save it to apis/turtle because its a digging program. However when I open the lua interpreter and try to call it as Dig.branch(5) i get the error "attempted to index ? ( a nil value )". How would I make the api automatically loaded and available?

Thanks,
Taco

*edit*
I figured it out please delete.
Edited on 11 January 2013 - 12:46 PM
theoriginalbit #2
Posted 11 January 2013 - 01:56 PM
place it in to the /rom/apis directory ( has to be done in your OS file system )

also wrong place to post this… this is for coded API's and utilities… the proper section to post is "Ask a Pro"… I have requested this to be moved…
Lyqyd #3
Posted 11 January 2013 - 02:07 PM
Moved to Ask a Pro.

No need to post that you've reported it. Just report it.
theoriginalbit #4
Posted 11 January 2013 - 02:28 PM
No need to post that you've reported it. Just report it.
I figured saves other people reporting too… but ok noted…