Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local saplingSlot = 13
- local bonemealSlot = 14
- local fuelSlot = 15
- local logSlot = 16
- local issue = false
- function checkFuel ()
- if turtle.getFuelLevel() < 6 then
- if turtle.getItemCount(fuelSlot) > 1 then
- turtle.select(fuelSlot)
- while turtle.getFuelLevel() < 6 do
- turtle.refuel(1)
- end
- else
- print("Fuel Reserves too low. Exiting.")
- issue = true
- end
- end
- end
- function backDown ()
- checkFuel()
- while turtle.down() do
- checkFuel()
- end
- end
- function chopTree ()
- checkFuel()
- turtle.select(logSlot)
- while turtle.compare() do
- checkFuel()
- turtle.dig()
- while not turtle.up() do
- turtle.digUp()
- end
- turtle.select(logSlot)
- end
- backDown()
- if turtle.getItemCount(saplingSlot) > 1 then
- turtle.select(saplingSlot)
- turtle.place()
- else
- print("Low on saplings. Exiting.")
- issues = true
- end
- end
- backDown()
- turtle.select(logSlot)
- if not turtle.compare() then
- turtle.dig()
- turtle.select(saplingSlot)
- turtle.place()
- end
- while not issues do
- turtle.select(logSlot)
- if not turtle.compare() then
- if turtle.getItemCount(bonemealSlot) > 1 then
- turtle.select(bonemealSlot)
- turtle.place()
- end
- else
- chopTree()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement