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

Turtle Branch Coding Error

Started by S1kBruZZ, 05 January 2013 - 09:23 PM
S1kBruZZ #1
Posted 05 January 2013 - 10:23 PM
Hello anyone who is smart with this sort of stuff.
I have been trying to code a turtle for the last 30 minutes to make a nice and secure branch mine for me that I could just walk down without any lava troubles or ravine holes.
I did everything right, he plugs up the holes but he only goes 1 block, so I added a code to make him go as much blocks that I sent him to go and it comes out with the error Branch:4: attempt to call string

Here is the code, if anyone could suggest how to fix it or could fix it for me that would be much appreciated. Thank you :)/>

http://pastebin.com/Apg7Fe7m
Doyle3694 #2
Posted 05 January 2013 - 11:26 PM
did you give him arguments in the call? like from the shell, did you do "Branch 16" or did you do "Branch"?
remiX #3
Posted 05 January 2013 - 11:48 PM
did you give him arguments in the call? like from the shell, did you do "Branch 16" or did you do "Branch"?

Just tested it now and the
togo = togo or 1
will make it 1 if you don't enter an argument.

Try using a new turtle?
Doyle3694 #4
Posted 05 January 2013 - 11:51 PM
yeah but the line before is the one with the error, that's why I'm asking.
Doyle3694 #5
Posted 05 January 2013 - 11:53 PM
Also, the thing I'm starting to suspect is that you have a string somewhere in another program that has the variablename tonumber
ChunLing #6
Posted 06 January 2013 - 03:48 AM
Yeah, it's telling you that tonumber is a string rather than a function. That's not the way things is supposed to be.