Skip to content

Instantly share code, notes, and snippets.

@ashap5
Last active September 4, 2021 20:46
Show Gist options
  • Save ashap5/c9c61459c32863395b15f1a6ad9701b3 to your computer and use it in GitHub Desktop.
Save ashap5/c9c61459c32863395b15f1a6ad9701b3 to your computer and use it in GitHub Desktop.
olo
blocksMovedUp = 0
while true do
--refuel
if turtle.getFuelLevel() < 1000 then
for i = 1, 16 do
if turtle.getItemDetail(i).name == "minecraft:coal" then
turtle.select(i)
turtle.refuel()
print("refueling")
end
end
end
local success, data = turtle.inspect()
--mining
if data.name == "minecraft:log" then
turtle.dig()
turtle.digUp()
turtle.up()
blocksMovedUp = blocksMovedUp + 1
print(blocksMovedUp)
elseif blocksMovedUp >= 0 then
turtle.down()
blocksMovedUp = blocksMovedUp - 1
end
if data.name == "minecraft:sapling" then
turtle.select(15)
turtle.place()
else
print("som tu")
turtle.select(16)
turtle.place()
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment