Posted 13 September 2012 - 11:35 PM
My auto builder script isn't working and I was hoping I could get some help. When I try to run the program it throws an error for line 6, "then expected". I don't see what's wrong, but I am a beginner at this. Any help would be appreciated!
local haveblocks = 0
local block = 0
Check = function()
block = turtle.detect()
if block = true then
turtle.turnLeft()
block = turtle.detect()
if block = true then
turtle.turnLeft()
turtle.turnLeft()
block = turtle.detect()
if block = true then
block = turtle.detectUp()
if block = true then
break
else
turtle.up()
turtle.placeDown()
turtle.turnLeft()
turtle.forward()
Check()
end
end
end
end
end
while true do
for i = 1,16 do
haveblocks = turtle.getItemCount(i)
if haveblocks = 0 then
turtle.select(i+1)
end
end
Check()
turtle.forward()
turtle.turnLeft()
turtle.turnLeft()
turtle.place()
turtle.turnLeft()
turtle.turnLeft()
end