Skip to content

Instantly share code, notes, and snippets.

@wolfgangmeyers
Created April 2, 2015 03:36
Show Gist options
  • Save wolfgangmeyers/9461fd7f5f3060eedeb2 to your computer and use it in GitHub Desktop.
Save wolfgangmeyers/9461fd7f5f3060eedeb2 to your computer and use it in GitHub Desktop.
test strip mine script
-- test strip mine script
os.loadAPI("path")
local DEFAULT_HEIGHT = 5
function isOverBedrock()
if turtle.detectDown() then
local itemName = turtle.inspectDown()
local i = string.find(itemName, ":")
itemName = string.sub(itemName, i + 1, string.len(itemName))
return itemName == "bedrock"
end
return false
end
function sinkshaft(height)
local overBedrock = isOverBedrock()
while not overBedrock do
path.digDown()
end
height = height or DEFAULT_HEIGHT
for i=0,height do
path.digUp()
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment