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

bios:206: [string "forward"]:22: '=' expected

Started by Cortcase, 14 June 2012 - 11:12 PM
Cortcase #1
Posted 15 June 2012 - 01:12 AM
So you know, I am brand new to CC as well as to programming. My first project is a branch mining program. However, this question only concerns the first function i'm writing. Running the program returns the error in my title.
program title: "forward"

function forward2()
if turtle.forward() ==false then
repeat
turtle.dig()
sleep(0.25)
until turtle.forward() == true
end
if turtle.up() == false then
repeat
turtle.digUp()
sleep(0.25)
until turtle.up() == true
end
if turtle.forward() ==false then
repeat
turtle.dig()
sleep(0.25)
until turtle.forward() == true
end
turtle.digDown()
turtle.down()
end
forward2()

I'm sorry it isn't formatted correctly. I typed it out with spaces but they were removed and I don't know how to make it work properly. I can tell you that the program works properly until I try to make it a function and run it as one.
Also, as I am new, any tips not related to this particular error would be appreciated.
MysticT #2
Posted 15 June 2012 - 01:19 AM
You forgot the brackets () here:

turtle.down
it should be:

turtle.down()
Cortcase #3
Posted 15 June 2012 - 01:23 AM
Thank you. Error resolved.