Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Tree farm program
- -- Place fir, spruce, or birch saplings in slot 1
- -- (will work with oak, but if it grows a big oak tree the program will miss the branches)
- -- place bonemeal in slot 2
- -- call the program by typing the program name followed by the number of trees you want chopped down
- -- check me out at Http://www.youtube.com/chronnotrigg
- local trees = {...}
- function plantTree()
- turtle.select(1)
- turtle.place()
- turtle.select(2)
- turtle.place()
- end
- function chopTree()
- local p = 0
- for i=0,128 do
- turtle.select(3)
- if turtle.compareUp() == true then
- turtle.digUp()
- turtle.up()
- p = p + 1
- else
- break
- end
- end
- for i=1,p do
- turtle.down()
- end
- end
- -- main
- if trees[1] == 0 then
- print("argument must be 1 or larger")
- return
- elseif tonumber(trees[1]) == nil then
- trees = 1
- end
- for i=1,trees[1] do
- plantTree()
- turtle.dig()
- turtle.forward()
- chopTree()
- turtle.back()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement