Posted 26 December 2012 - 10:55 AM
Hallo there
I'm having problems with making a "gravel proof" custom tunneling program.
With this program i try to get a turtle to dig a 3x3 turtle like this:
XXX
XTX
XXX
T is turtle's position
X is a block
O is a empty grid
turtle turns left and brakes the block and moves forward just fine. Also detects gravel that falls down and clears it
XXX
TOX
XXX
tunnel then brakes block above it and moves up
TXX
OOX
XXX
turtle then makes a 180 degrees turn with 2 turn left comands
turtle brakes the block above it's starting postion
TOX
OOX
XXX
here starts the problem
the turtle brakes the block above it's starting position but does not move there!
T !X
OOX
XXX
(! being the block the turtle does not move to)
I've been doing some tests myself, and when this 3x3 grid is empty, the turtle completes the circle just fine
Here's the code i suspect the turtle has been geting stuck on (starting from the point it moves to the uper left square)
if turtle.up() == false then
repeat
turtle.digUp()
sleep(0,25)
until turtle.up() == true
end (turtle completes this step just fine)
turtle.turnLeft()
turtle.turnLeft() (turtle made a 180 degrees turn)
if turtle.forward() == false then
repeat
turtle.dig()
sleep(0,25)
until turtle.forward() == true
end this is the part the turtle gets stuck)
turtle doesn't move forward as it should, it does brake any block i place in front of it. As stated before, the turtle moves forward if there is no block there in the first place.
I hope you fokes can help me out with this issue
thanks already, and a merry christmas!
Enterprise0709
Edit: Excuse me, that turtle.up was a typo on my part it should be .forward… as it is in the actual program, and does not execute
I'm having problems with making a "gravel proof" custom tunneling program.
With this program i try to get a turtle to dig a 3x3 turtle like this:
XXX
XTX
XXX
T is turtle's position
X is a block
O is a empty grid
turtle turns left and brakes the block and moves forward just fine. Also detects gravel that falls down and clears it
XXX
TOX
XXX
tunnel then brakes block above it and moves up
TXX
OOX
XXX
turtle then makes a 180 degrees turn with 2 turn left comands
turtle brakes the block above it's starting postion
TOX
OOX
XXX
here starts the problem
the turtle brakes the block above it's starting position but does not move there!
T !X
OOX
XXX
(! being the block the turtle does not move to)
I've been doing some tests myself, and when this 3x3 grid is empty, the turtle completes the circle just fine
Here's the code i suspect the turtle has been geting stuck on (starting from the point it moves to the uper left square)
if turtle.up() == false then
repeat
turtle.digUp()
sleep(0,25)
until turtle.up() == true
end (turtle completes this step just fine)
turtle.turnLeft()
turtle.turnLeft() (turtle made a 180 degrees turn)
if turtle.forward() == false then
repeat
turtle.dig()
sleep(0,25)
until turtle.forward() == true
end this is the part the turtle gets stuck)
turtle doesn't move forward as it should, it does brake any block i place in front of it. As stated before, the turtle moves forward if there is no block there in the first place.
I hope you fokes can help me out with this issue
thanks already, and a merry christmas!
Enterprise0709
Edit: Excuse me, that turtle.up was a typo on my part it should be .forward… as it is in the actual program, and does not execute