Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- 2x2 Tree Farm By: ZakyyyHD
- -- Save as "Fell." Capital "F" is required.
- -- Protected under the Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported (http://creativecommons.org/licenses/by-nc-nd/3.0/)
- -- Sapling chest to the LEFT of starting position.
- -- Dump chest BEHIND starting position.
- -- Bonemeal chest to the RIGHT of starting position.
- -- Functions
- -- Turn Around
- function tAr()
- for t = 1, 2 do
- turtle.turnRight(t)
- end
- end
- -- Fell Vertically Up
- function flUp()
- while turtle.detectUp() == true do
- cFuel()
- turtle.dig()
- turtle.digUp()
- turtle.up()
- height = height + 1
- end
- end
- -- Fell Vertically Down
- function flDown()
- for x = 1, height do
- cFuel()
- turtle.digDown()
- turtle.down()
- turtle.dig()
- end
- end
- -- Refuel
- function cFuel()
- if turtle.getFuelLevel() < 15 then
- turtle.select(1)
- turtle.refuel(2)
- end
- end
- -- Drop Items
- function dropI()
- tAr()
- for i = 4, 16 do
- turtle.select(i)
- turtle.drop()
- end
- tAr()
- end
- -- Check Sapling
- function cSapling()
- if turtle.getItemCount(2) < 16 then
- turtle.turnLeft()
- turtle.select(2)
- turtle.suck()
- turtle.select(1)
- turtle.turnRight()
- end
- end
- -- Grow Tree
- function grow()
- turtle.select(3)
- turtle.place()
- turtle.select(1)
- end
- -- Check Bonemeal
- function cBonemeal()
- if turtle.getItemCount(3) < 1 then
- turtle.turnRight()
- turtle.select(3)
- turtle.suck()
- turtle.select(1)
- turtle.turnLeft()
- end
- end
- -- Place Saplings
- function replant()
- turtle.select(2)
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- sleep(.5)
- turtle.place()
- sleep(.5)
- turtle.turnLeft()
- turtle.back()
- sleep(.5)
- turtle.place()
- sleep(.5)
- turtle.turnRight()
- sleep(.5)
- turtle.place()
- sleep(.5)
- turtle.turnLeft()
- turtle.back()
- sleep(.5)
- turtle.place()
- sleep(.5)
- end
- -- Main loop
- while true do
- height = 0
- cFuel()
- cSapling()
- cBonemeal()
- replant()
- grow()
- turtle.dig()
- turtle.forward()
- flUp()
- turtle.dig()
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- turtle.dig()
- flDown()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- turtle.back()
- dropI()
- end
- shell.run("Fell")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement