Update canemine
This commit is contained in:
parent
2af22cdd07
commit
c7110f161c
@ -56,6 +56,14 @@ function digTo(x, z)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- If the block in front of the turtle is desired, take it.
|
||||||
|
function grabOres()
|
||||||
|
local target = turtle.inspect()
|
||||||
|
if target and target["name"]:lower():find("ore") then
|
||||||
|
turtle.dig()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- dig all the way down to bedrock, collect ores
|
-- dig all the way down to bedrock, collect ores
|
||||||
-- Parameters:
|
-- Parameters:
|
||||||
-- * moveAction: the **vertical** move action, eg turtle.down
|
-- * moveAction: the **vertical** move action, eg turtle.down
|
||||||
@ -87,8 +95,7 @@ function digDeep(moveAction, digAction, inspectAction, limit)
|
|||||||
limit = limit - 1
|
limit = limit - 1
|
||||||
digAction()
|
digAction()
|
||||||
moveAction()
|
moveAction()
|
||||||
-- TODO
|
grabOres() -- inspect block in front of turtle, take if neccessary
|
||||||
-- grabOres() -- inspect block in front of turtle, take if neccessary
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -104,14 +111,14 @@ end
|
|||||||
|
|
||||||
function digShaft()
|
function digShaft()
|
||||||
print("Starting to dig shaft")
|
print("Starting to dig shaft")
|
||||||
depth = digDeep(turtle.down, turtle.digDown, turtle.inspectDown, 3)
|
depth = digDeep(turtle.down, turtle.digDown, turtle.inspectDown, -1)
|
||||||
print("Dug the first shaft (depth = "..tostring(depth)..")")
|
print("Dug the first shaft (depth = "..tostring(depth)..")")
|
||||||
turtle.turnLeft()
|
turtle.turnLeft()
|
||||||
digDeep(turtle.up, noop, noop, depth - 1)
|
digDeep(turtle.up, noop, noop, depth)
|
||||||
turtle.turnLeft()
|
turtle.turnLeft()
|
||||||
digDeep(turtle.down, noop, noop, depth - 1)
|
digDeep(turtle.down, noop, noop, depth)
|
||||||
turtle.turnLeft()
|
turtle.turnLeft()
|
||||||
digDeep(turtle.up, noop, noop, depth - 1)
|
digDeep(turtle.up, noop, noop, depth)
|
||||||
turtle.turnLeft()
|
turtle.turnLeft()
|
||||||
selectCobble()
|
selectCobble()
|
||||||
turtle.placeDown()
|
turtle.placeDown()
|
||||||
|
Loading…
Reference in New Issue
Block a user