1: The
for loop is incorrect, Here's an example of how to use it
for i = <start value>, <finish value>, <increment/decrement value> do
-- Code
end
Note: The third parameter is often only needed when decrementing( See example below )
for i = 10, 1, -1 do
print( i )
end
2: You're using if/elseif wrong, See example how to use it below
if 2 == 1 then --# If 2 is equal to 1
-- Code
elseif 2 == 0 then --# If 2 is equal to 0 instead
-- Code
else --# If both of the statements above is false
-- Code
end
Also, A tip with booleans
if turtle.detect() == true then
-- Code
end
Can be this instead
if turtle.detecUp() then --# If it's true
-- Code
elseif not turtle.detectUp() then --# If it's false
-- Code
end
So with that said you should try to fix the code yourself to see if you understood what I just wrote :P/>