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

looking for a excavate with a depth option

Started by phephe, 02 September 2016 - 06:36 AM
phephe #1
Posted 02 September 2016 - 08:36 AM
i was wonder if there any one here that knows of a simple command or program where you have to type

area 10 -10

and it will dig a area that's 10x10x-10

so 10 forward 10 right then 10 down or up depending on the depth number being negative or positive

i don't know how to code and all the programs i have found dont work the way i need them to or on return dosnt deposit the items
CCJJSax #2
Posted 02 September 2016 - 07:33 PM
I don't know of a program like that off the top of my head, but to make a very basic one is rather simple. it's about a series of for loops. where the distance per loopdeloop gets smaller as the turtle gets to the center, then having it go back to it's original position, then go down. and keep repeating that until the depth is fulfilled. give it a shot and if you have some trouble comment on here again what your current code is.
Lupus590 #3
Posted 02 September 2016 - 07:50 PM
it may be worth editing the existing excavate program, also have you tried googleing it?
KingofGamesYami #4
Posted 02 September 2016 - 09:30 PM
If you want to modify the existing program, copy it into a new file and edit these lines:


	end

	depth = depth + 1
	if math.fmod( depth, 10 ) == 0 then
		print( "Descended "..depth.." metres." )
	end

	return true

To look something like this:


	end

	depth = depth + 1
	if math.fmod( depth, 10 ) == 0 then
		print( "Descended "..depth.." metres." )
	end

	return depth < maxdepth