This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
anidude98's profile picture

[1.3][SSP] Turtles can move while a player is outside the current chunk, but mining and placing are not.

Started by anidude98, 09 March 2012 - 08:37 PM
anidude98 #1
Posted 09 March 2012 - 09:37 PM
I have a simple program for my mining turtle, that asks for the distance it should mine, and the number of branches. then it mines out the distance while placing torches every 10 blocks. After that it comes back to the main mine-hole-thing, goes to the next branch, and repeats the process…

I have more than once had turtles lost after sending them 100+ blocks.
They were gone, the mines were unfinished, and on further mining, I found one inside the smoothstone… So It seems while the turtles are moved themselves… The blocks they mine and place are not registered while a player is out of the current chunk.

Here's the code for my strip mine…

NO COMMENTS WERE IN THE CODE


--function to go to the next branch
function nbr()
if lr=="l" then
turtle.turnLeft()
elseif lr=="r" then
turtle.turnRight()
end
turtle.dig()
turtle.forward()
turtle.digUp()
turtle.dig()
turtle.forward()
turtle.digUp()
turtle.dig()
turtle.forward()
turtle.digUp()
if lr=="l" then
turtle.turnRight()
elseif lr=="r" then
turtle.turnLeft()
end
end
--ask user for distance, number of branches, and the direction the branches go in
write("distance:")
dis=io.read()
write("branches:")
bra=io.read()
repeat
print("direction? l or r")
lr=io.read()
until lr=="l" or lr=="r"
--for however many branches were specified
for x=1,bra do
torch=0

--for whatever distance given
for x=1,dis do


--while there isnt gravel falling in front of you
while turtle.detect() do
turtle.dig()
--wait for gravel
sleep(1)
end
turtle.forward()
turtle.digUp()

--if you've gone far enough place a torch on top
if torch==10 then
turtle.placeUp()
torch=0
end
torch=torch+1
end
--for distance give go back
for y=1,dis do
turtle.back()
end
-- go to the next branch
nbr()
end
Leo Verto #2
Posted 09 March 2012 - 10:27 PM
Yes, turtles are entities so they can move further than the world is generated, same as you can fly over the world heigh limit.

I really like your program, quite nice to get tons of minerals very fast, but 1 second break to wait for gravel? Isn't that a bit too long?
anidude98 #3
Posted 09 March 2012 - 10:46 PM
I really like your program, quite nice to get tons of minerals very fast, but 1 second break to wait for gravel? Isn't that a bit too long?
It probably is, but I was having problems with gravel, probably something with me leaving the chunk when the turtle went through gravel and coming back when it was inside the gravel… So i would have turtles making branches in the middle of the mine where it shouldnt be… I can try to record a video of the progress of this mine over two RL days..
Cloudy #4
Posted 10 March 2012 - 06:54 PM
Yes, turtles are entities so they can move further than the world is generated, same as you can fly over the world heigh limit.

I really like your program, quite nice to get tons of minerals very fast, but 1 second break to wait for gravel? Isn't that a bit too long?

Actually - turtles are tile entities - they are still bound by the rules of being in a block.