Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function pickup() --this moves from tree position and pick up stuff
- local i = 1
- turtle.turnLeft()
- sleep(0.1)
- turtle.turnLeft()
- sleep(0.1)
- turtle.forward()
- sleep(0.1)
- turtle.forward()
- sleep(0.1)
- turtle.turnLeft()
- sleep(0.1)
- turtle.forward()
- sleep(0.1)
- turtle.forward()
- sleep(0.1)
- turtle.turnLeft()
- sleep(0.1)
- while i<6
- do
- turtle.suck()
- sleep(0.1)
- turtle.turnLeft()
- sleep(0.1)
- turtle.forward()
- sleep(0.1)
- turtle.turnRight()
- sleep(0.1)
- i = i + 1
- end
- turtle.forward()
- sleep(0.1)
- i = 1
- while i<6
- do
- turtle.suck()
- sleep(0.1)
- turtle.turnRight()
- sleep(0.1)
- turtle.forward()
- sleep(0.1)
- turtle.turnLeft()
- sleep(0.1)
- i = i + 1
- end
- turtle.forward()
- sleep(0.1)
- i = 1
- while i<6
- do
- turtle.suck()
- sleep(0.1)
- turtle.turnLeft()
- sleep(0.1)
- turtle.forward()
- sleep(0.1)
- turtle.turnRight()
- sleep(0.1)
- i = i + 1
- end
- turtle.forward()
- sleep(0.1)
- i = 1
- while i<6
- do
- turtle.suck()
- sleep(0.1)
- turtle.turnRight()
- sleep(0.1)
- turtle.forward()
- sleep(0.1)
- turtle.turnLeft()
- sleep(0.1)
- i = i + 1
- end
- turtle.forward()
- sleep(0.1)
- i = 1
- while i<6
- do
- turtle.suck()
- sleep(0.1)
- turtle.turnLeft()
- sleep(0.1)
- turtle.forward()
- sleep(0.1)
- turtle.turnRight()
- sleep(0.1)
- i = i + 1
- end
- turtle.turnRight()
- sleep(0.1)
- turtle.forward()
- sleep(0.1)
- turtle.forward()
- sleep(0.1)
- turtle.forward()
- sleep(0.1)
- turtle.turnRight()
- sleep(0.1)
- turtle.forward()
- sleep(0.1)
- turtle.forward()
- sleep(0.1)
- turtle.turnRight()
- sleep(0.1)
- turtle.turnRight()
- sleep(0.1)
- end
- function drop() -- drops all stuff into inventory
- turtle.select(1)
- turtle.dropDown()
- turtle.select(2)
- turtle.dropDown()
- turtle.select(3)
- turtle.dropDown()
- turtle.select(4)
- turtle.dropDown()
- turtle.select(5)
- turtle.dropDown()
- turtle.select(6)
- turtle.dropDown()
- turtle.select(7)
- turtle.dropDown()
- turtle.select(8)
- turtle.dropDown()
- turtle.select(9)
- turtle.dropDown()
- turtle.select(10)
- turtle.dropDown()
- turtle.select(11)
- turtle.dropDown()
- turtle.select(12)
- turtle.dropDown()
- turtle.select(13)
- turtle.dropDown()
- turtle.select(14)
- turtle.dropDown()
- turtle.select(15)
- turtle.dropDown()
- turtle.select(16)
- turtle.dropDown()
- end
- function plant()
- turtle.select(1)
- sleep(0.1)
- turtle.suckDown(1)
- sleep(0.1)
- turtle.place()
- end
- function chop() --chops down tree and returns to starting position
- local success, tree = turtle.inspect()
- if tree.name == "minecraft:oak_log" then
- turtle.dig()
- sleep(0.1)
- turtle.forward()
- sleep(0.1)
- turtle.digUp()
- sleep(0.1)
- turtle.up()
- sleep(0.1)
- turtle.digUp()
- sleep(0.1)
- turtle.up()
- sleep(0.1)
- turtle.digUp()
- sleep(0.1)
- turtle.up()
- sleep(0.1)
- turtle.digUp()
- sleep(0.1)
- turtle.up()
- sleep(0.1)
- turtle.digUp()
- sleep(0.1)
- turtle.up()
- sleep(0.1)
- turtle.digUp()
- sleep(0.1)
- turtle.down()
- sleep(0.1)
- turtle.down()
- sleep(0.1)
- turtle.down()
- sleep(0.1)
- turtle.down()
- sleep(0.1)
- turtle.down()
- sleep(0.1)
- turtle.back()
- sleep(0.1)
- pickup()
- drop()
- plant()
- end
- end
- --main part of program
- local i = 1
- while i == 1 do
- chop()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement