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

Homemade Excavate Error Seems To Be Disagreeing With Robust Turtle Api

Started by Sivarias, 14 October 2013 - 04:56 PM
Sivarias #1
Posted 14 October 2013 - 06:56 PM
Hey guys,

I make us of Robust Turtle API to greatly shorten code but it seems to be backfiring.
For those unfamiliar with it it can be found here.
http://computercraft...bust_Turtle_API

When I run the code
http://pastebin.com/2FrUyGQ5

I get an error at 42 saying attempt to call nil
edit:
when I comment out that portion of code it gives me another error at line 59 which is just a t.forward()

From what I can see the only thing there is t.up()
I've attempt to change the variable inputs for dir to Left and Right rather than L and R because I noticed that the Robust API has a variable L, however this isn't the case.

I can also confirm that the API works when not used by the !excavate program from running a simple test program

t.forward()

edit:
My other area cleaner code does a 3xchunk and it seems to be working just fine running the robust turtle api.

After pouring over this, I can't help but be frustrated. Any help from the pro's out there?
Bomb Bloke #2
Posted 14 October 2013 - 09:19 PM
I'm guessing you wanted to load that API against "t", but really that variable's storing an integer by the time you try to use it to move your turtle around (by storing user input and other stuff in it, it's no longer an API). You'll need to rename one or the other to prevent conflict.

I believe you'll also have to make use of os.loadAPI() (speaking as one who hasn't used APIs, but such code as I've seen implies this to be the case). I assume you've got an understanding of that if it's working in your other script.
Sivarias #3
Posted 15 October 2013 - 03:31 PM
Thank you very much!

I'll check that out. And I'm not to familiar with load.API since I juct copied and pasted the api into the zip file. but that definately explains it. I wasn't aware you could overwrite API path names as a variable.