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

[Question] Mineshaft Digging Turtle

Started by quantumpugilist, 30 December 2012 - 03:15 PM
quantumpugilist #1
Posted 30 December 2012 - 04:15 PM
Hey everyone, first post here.

Just started working with ComputerCraft, so I decided to start relatively simple and code up a turtle to dig a 3x3 shaft straight down, placing ladders on each slice.

However, the turtle decides of its own volition to dig fine for 20 blocks, then move over two blocks and continue digging. I'm not entirely sure why, since nothing changes in my code, and it works perfectly till that point.

The turtle has sufficient fuel (so it shouldn't trigger my addFuel function), and the inventory is nearly empty (so it shouldn't trigger my dumpInventory function). I've tested it in a normal world and a custom pure stone 3x3 pillar, starting the turtle from the same height (65). Same thing occurs at the same height level in both.

I've put the code on Pastebin: http://pastebin.com/9XUQGZnw

The screenshot I've attached shows where things have gone sideways.

Any help would be greatly appreciated. Thanks!
ChunLing #2
Posted 30 December 2012 - 08:00 PM
In the screenshot, it looks like you ran out of ladders on the last layer that worked, or the ladder function stopped working. Did that happen the other two times?
remiX #3
Posted 30 December 2012 - 10:07 PM
Not sure if this is the problem but just to point out:

You're using tArgs[1] as a number but you do not convert it to a number (it's a string now)
Try use this?
for i=1, tonumber(tArgs[1]) do -- default step is 1 so you don't need the last 1