Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Simply place the turtle with saplings on the selected slot and start the program. It needs fuel to work
- function FarmTree()
- local has_block, data = turtle.inspect()
- if (has_block == false or string.find(data.name, "_log") == nil) then
- return
- end
- -- Go up and mine
- while (has_block and string.find(data.name, "_log")) do
- turtle.dig()
- turtle.digUp()
- turtle.up()
- has_block, data = turtle.inspect()
- end
- -- Return down
- has_block, data = turtle.inspectDown()
- while(has_block == false) do
- turtle.down()
- has_block, data = turtle.inspectDown()
- end
- --Replant
- data = turtle.getItemDetail()
- if (string.find(data.name, "_sapling")) then
- turtle.place()
- end
- end
- -- Main
- while (true) do
- FarmTree()
- sleep(10)
- end
Advertisement
Add Comment
Please, Sign In to add comment