Jump to content




Odd behaviors with turtle quarry


  • You cannot reply to this topic
4 replies to this topic

#1 grand_mind1

  • Members
  • 207 posts

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

#2 faubiguy

  • Members
  • 213 posts

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)

#3 grand_mind1

  • Members
  • 207 posts

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?

#4 faubiguy

  • Members
  • 213 posts

Posted 26 March 2013 - 01:00 PM

Yes, from what I can see, it would probably work to use a call to up there.

#5 grand_mind1

  • Members
  • 207 posts

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





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users