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

[Error] bios:338: [string "trunk"]:36: '=' expected (Mining Turtle)

Started by Skud, 17 November 2012 - 08:01 AM
Skud #1
Posted 17 November 2012 - 09:01 AM
Greetings all!

I get the following error while trying to run my "trunk" program;
bios:338: [string "trunk"]:36: '=' expected

The program is meant to dig a 3x3 x 100 tunnel for my branch mine. I have it stored in the \rom\programs\turtle folder. The code as follows;


length = 100
lengthCount = 0
function digRow()
turtle.up()
turtle.dig()
turtle.forward()
turtle.digUp()
turtle.digDown()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.digUp()
turtle.digDown()
turtle.dig()
turtle.forward()
turtle.digUp()
turtle.digDown()
turtle.turnLeft()
turtle.dig()
turtle.forward()
lengthCount = lengthCount + 2
turtle.digUp()
turtle.digDown()
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.digUp()
turtle.digDown()
turtle.dig()
turtle.forward()
turtle.digUp()
turtle.digDown()
turtle.turnRight()
turtle.down
end
while lengthCount < length do
digRow()
end

I have search here and Google, but have not found anything to help on the error. Thank you in advance for anything you can provide. Note, I can't figure out how to indent my code code on here, my apologies.
Orwell #2
Posted 17 November 2012 - 09:11 AM
You're missing brackets on line 36, that's why it says: 36 '=' expected. It thinks it's a variable, so it wants to assign it to something.
On line 36, change:

turtle.down
to:

turtle.down()
Skud #3
Posted 17 November 2012 - 09:33 AM
Can't believe it was so simple. Thank you, Orwell!