Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[place some wood to slot 1
- any kind of fertilizer to slot 2 (I assume it will be compatible with 1.5 as it applies fertilizer until something grows.
- saplings to slot 3.
- incoming fertilizer chest to the right
- incoming sapling chest to the left
- outgoing wood chest to the back.
- this is intended to be used in FTB mod pack with wood golems collecting sulfur goo from torches and dropped saplings from the dead tree. you make a mob grinder for continuous fertilizer input in vanilla and have other turtles collect dropped sapplings. alternatively, you could have this turtle patrol around to collect them but it will increase fuel consumption. by default, it uses wood in slot 1 as fuel]]--
- function cut() --cut a regular tree. will not seek all branches of a large tree. use a roof to limit growth
- turtle.select(1)
- local up=0
- while turtle.compare() do
- up=up+1
- turtle.dig()
- turtle.digUp()
- while turtle.up()==false do
- end --persistent movement. if cant move, try again
- end
- for i=1,up,1 do
- while turtle.down()==false do
- end
- end
- end --end of cut
- while true do
- c=turtle.getItemCount(2)--sulfur goo
- if c<=2 then
- turtle.turnRight()
- turtle.suck()
- turtle.turnLeft()
- end
- c=turtle.getItemCount(3)--sapling
- if c<=2 then
- turtle.turnLeft()
- turtle.suck()
- turtle.turnRight()
- end
- f=turtle.getFuelLevel()
- if f<15 then
- turtle.select(1)
- turtle.refuel(1)
- print("refuelling")
- end
- turtle.select(1)
- if turtle.compare() then
- print("tree detected. cutting...")
- cut()
- turtle.turnRight()
- turtle.turnRight()
- for i=4,16,1 do
- turtle.select(i)
- turtle.drop()
- end
- turtle.turnRight()
- turtle.turnRight()
- turtle.select(3)
- while turtle.place()==false do
- end
- print("placed sapling")
- print("3 minute sleep")
- os.sleep(60*3)
- end --end of cutting routine
- if turtle.detect()==false then
- print("nothing detected. placing sapling")
- turtle.select(3)
- while turtle.place()==false do
- end
- end
- turtle.select(1)
- while turtle.compare()==false and turtle.detect() do
- print("sapling detected. using fertilizer")
- turtle.select(2)
- turtle.place()
- turtle.select(1)
- end
- end --end of main loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement