Skip to content

Instantly share code, notes, and snippets.

@mralext20
Created April 29, 2019 17:34
Show Gist options
  • Save mralext20/3641ca3d6a8ace016fb9f8a798fc644f to your computer and use it in GitHub Desktop.
Save mralext20/3641ca3d6a8ace016fb9f8a798fc644f to your computer and use it in GitHub Desktop.
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