Created
April 29, 2019 17:34
-
-
Save mralext20/3641ca3d6a8ace016fb9f8a798fc644f to your computer and use it in GitHub Desktop.
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
function facing(target) | |
write('inspecting for ') | |
print(target) | |
f,v = turtle.inspect() | |
if f then | |
if v.name==target then | |
return true | |
else | |
return false | |
end | |
else | |
return false | |
end | |
end | |
function turnLeft(times) | |
for i=1, times do | |
turtle.turnLeft() | |
end | |
end | |
function forward(times) | |
for i=1, times do | |
turtle.forward() | |
end | |
end | |
while true do | |
print('loop start') | |
if facing('minecraft:netherrack') then | |
turnLeft(1) | |
if facing('minecraft:stone') then | |
turnLeft(2) | |
end | |
forward(2) | |
turnLeft(1) | |
if facing('minecraft:netherrack') then | |
turnLeft(2) | |
end | |
while turtle.forward() do | |
turtle.digDown() | |
end | |
turnLeft(1) | |
if facing('minecraft:stone') then | |
turnLeft(2) | |
end | |
forward(2) | |
turnLeft(1) | |
if facing('minecraft:netherrack') then | |
turnLeft(2) | |
end | |
for i = 1, 16 do | |
turtle.select(i) | |
turtle.dropDown() | |
end | |
sleep(300) | |
end | |
turtle.dig() | |
forward(1) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment