Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shell.run('clear')
- print("Please put Dirt in Slot 1, Saplings in Slot 2, and a log in Slot 3.")
- print("Number of Trees To Plant?")
- local x = io.read()
- local dirt, sapling, log = 1, 2, 3
- turtle.up()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.back()
- turtle.back()
- turtle.back()
- for i = 0, x do
- turtle.digDown()
- turtle.select(dirt)
- turtle.placeDown()
- turtle.back()
- turtle.select(sapling)
- turtle.place()
- turtle.back()
- turtle.back()
- turtle.back()
- end
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- while true do
- -- sleep for 30 seconds
- os.sleep(30)
- for i = 0, x do
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- turtle.select(log)
- if turtle.compare() then
- turtle.dig()
- turtle.forward()
- while turtle.detectUp() do
- turtle.digUp()
- turtle.up()
- end
- while not turtle.detectDown() do
- turtle.down()
- end
- turtle.back()
- turtle.select(sapling)
- turtle.place()
- end
- turtle.turnLeft()
- end
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement