Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local detectInterval = 30
- local saplingSlot = 1
- local woodSlot = 2
- function countSaplings()
- while turtle.getItemCount(saplingSlot) <= 1 do
- print("Zu wenige Saplings in Slot ", saplingSlot, ", bitte nachfuellen und [Enter] druecken")
- read()
- end
- while turtle.getItemCount(woodSlot) <= 0 do
- print("Zu wenige Holzblöcke in Slot ", woodSlot, ", bitte nachfuellen und [Enter] druecken")
- read()
- end
- end
- function start()
- turtle.select(saplingSlot)
- countSaplings()
- if turtle.detect() ~= true then
- print("Die Turtle erwartet den Block, auf dem der Baum wachsen wird, vor sich. Bitte Turtle repositionieren und das Script erneut starten.")
- exit()
- end
- turtle.up()
- turtle.place()
- turtle.down()
- end
- function wait()
- turtle.select(saplingSlot)
- if turtle.detect() ~= true then
- print("Fehler: Turtle befindet sich nicht an der erwarteten Position!")
- exit()
- end
- while true do
- for i = detectInterval, 0, -1 do
- countSaplings()
- turtle.suckDown()
- sleep(1)
- end
- turtle.up()
- turtle.digUp()
- turtle.up()
- if turtle.detect() == true then
- turtle.down()
- turtle.down()
- break
- else
- turtle.down()
- turtle.down()
- end
- end
- end
- function tree()
- turtle.select(woodSlot)
- turtle.up()
- turtle.dig()
- turtle.forward()
- while turtle.compareUp() == true do
- turtle.digUp()
- turtle.up()
- end
- while turtle.down() == true do end
- turtle.turnRight()
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- turtle.turnRight()
- countSaplings()
- turtle.select(1)
- turtle.place()
- turtle.down()
- end
- function drop()
- turtle.turnRight()
- turtle.select(woodSlot)
- turtle.drop(turtle.getItemCount(woodSlot)-1)
- for i = 3, 16, 1 do
- turtle.select(i)
- turtle.drop()
- end
- turtle.turnLeft()
- end
- start()
- while true do
- wait()
- tree()
- drop()
- end
Advertisement
Add Comment
Please, Sign In to add comment