slango20, on 30 September 2012 - 01:42 AM, said:
ok, new code, different problem
for x = 1, 9 do
print("Current Status: "..x)
end
while x < 9 do
if turtle.detectDown() == true then
turtle.placeDown()
turtle.forward()
x = x+1
end
end
if x == 9 then
turtle.turnRight()
x = 1
end
problem, prints all status at once (1-9), cant seem to get an error that I can understand, any problems?
also, anyone know where I can get eloraam's mining turtle armada code?
This bit of code here:
for x = 1, 9 do
print("Current Status: "..x)
end
Is a single loop. It goes through the ' print("Current Status: "..x)' line 9 times, with x being different each time.
So what you want is probably this:
while x < 9 do
if turtle.detectDown() ~= true then
turtle.placeDown()
turtle.forward()
x = x+1
end
print("Current Status: "..x)
end
I would also like to point out that detectDown returns true if there is a block underneath the turtle, therefore placing a block underneath wont work because there's already a block there.
Thus I have replaced == (is equal to) with ~= (is not equal to) so that the code now translates loosely as 'if turtle does not detect a block below, turtle places block'
Though I still fail to see what this program is attempting to achieve.
Perhaps if you gave a better description of your intentions you'd get better feedback, since at the moment, I don't know about other people but I'm clutching at straws trying to figure out what you are trying to do. Something about 9s and digging?