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

Harvest obsidian pillars in the end

Started by jhultgre, 11 August 2012 - 05:50 AM
jhultgre #1
Posted 11 August 2012 - 07:50 AM
I haven't really used computer craft before but I thought this would be a good way to learn it.

The turtle treats the pillars as if they were square instead of round because it was easier to use a recursive function rather than dealing with lots of turns.

place the turtle like this facing the pillar and put fuel in slot 16. You also want everything above the turtle to be air.

o is empty space
x is obsidian
T is the turtle


ooxxxoo
oxxxxxo
xxxxxxx
xxxxxxx
xxxxxxx
oxxxxxo
ooxxxoo
T


function moveForward()
  if turtle.getFuelLevel() <=0 then
	turtle.select(16)
	turtle.refuel()
  end
  turtle.forward()
end
function digForward(x)
  for i=1,x do
	turtle.dig()
	moveForward()
  end
end
function digArea(x)
  if x<=1 then
	turtle.dig()
  else
	digForward(x)
	turtle.turnRight()
	digForward(x-1)
	turtle.turnRight()
	digForward(x-1)
	turtle.turnRight()
	digForward(x-2)
	turtle.turnRight()
  
	digArea(x-2)
  
	turtle.turnLeft()
	moveForward()
	turtle.turnLeft()
	moveForward()
	turtle.turnRight()
	turtle.turnRight()
  end
end
--get area to dig--
term.clear()
term.setCursorPos(1,7)
write("Enter diamater to dig - ")
local d = tonumber(io.read())
term.clear()
term.setCursorPos(1,7)
write("Enter Height to dig - ")
local h = tonumber(io.read())
for j=1,h do
  digArea(d)
  if turtle.getFuelLevel() <=0 then
	turtle.select(16)
	turtle.refuel()
  end
  turtle.up()
end
for j=1,h do
  if turtle.getFuelLevel() <=0 then
	turtle.select(16)
	turtle.refuel()
  end
  turtle.down()
end
slango20 #2
Posted 09 October 2012 - 02:33 PM
Gah, a RP2 frame quarry would do this faster, what if an ENDERMAN gets in the way?
Klausar #3
Posted 09 October 2012 - 03:00 PM
Gah, a RP2 frame quarry would do this faster, what if an ENDERMAN gets in the way?
This is a CC Forum, not everyone uses RP2
PixelToast #4
Posted 09 October 2012 - 03:09 PM
Gah, a RP2 frame quarry would do this faster, what if an ENDERMAN gets in the way?
or even worse: an ender DRAGON

i haven't needed to harvest obsidian in the end because i have a huge pool of lava under my house