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

Odd behaviors with turtle quarry

Started by grand_mind1, 26 March 2013 - 10:40 AM
grand_mind1 #1
Posted 26 March 2013 - 11:40 AM
So I have made a turtle quarry program and now I'm trying to iron out some of the bugs.

Code:
http://pastebin.com/t5SzZcEJ

The biggest bug I am having right now is when the turtle is coming back up while running the columna() function it sometimes will fall a little short on how far up it is supposed to go. In my tests, it is usually somewhere between 4 and 8 blocks. At first I thought it was happening when the turtle was running the inv() function and then not coming out of it but after I thought about it, I couldn't figure out anyway that could happen. It also isn't a very consistent bug. Sometimes it happens and sometimes it doesn't, and I can't see any consistent pattern. Anyways, I was hoping some fresh sets of eyes could help me figure out why this bug is happening.
Help is appreciated!
Thanks! :D/>
faubiguy #2
Posted 26 March 2013 - 12:06 PM
If there's gravel over it when its rising, the gravel will fall into where the turtle.just dug a space, so the turtle won't go up. I'd suggest doing something like this:
function columna(depth)
  -- side digging stuff
  turtle.digUp()
  while not turtle.up() do
	sleep(0.5)
	if turtle.detectUp() then -- Block above
	  turtle.digUp()
	else -- Mob above probably
	  turtle.attackUp()
	end
  end
end

(Not tested)
grand_mind1 #3
Posted 26 March 2013 - 12:57 PM
Oh, I see. Well I think my up() function does something similar to that so could I use that or would it not work?
faubiguy #4
Posted 26 March 2013 - 01:00 PM
Yes, from what I can see, it would probably work to use a call to up there.
grand_mind1 #5
Posted 26 March 2013 - 01:01 PM
Ok, that makes a lot of sense. I don't know why I didn't see that before. Like I side, fresh set of eyes. Well, thanks for your help! :D/>