This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
rhyser9's profile picture

Rhyser9's Vanilla/Redwood Tree Farm

Started by rhyser9, 31 December 2012 - 08:08 AM
rhyser9 #1
Posted 31 December 2012 - 09:08 AM
Hey guys! I recently delved into ComputerCraft, and I'm really enjoying it! I thought I'd one of my programs with you! Please tell me about any bugs it has, or if there's something I should do differently!

This farm allows you to choose between farming Oak, Birch, Spruce, Jungle, or Redwood Trees (Vanilla and Redwood Trees require different setups. See the How-To section). The program will then automatically plant, bonemeal, and harvest the selected type of tree untill it runs out of materials, or something happens that causes it to error out. There is also an (optional) automatic Resupply function which will pull from adjacent chests in a specified setup (See the How-To section) and grab materials form them to top off it's supplies.

How to Use:
SpoilerThe program directs you through resupplying the turtle, but without this setup (There are 4 chests), the turtle will spit items on the ground (Sorry! Will try to change!)
Oak, Birch, Spruce, and Jungle Tree Setup:


Redwood Tree Setup (THE TURTLE MUST BE FACING WEST TO WORK!):
Screenshots:
SpoilerPlanting Redwood Tree:


Harvesting Tree:

Downloads:
Spoilerv4.0: http://pastebin.com/Q8UtRLdh
Changelog:
Spoilerv4.0:
Combined Vanilla and Redwood farms into 1 package
Improved the Resupply function
v3.0:
Made Resupply Function Optional
Cleaned up Resupply Process
v2.0:
Added Resupply Function (Activates After Harvest)
v1.0:
Original Release
Old Versions:
SpoilerVanilla Tree Farm:
SpoilerSupports Vanilla 1x1 Trees (No Giant Oak Trees)

How to Use:
SpoilerThe program directs you through resupplying the turtle, but without this setup (There are 4 chests), the turtle will spit items on the ground (Sorry! Will try to change!)
Screenshots: (Coming Soon!)
Spoiler
Downloads:
Spoilerv3.0: http://pastebin.com/fvTnebJ5
v2.0: http://pastebin.com/8WUKAbzK
v1.0: http://pastebin.com/EFuS95yS
Changelog:
Spoilerv3.0:
Made Resupply Function Optional
Cleaned up Resupply Process
v2.0:
Added Resupply Function (Activates After Harvest)
v1.0:
Original Release

Redwood Tree Farm:
SpoilerTurtle Auto-Replants and Harvests
Note: Enters into 6(-ish) Minute 'Sleep Mode' for Leaf Despawn

How to Use:
SpoilerTHE TURTLE MUST BE FACING WEST TO WORK!
The program directs you through resupplying the turtle, but without this setup (There are 4 chests), the turtle will spit items on the ground (Sorry! Will try to change!)
Screenshots:
SpoilerPlanting Redwood Tree:


Harvesting Tree:

Downloads:
Spoilerv3.0: http://pastebin.com/PJ6yq0PY
v2.0: http://pastebin.com/7qCHMEAh
v1.0: http://pastebin.com/22mTy0Nv
Changelog:
Spoilerv3.0:
Made Resupply Function Optional
Cleaned Up Resupply Process
v2.0:
Added Resupply Function (Activates Before 'Sleep Mode')
v1.0:
Original Release
Thomasoien #2
Posted 01 January 2013 - 12:38 PM
Nice program but one problem I found was when it tried to plant saplings when leaf decay was not finished and it terminated + tree grew tall and had to knock it down by hand so before the terminate command i added in a piece that would knock the saplings away and knocked the sleep time up by 80seconds


(Talking about redwood)
steel_toed_boot #3
Posted 01 January 2013 - 08:11 PM
Not bad. I wrote my own. You can learn from mine if you want ;)/>

Spoiler

local height
function getFuel()
if turtle.getFuelLevel() <=10 then
  turtle.select(1)
  turtle.refuel(2)
  end
end
function callTree()
turtle.select(2)
if turtle.getItemCount(2) <=4 then
  turtle.suckDown()
end
turtle.forward()
turtle.forward()
turtle.turnLeft()
turtle.place()
turtle.turnRight()
turtle.back()
turtle.place()
turtle.turnLeft()
turtle.place()
turtle.turnRight()
turtle.back()
turtle.place()
repeat
  turtle.select(3)
  turtle.place()
  until not turtle.place()
end
function chopDatStuffUp()
repeat
  turtle.dig()
  getFuel()
  turtle.digUp()
  turtle.up()
  height = height+1
  until not turtle.detectUp()
end
function chopDatStuffDown()
repeat
  turtle.dig()
  getFuel()
  turtle.digDown()
  turtle.down()
  height = height-1
  until height == 0
end
function cutTree()
getFuel()
turtle.dig()
turtle.forward()
turtle.digUp()
chopDatStuffUp()
turtle.dig()
turtle.forward()
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turnLeft()
chopDatStuffDown()
turtle.dig()
turtle.forward()
turtle.forward()
end
function dropItems()
for i = 2, 14 do
  if i~=3 then  
  turtle.select(i)
  turtle.dropDown()
  end
  end
turtle.turnLeft()
turtle.forward()
turtle.turnLeft()
end
function doStuff()
height=0
getFuel()
callTree()
cutTree()
dropItems()
end
doStuff()
rhyser9 #4
Posted 02 January 2013 - 07:35 AM
Nice program but one problem I found was when it tried to plant saplings when leaf decay was not finished and it terminated + tree grew tall and had to knock it down by hand so before the terminate command i added in a piece that would knock the saplings away and knocked the sleep time up by 80seconds
Thanks for the feedback! Yea the decay is a problem. It worked most of the time for me, but I was trying to make it long enough to work but nit 5 hours long :P/>
Not bad. I wrote my own. You can learn from mine if you want ;)/>
Looks nice! And thanks for the compliment!
Busi #5
Posted 25 January 2013 - 04:00 AM
Okay just tested it out with redwood but it bugs out after have used bonemeal with saplings don't match and then wood don't match and it terminate the program
coolgaza16 #6
Posted 06 June 2013 - 11:51 AM
Not bad. I wrote my own. You can learn from mine if you want ;)/>

Spoiler

local height
function getFuel()
if turtle.getFuelLevel() <=10 then
  turtle.select(1)
  turtle.refuel(2)
  end
end
function callTree()
turtle.select(2)
if turtle.getItemCount(2) <=4 then
  turtle.suckDown()
end
turtle.forward()
turtle.forward()
turtle.turnLeft()
turtle.place()
turtle.turnRight()
turtle.back()
turtle.place()
turtle.turnLeft()
turtle.place()
turtle.turnRight()
turtle.back()
turtle.place()
repeat
  turtle.select(3)
  turtle.place()
  until not turtle.place()
end
function chopDatStuffUp()
repeat
  turtle.dig()
  getFuel()
  turtle.digUp()
  turtle.up()
  height = height+1
  until not turtle.detectUp()
end
function chopDatStuffDown()
repeat
  turtle.dig()
  getFuel()
  turtle.digDown()
  turtle.down()
  height = height-1
  until height == 0
end
function cutTree()
getFuel()
turtle.dig()
turtle.forward()
turtle.digUp()
chopDatStuffUp()
turtle.dig()
turtle.forward()
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turnLeft()
chopDatStuffDown()
turtle.dig()
turtle.forward()
turtle.forward()
end
function dropItems()
for i = 2, 14 do
  if i~=3 then  
  turtle.select(i)
  turtle.dropDown()
  end
  end
turtle.turnLeft()
turtle.forward()
turtle.turnLeft()
end
function doStuff()
height=0
getFuel()
callTree()
cutTree()
dropItems()
end
doStuff()
how do you get yours too work i copied the code into my turtle but its not doing anything atm