Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fuelUp()
- if turtle.getFuelLevel() == 0 then
- turtle.select(1)
- turtle.refuel(1)
- print("Refueling...")
- print("Current fuel level: " .. turtle.getFuelLevel())
- end
- if turtle.getFuelLevel() == 0 then
- print("No fuel in slot 1.")
- chopping = false
- end
- end
- active = true
- chopping = true
- counter = 0
- turtle.dig()
- fuelUp()
- turtle.forward()
- while active do
- fuelUp()
- if turtle.detectUp() then
- turtle.digUp()
- turtle.up()
- counter = counter + 1
- else
- chopping = false
- print("Done chopping.")
- end
- if chopping == false then
- while turtle.detectDown() == false do
- fuelUp()
- turtle.down()
- end
- active = false
- print("")
- print("Job's done.")
- print("Chopped " .. counter .. " items.")
- print("Fuel remaining: " .. turtle.getFuelLevel())
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment