Jump to content

shape/size adaptive tree farm

  • You cannot reply to this topic
No replies to this topic

#1 ardevlirn

  • Members
  • 4 posts

Posted 01 January 2020 - 10:27 AM

Edit : This is more a template for an easily modifiable version of the program with the inventory, this version have some default(like refilling sapling/fuel from chest, slower execution speed). You can get my faster and complete version here https://pastebin.com/si0JTDx0 or "pastebin get si0JTDx0" this one don't use the inventory to compare with bloc but variable containing the bloc id string, instruction and alterable variable are at the top of the program.

What it does :
The turtle will farm tree around any custom path.
Do not break if set to run at turtle start and the turtle get unloaded (server crash/chunk unloaded)

! ! ! if unlucky the turtle can runout of sapling since it only get them when breaking a few leaves and by sucking the one falling on it's path or in front of it.
So i recommend setting up something to collect the sapling the turtle can't get, like a minecart-hopper just under the farm that then empty itself in the chest used by the turtle.

How to setup:
-Draw a path with the block of your choice (don't recommend dirt/grass/podzol since it can easily broke the pathfinding)
(the path can be a loop or a line of any shape)
-Place dirt/grass/podzol next to the path where you want tree to be placed
-Place the turtle on the path and a chest next to it.
-Place 1 chest in the slot 16, at least 4 sapling in slot 15, at least 1 wood (the one that gonna be farm) in slot 14,
at least 1 of the block used to make the path in slot 13, and the fuel in slot 12 (fuel is not needed if it's set to unlimited in computercraft config)
-Start the program (some variable can be adjusted at top of the program)
"pastebin get 93jEmv52 anyName" or https://pastebin.com/93jEmv52


In depth look at what the turtle do:
The turtle will first look around(do a 360°) for chest, some wood or empty place :
- If it see a chest the turtle will empty the harvest in it and then refill its sapling and fuel slot
- If it see some wood it will start to cut the tree
(Will cut this tree trunk and the leave adjacent to it [like a + ] and then go back to the path and place a new sapling)
- If it see a empty place it will try to place a sapling

the turtle will then check if its inventory is full until slot 11, if it's the case the turtle will search for the chest
Optional:if one of the variable is set to true: then the turtle will check if it have enough sapling and search for the chest if not enough sapling are in the inventory.

Then the turtle will again look arround but this time it will search the following of the path in each direction and move to it when found

Optional: if fuel is not unlimited then the turtle will check if it still have enough fuel in it's inventory, if not enough fuel is in inventory the turtle will search for the chest.

ps:While searching for the chest (inventory full or not enough sapling/fuel the turtle will ignore any empty space or wood it will see.
ps-2: The turtle check it's fuel level to see if it need a refuel after every move(not when rotating).

When turtle restart: (due to being unloaded and reload and you set the program to autorun)
-The turtle will look for the ground and break any wood/leaves preventing it to reach it
-Then the turtle will look around its current pos for the path and go back onto it when found
-and then the turtle will go back to its routine.

the variable that you can change:
- 'minFuelForRefuel = 800' (Will try to refuel when Fuel Level is under this amount)
- 'minFuelInInventory = 12' (Will search the chest if there is less than this amount of fuel item in inventory)
- 'goSearchSapling = false' AND 'minSaplingInInventory = 3' (If set to true will search the chest when under this amount of sappling left in inventory)
-And the slot for the chest/sapling/fuel/path block and wood when setting up the turtle.

Edited by ardevlirn, 01 January 2020 - 04:03 PM.

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users