Skip to content

Instantly share code, notes, and snippets.

@Citrus34
Last active December 22, 2024 14:14
Show Gist options
  • Save Citrus34/44ef19666c292f7848f35fc4dcfcc1dd to your computer and use it in GitHub Desktop.
Save Citrus34/44ef19666c292f7848f35fc4dcfcc1dd to your computer and use it in GitHub Desktop.
Extremely basic tree harvesting for turtles in CC: Tweaked
function fuelCheck()
if turtle.getFuelLevel() <20 then
turtle.select(1)
turtle.refuel()
print("Refueling...")
end
end
local logs = {
["forge:logs"] = true,
["minecraft:spruce_log"] = true,
["minecraft:oak_log"] = true,
["minecraft:birch_log"] = true
}
while true do
local isPresent, blockData = turtle.inspect()
if logs[blockData.name] then
fuelCheck()
print("Beginning Harvesting...")
while turtle.detect() do
turtle.dig()
turtle.suck()
turtle.digUp()
turtle.up()
end
while not turtle.detectDown() do
print("Moving down...")
turtle.down()
end
end
turtle.select(2)
turtle.place()
turtle.suck()
turtle.turnLeft()
turtle.suck()
turtle.turnLeft()
turtle.suck()
turtle.turnLeft()
turtle.suck()
turtle.turnLeft()
turtle.select(3)
turtle.dropDown()
turtle.select(4)
turtle.dropDown()
turtle.select(5)
turtle.dropDown()
turtle.select(6)
turtle.dropDown()
turtle.select(7)
turtle.dropDown()
turtle.select(8)
turtle.dropDown()
end
print("Completed Harvesting, Dropping Materials...")
print("Dropping completed, waiting fo rnew tree to grow...")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment