Automated Harvester

Started by Kaikaku, Mar 14, 2021, 01:50 pm

Previous topic - Next topic

Kaikaku

Mar 14, 2021, 01:50 pm Last Edit: Mar 14, 2021, 01:52 pm by Kaikaku
Automated Harvester

(This is a repost from the old forum last week, I guess I settle in here now :) )

This program could be interesting for you and give you ideas for other projects. The turtle needs a frame of "landmark blocks" to identify the area to be harvested. This allows using a startup program to boot.
The turtle can harvest most plants that grow from a source block: sugar cane, kelp, melons, pumpkins, bamboo, mushrooms, nether vines and various modded plants like industrial hemp, Pam's gardens or natura bushes.
The movement algorithm is quite simple and ensures that the turtle can handle many different farm layouts:

Dig up/forward/down and go forward
If landmark block then u-turn (right, left, right,...)
If u-turn not possible then change harvesting orientation

The turtle won't break landmark blocks.
If it detects a landmark above it, this is a home position (chest below) to drop items and wait for a specified time.
If there's a landmark below it, this is a refuel station (chest above).
The turtle tries to suck in items like bamboo or kelp.

Parameters (optional, not case sensitive):
aHarvester [startup] [notDown] [notUp] [minFuelxxxx] [critFuelxxxx] [number1 [number2]] [noCannibalism]

    startup: creates a startup file using the other parameters of the program call, old startup is renamed
    notDown: turtle won't dig down
    notUp: turtle won't dig up
    minFuelxxxx: turtle will refuel if below xxxx (default is 2000)
    critFuelxxxx: turtle will not move from home / empty fuel station when below xxxx (default is s.th. like 500)
    number1 (first number): turtle sleeps number1 seconds at home position(s)
    number2 (second number): shut down program after reaching number2+1 times a home position
    noCannibalism: don't break other turtles on same y-level (not working 100%, but the "cannibal" will stop after the feast)

Pastebin:
https://pastebin.com/ZVc6H649

Video:
The video length somehow got out of control, I actually strive for short videos.
However, the melon time lapse shows the movement pattern nicely.


PS: With the "new" waterlocked mechanism, the kelp farm doesn't have to spawn in new water soures. However, waterlocking messes up filling water tanks.
Hi there!
I make YouTube videos about my turtle programs (incl. pastebin). Visit me if you like :)