Posted 13 May 2014 - 03:29 AM
Basically I'm trying to make a "house building" turtle and for some reason on about the third or fourth level (It changes) the turtle will make a premature turn and ruin the whole structure.
here is the code:
function line()
for i = 1,5 do
reload()
turtle.placeDown()
turtle.forward()
end
end
function base()
for o = 1,4 do
line()
turtle.turnRight()
end
end
function walls()
for p = 1,4 do
base()
turtle.up()
end
end
function reload()
turtle.getItemCount(1)
if turtle.getItemCount(1) == 0 then
turtle.select(2)
else
turtle.select(1)
end
end
turtle.select(1)
turtle.up()
walls()
here is the code:
function line()
for i = 1,5 do
reload()
turtle.placeDown()
turtle.forward()
end
end
function base()
for o = 1,4 do
line()
turtle.turnRight()
end
end
function walls()
for p = 1,4 do
base()
turtle.up()
end
end
function reload()
turtle.getItemCount(1)
if turtle.getItemCount(1) == 0 then
turtle.select(2)
else
turtle.select(1)
end
end
turtle.select(1)
turtle.up()
walls()