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.
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.