I wrote this script to fill a quarry and im getting pack an error in line 12 when i involve user input. Error: 'then' expected. Need Help!!
-
function placeBlockDownForward() -
length = 0 -
-- Length limit is 1 less than actual -- -
while length <= 104 do -
turtle.forward() -
turtle.placeDown() -
if turtle.getItemCount() == 0 and select == 16 then -
print "Not enough Dirt. Please place in more and hit enter 'y'" -
re = io.read() -
if re = "y" then -
select = 0 -
turtle.select(select) -
end -
elseif turtle.getItemCount() == 0 then -
select = select + 1 -
turtle.select(select) -
end -
length = length + 1 -
end -
end -
function placeBlockDownBack() -
length = 0 -
-- Length limit is 1 less than actual -- -
while length <= 104 do -
turtle.back() -
turtle.placeDown() -
if turtle.getItemCount() == 0 and select == 16 then -
print "Not enough Dirt. Please place in more and hit enter 'y'" -
re = io.read() -
if re = "y" then -
select = 0 -
turtle.select(select) -
end -
elseif turtle.getItemCount() == 0 then -
select = select + 1 -
turtle.select(select) -
end -
length = length + 1 -
end -
end -
function fullCycleReverse() -
placeBlockDownBack() -
turtle.up() -
placeBlockDownForward() -
turtle.up() -
end -
function fullCycle() -
placeBlockDownForward() -
turtle.up() -
turtle.placeDown() -
placeBlockDownBack() -
turtle.up() -
turtle.placeDown() -
end -
function placeBlock() -
length = 0 -
while length <= 103 do -
turtle.back() -
turtle.place() -
if turtle.getItemCount() == 0 then -
select = select + 1 -
turtle.select(select) -
end -
length = length + 1 -
end -
end -
function turtleGoDown() -
depth = 0 -
while depth <= 59 do -
turtle.down() -
depth = depth + 1 -
end -
end -
select = 1 -
turtle.select(select) -
turtle.forward() -
turtleGoDown() -
turtle.turnRight() -
turtle.turnRight() -
placeBlock() -
turtle.back() -
turtle.place() -
turtle.up() -
turtle.up() -
function fullCycleTwentySeven() -
fullCycle() -
fullCycle() -
fullCycle() -
fullCycle() -
fullCycle() -
fullCycle() -
fullCycle() -
fullCycle() -
fullCycle() -
fullCycle() -
fullCycle() -
fullCycle() -
fullCycle() -
fullCycle() -
fullCycle() -
fullCycle() -
fullCycle() -
fullCycle() -
fullCycle() -
fullCycle() -
fullCycle() -
fullCycle() -
fullCycle() -
fullCycle() -
fullCycle() -
fullCycle() -
end -
fullCycleTwentySeven()











