More

Swarm and crews.

A swarm puts several turtles on one job. There is no td function to start one: swarms and crews are set up in the deck's Swarm workspace, which splits the work and hands each turtle its part. This page explains how that work relates to the td jobs your programs use.

Swarms are started from the deck.

Open the deck, go to the Swarm workspace and start the job there. Each turtle then runs ordinary td jobs for its share of the work, so everything in the mining and building chapters (fuel reserve, unloading, protected blocks) applies to each of them.

Lanes and shared progress.

A mining swarm is split into lanes that the turtles work through. The progress of every mine and hole is shared between all of your turtles on the server (see Remembered progress), which is what lets lanes change hands:

  • A lane that passes to another turtle continues where the previous turtle stopped.
  • A tunnel that ends at a block the server will not let it dig has finished, not failed, so the lane is not handed to another turtle only to hit the same wall.
  • A running hole can hand its far columns to a helper. This only happens between passes, and the turtle says so in the Console.

Build crews.

Builds can use a crew. Each layer is cut into column slices shared among the builders, and all slices of a layer finish before the next layer starts; a gate between layers waits the same way. Builders restock at the shared supply chest, or at home, exactly like a single td.build, and wait their turn when another builder is at the chest.

Surveying.

The Survey swarm program maps an area without touching it. Turtles fly just above the ground in lanes, look down, ahead and up at every step, and every block they see goes onto the map with its state. They only ever move into air: they climb over trees and buildings, wait for mobs and other turtles, never enter water or lava, and skip (and report) what they cannot get around. Each lane is one call:

td.survey({ x, z, dir, side, length, width, clearance?, maxClimb?, maxDrop?, key?, resume?, via?, returnHome? })

Fly width columns of length cells, back and forth, starting at column x, z, travelling towards facing dir with the columns stepping towards side, clearance blocks above the ground (1 is right above it). Never digs, places or attacks. Low on fuel it flies to the fuel chest and back; progress is remembered under key like a mine's (1.19.0 and later).

Returnstrue, { cells, of, blocks, skipped }, or false, err.