Created
April 2, 2015 03:36
-
-
Save wolfgangmeyers/9461fd7f5f3060eedeb2 to your computer and use it in GitHub Desktop.
test strip mine script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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