The command bar

What you can ask.

Press Ctrl K on the deck and say what you want in your own words. The AI answers questions (it looks things up first: your storage, the fleet, the whole map) or makes a plan: one step or many, in order or side by side, with only the turtles you mean. You read the plan, what it breaks and places, and see it on the map; nothing runs until you press Run, and one Stop ends all of it.

Everything below is what the AI knows TurtleDeck can do, in the same words it reads. Say things like “one at a time”, “do not break blocks”, “except the crafty turtles”, “stay out of the village”, “never break farmland” or “return home once finished”, and every step keeps to it. Pick the model in the command bar; the bigger ones cost more credits.

77things turtles can do
24questions you can ask
186verified examples, 26 with code
37td library functions
124CC:Tweaked functions for programs
Plans

Moving turtles.

Send turtles somewhere, home, or turn them.

Send a turtle somewhere

go

Move one turtle to a spot. It plans a route over everything the fleet has seen and goes round what is in the way; it breaks blocks only when digging is allowed and there is no clear way.

“Send t3 to 120 64 -40”“Move turtle 5 to the selected block”“Take Miner 2 to the fuel chest without breaking anything”“Go to 200 70 300 using only known tunnels”
breaks: maybehonours: leave turtles out, crafters left out, digging on or off, areas to avoid, stay inside
Parameters (3)
NameTypeWhat it does
turtle*turtleWhich turtle.
to*pointWhere to go.
knownOnlybooldefault falseOnly through corridors known to be open (never digs).

Verified:Send Miner 4 to the supply chestSend them over thereRefuel only the turtles under 30% fuel, then send Scout to the selected blockSend Miner 2 to the selected block and make that its home

Gather turtles at a spot

gather

Several turtles go to the free cells around one spot (turtles cannot share a cell), nearest first.

“Bring every idle turtle to the selected block”“Gather all miners at 100 64 -20”“Everyone meet at the supply chest”
breaks: maybehonours: leave turtles out, crafters left out, digging on or off, areas to avoid, stay inside
Parameters (2)
NameTypeWhat it does
turtlesturtlesdefault "all"Which turtles.
at*pointWhere to gather.

Verified:Send Miner 1 and Miner 2 to the fuel chest, wait 30 seconds, and bring them homeBring every idle turtle to the selected block

Send turtles home

home

Turtles travel to their home spot and face the home direction. Busy turtles are left alone (stop their job to send them home now).

“Send everyone home”“t3 and t4 go home without digging”“Return all turtles home except the crafty ones”
breaks: maybehonours: leave turtles out, crafters left out, digging on or off, areas to avoid, stay inside
Parameters (1)
NameTypeWhat it does
turtlesturtlesdefault "all"Which turtles.

Verified:Wait 5 minutes, then send everyone homeSend Miner 1 and Miner 2 to the fuel chest, wait 30 seconds, and bring them homeQuarry the selection 4 deep; even if that fails, send everyone home afterwardsTurtles that carry coal burn it, then everyone goes home

Turn turtles to face a direction

face

Turns in place to face north, east, south or west.

“Turn t2 to face north”“Make all turtles face east”
breaks: nonehonours: leave turtles out
Parameters (2)
NameTypeWhat it does
turtlesturtlesdefault "all"Which turtles.
facing*facingThe direction.

Verified:Turn Miner 2 to face northMake all turtles face east

Move a few blocks

move

Moves one turtle a number of blocks forward, back, up or down, stopping at the first block it may not pass. With digging allowed it digs its way (never chests, machines or computers).

“Move t3 forward 5 blocks”“Take the selected turtle up 10”“t1 go down 3 and dig if needed”
breaks: maybehonours: digging on or off, protect blocks, areas to avoid, stay inside
Parameters (3)
NameTypeWhat it does
turtle*turtleWhich turtle.
directionenum (forward, back, up, down)default "forward"Which way.
blocksint 1-64default 1How far.

Verified:Move Scout forward 5 blocksTake the selected turtle up 10

Turn left or right

turn

Turns one turtle a quarter turn left or right, up to three times.

“Turn t4 left”“Turn the selected turtle around”
breaks: none
Parameters (3)
NameTypeWhat it does
turtle*turtleWhich turtle.
sidesidedefault "right"Which way to turn.
timesint 1-3default 1Quarter turns.

Verified:Turn Scout around

Dig straight to a spot

dig_to

Digs a straight path to a spot: up or down first, then along x, then along z. Chests, machines, computers and protected blocks stop it.

“Dig a straight line from t2 to 100 40 -20”“Have the selected turtle bore down to y 12”
breaks: pathhonours: protect blocks, areas to avoid, stay inside
Parameters (2)
NameTypeWhat it does
turtle*turtleWhich turtle.
to*pointWhere to dig to.

Verified:Have Miner 2 dig straight down to y 40

Plans

Fuel.

Refuelling at the shared fuel chest, burning what they carry, fuel rescues.

Refuel at the fuel chest

refuel

Turtles under the target go to the shared fuel chest, take what they need in as few pulls as they can, burn it and put the rest back. They take turns at the chest (one at a time by default) and wait in line a few blocks away, never digging near it.

“Refuel all turtles to 50%. Do not include crafty turtles.”“Refuel all turtles one at a time to 50%. Do not include crafty turtles. Do not break blocks. Return home once finished.”“Top up t3 to 80% and bring it back here”“Refuel every miner under 20%”
breaks: maybe, takes fuel from the fuel chesthonours: leave turtles out, crafters left out, one at a time, digging on or off, home / stay / back, areas to avoid, stay inside
Parameters (2)
NameTypeWhat it does
turtlesturtlesdefault "all"Which turtles.
minPercentint 1-100default 50Fill up to this share of the tank; turtles already above it stay put.

Verified:Refuel all turtles to 50%. Do not include crafty turtles.Refuel all turtles one at a time to 50%. Do not include crafty turtles. Do not break blocks. Return home once finished.Top up Miner 1 to 80% and bring it back hereRefuel every turtle under 20% to half a tank

Burn fuel they carry

burn_fuel

Burns coal, charcoal and other fuel items already in the inventory up to a target, one refuel call per stack. No trip anywhere.

“Have every turtle burn the coal it carries”“Refuel t2 from its own inventory to 30%”
breaks: none, uses fuel items from the turtle's inventoryhonours: leave turtles out, crafters left out
Parameters (2)
NameTypeWhat it does
turtlesturtlesdefault "all"Which turtles.
minPercentint 1-100default 100Burn up to this share of the tank.

Verified:Have every turtle burn the coal it carriesRefuel Miner 2 from its own inventory to 30%Turtles that carry coal burn it, then everyone goes home

Send fuel to a stranded turtle

send_fuel

A fuel rescue: the best-placed turtle fetches fuel from the fuel chest, flies next to the stranded one without digging and hands it over; the stranded turtle then fills up at the chest and goes home.

“t7 ran out of fuel, send it some”“Rescue the stranded turtle”“Send fuel to Digger”
breaks: none, takes fuel from the fuel chest
Parameters (1)
NameTypeWhat it does
turtle*turtleThe turtle that is out of fuel.

Verified:Miner 1 ran out of fuel, send it some

Cancel a fuel rescue

cancel_rescue

Cancels the running fuel rescue for a turtle; the helper goes home.

“Cancel the fuel rescue for t7”“Stop rescuing Digger”
breaks: none
Parameters (1)
NameTypeWhat it does
turtle*turtleThe stranded turtle the rescue is for.

Verified:Cancel the fuel rescue for Miner 1

Automatic fuel rescue on or off

auto_rescue

Turns the automatic fuel rescue setting on or off (Settings, Fleet). When on, a turtle that runs out gets fuel without being asked.

“Turn off automatic fuel rescue”“Enable auto rescue”
breaks: none
Parameters (1)
NameTypeWhat it does
enabled*boolOn or off.

Verified:Turn off automatic fuel rescue

Plans

Inventory.

Unloading, junk, ender chests, equipment and slots.

Unload at the unload chest

unload

Turtles take turns at the shared unload chest and empty their inventory into it (the storage station drains it), keeping one stack of fuel if asked.

“Everyone unload at the deposit chest”“Empty t3's inventory into storage and come back”“Unload all miners one at a time”
breaks: maybe, puts the turtles' items into the unload chesthonours: leave turtles out, crafters left out, one at a time, digging on or off, home / stay / back, areas to avoid, stay inside
Parameters (2)
NameTypeWhat it does
turtlesturtlesdefault "all"Which turtles.
keepFuelbooldefault trueKeep one stack of fuel.

Verified:Once the miners are idle, unload them allQuarry the selected area 5 deep, then have everyone unloadUnload everyone one at a time, then refuel them to 60%, then homeEveryone unload at the deposit chest

Drop junk

drop_junk

Drops cobblestone, dirt, gravel, stone, deepslate, netherrack, tuff, granite, diorite, andesite and flint below each turtle.

“Have all turtles drop their cobblestone”“t2 throw away the junk”
breaks: none, drops junk items on the groundhonours: leave turtles out, crafters left out
Parameters (1)
NameTypeWhat it does
turtlesturtlesdefault "all"Which turtles.

Verified:Have all turtles drop their cobblestone

Unload through an ender chest

unload_ender

Empties the inventory through a carried ender chest whose other end is the deposit chest. The chest is placed above (or in front) and picked up again.

“t4 dump everything through the ender chest”“Send the selected turtle's items home through its ender chest”
breaks: none, places: one, sends the inventory to the deposit chest
Parameters (2)
NameTypeWhat it does
turtle*turtleWhich turtle.
keepFuelbooldefault trueKeep one stack of fuel.

Verified:Scout, dump everything through the ender chest

Set the ender chest item

set_ender_chest

Sets which item a turtle uses as its carried ender chest (sc-goodies:ender_storage by default).

“t3 uses enderstorage:ender_chest as its ender chest”
breaks: none
Parameters (2)
NameTypeWhat it does
turtle*turtleWhich turtle.
item*itemThe ender chest's item id.

Verified:Miner 2 uses enderstorage:ender_chest as its ender chest

Equip a tool or modem

equip

Equips an item from the turtle's inventory on the left or right side (a pickaxe, modem, crafting table...). What was there goes into the inventory.

“Equip the diamond pickaxe on t5's left”“Put the wireless modem on t2's right side”
breaks: none
Parameters (3)
NameTypeWhat it does
turtle*turtleWhich turtle.
item*itemThe item to equip (must be in the inventory).
sidesidedefault "left"Which side.

Verified:Equip the diamond pickaxe on Miner 5's left

Select a slot

select_slot

Selects an inventory slot (what place, drop and refuel use).

“Select slot 3 on t1”“t2 select slot 16”
breaks: none
Parameters (2)
NameTypeWhat it does
turtle*turtleWhich turtle.
slot*slot1 to 16.

Verified:Select slot 3 on Miner 1

Move items between slots

move_items

Moves items from one slot to another in the same turtle.

“Move t2's slot 1 into slot 5”“Put 16 of slot 3 into slot 4 on the selected turtle”
breaks: none
Parameters (4)
NameTypeWhat it does
turtle*turtleWhich turtle.
from*slotFrom slot.
to*slotTo slot.
countint 1-64default 64How many.

Verified:Move Miner 1's slot 1 into slot 5

Stack items together

stack_items

Merges partial stacks of the same item so the inventory has as many free slots as possible.

“Tidy up every turtle's inventory”“Stack t3's items”
breaks: nonehonours: leave turtles out
Parameters (1)
NameTypeWhat it does
turtlesturtlesdefault "all"Which turtles.

Verified:Tidy up every turtle's inventory

Drop or put items somewhere

drop_items

Drops items forward, up or down: into a chest or turtle if there is one, else on the ground. Leave item out to drop the selected slot.

“t4 put all its iron ore in the chest in front”“Drop 32 cobblestone down from t2”
breaks: none
Parameters (4)
NameTypeWhat it does
turtle*turtleWhich turtle.
itemitemWhich item (all stacks of it); none: the selected slot.
countint 1-1024How many (default: all).
directiondirectiondefault "forward"forward, up or down.

Verified:Miner 1, put all your raw iron in the chest in front

Take items from a chest or the ground

pick_up

Takes items from the chest in front, above or below, or picks up items lying there.

“t3 take a stack from the chest below”“Pick up the items in front of t1”
breaks: none
Parameters (3)
NameTypeWhat it does
turtle*turtleWhich turtle.
directiondirectiondefault "forward"forward, up or down.
countint 1-64default 64How many (one stack at most).

Verified:Scout, take a stack from the chest below

Plans

Shared chests.

The fuel, unload and supply chests every turtle uses.

Make a chest a shared chest

set_shared_chest

Marks the chest a turtle is parked in front of as the shared fuel, unload or supply chest. The turtle must already stand next to it, facing it (send it there first).

“Use the chest t2 is facing as the fuel chest”“Set the supply chest where the selected turtle stands”
breaks: none
Parameters (2)
NameTypeWhat it does
kind*chestKindfuel, unload or supply.
turtle*turtleThe turtle parked at the chest.

Verified:Use the chest Miner 2 is facing as the fuel chestSet the supply chest where the selected turtle stands

Forget a shared chest

clear_shared_chest

Stops using a chest as the shared fuel, unload or supply chest (the chest itself is untouched).

“Forget the unload chest”“Clear the supply chest setting”
breaks: none
Parameters (1)
NameTypeWhat it does
kind*chestKindfuel, unload or supply.

Verified:Forget the unload chest

Plans

Mining and digging.

Quarries, holes, strip mines, ore mining, tunnels, stairs, clearing.

Quarry an area

quarry

Digs the whole area out from the surface down, split into slices across the crew. Follows ore veins, unloads when full, keeps fuel to get back.

“Quarry the selected area 6 deep”“Dig out a 16x16 area centred on 100 64 -40, 10 deep, with 4 turtles”“Excavate the selection down 20 blocks and drop the junk”
breaks: volume, fills the unload chesthonours: leave turtles out, home / stay / back, areas to avoid, stay inside, protect blocks
Parameters (5)
NameTypeWhat it does
area*areaThe area to dig.
depth*int 1-64How many blocks down.
crewint 1-16How many idle turtles help (default: the idle ones nearby, at most 8).
veinsbooldefault trueAlso mine ore next to the dug blocks.
dropJunkbooldefault falseDrop cobblestone, dirt and gravel instead of carrying it home.

Verified:Quarry the selection 4 deep and say 'mining done' when they finishQuarry the selected area 5 deep, then have everyone unloadQuarry the selection 4 deep; even if that fails, send everyone home afterwardsQuarry the selected area 6 deep

Dig a box from a spot

hole

Digs a box starting at a spot: length ahead, width to the right, depth down.

“Dig a 5x5 hole 8 deep at the selected block”“Make a 3 by 3 pit, 4 deep, facing east from 50 70 20”
breaks: volumehonours: leave turtles out, home / stay / back, areas to avoid, stay inside, protect blocks
Parameters (7)
NameTypeWhat it does
from*pointThe near-left top corner.
facingfacingdefault "north"Which way the job runs.
lengthint 1-32default 5Blocks ahead.
widthint 1-32default 5Blocks to the right.
depthint 1-64default 5Blocks down.
veinsbooldefault trueAlso mine ore next to the dug blocks.
dropJunkbooldefault falseDrop cobblestone, dirt and gravel instead of carrying it home.

Verified:Dig a holeDig a 5x5 hole 8 deep at the selected block

Strip mine

strip

Parallel strip mines with side branches across an area, one turtle per mine, heading one way. With depth, the mines run that many blocks below the area's ground.

“Strip mine the selected area heading north”“Strip mine 40 below the surface across the selection with 3 turtles”
breaks: volume, places: maybehonours: leave turtles out, home / stay / back, areas to avoid, stay inside, protect blocks
Parameters (6)
NameTypeWhat it does
area*areaThe area to cover.
facingfacingdefault "north"Which way the job runs.
depthint 0-120Blocks below the ground (none: at the turtles' level).
crewint 1-16How many idle turtles help (default: the idle ones nearby, at most 8).
veinsbooldefault trueAlso mine ore next to the dug blocks.
dropJunkbooldefault trueDrop cobblestone, dirt and gravel instead of carrying it home.

Verified:Strip mine the selected area heading northStrip mine 40 below the surface across the selection with 3 turtles

Mine for an ore

mine_ore

Goes down (or up) to the best level for an ore and strip mines there; several turtles share one entrance shaft. Levels: coal 96, copper 48, iron 16, gold -16, lapis 0, redstone -59, diamond -59, emerald 236, ancient debris 15, quartz 15.

“Mine for diamonds under the selected area with 4 turtles”“Go find iron below here”“Send two turtles to mine gold heading east”
breaks: volume, places: maybehonours: leave turtles out, home / stay / back, areas to avoid, stay inside, protect blocks
Parameters (6)
NameTypeWhat it does
ore*enum (coal, copper, iron, gold, lapis, redstone, diamond, emerald, ancient_debris, quartz)Which ore.
area*areaWhere to dig the entrance and the mines.
facingfacingdefault "north"Which way the job runs.
lengthint 8-256default 48How long each mine runs.
crewint 1-16How many idle turtles help (default: the idle ones nearby, at most 8).
dropJunkbooldefault trueDrop cobblestone, dirt and gravel instead of carrying it home.

Verified:MineMine for iron under the selection, and when storage has 400 iron ingots craft 16 iron pickaxesMine for diamonds under the selected area with 4 turtlesSend two turtles to mine iron heading east under the selection

Dig a tunnel

tunnel

A corridor straight ahead from a spot, one lane per block of width, 1 to 3 high, with torches and lava/water plugged if asked.

“Dig a 2x2 tunnel 50 long heading west from the selected block”“Tunnel 100 blocks north from 0 40 0 with torches every 8”
breaks: volume, places: maybehonours: leave turtles out, home / stay / back, areas to avoid, stay inside, protect blocks
Parameters (7)
NameTypeWhat it does
from*pointWhere it starts (the block before the first dug one).
facingfacingdefault "north"Which way the job runs.
lengthint 1-256default 32How long.
widthint 1-8default 1How wide.
heightint 1-3default 2How high.
torchesint 0-64default 0Place a torch every N blocks (0: none).
veinsbooldefault trueAlso mine ore next to the dug blocks.

Verified:Dig a 2x2 tunnel 30 long west from the selected block, then stairs 10 down facing west from 375 69 -160Dig a 2x2 tunnel 50 long heading west from the selected blockTunnel 100 blocks north from 400 40 -150 with torches every 8

Dig a staircase

stairs

A walkable staircase down (or up) with headroom, one step per block.

“Dig stairs down to y 12 from the selected block, heading south”“Make a staircase 20 steps up facing east”
breaks: volume, places: maybehonours: leave turtles out, home / stay / back, areas to avoid, stay inside, protect blocks
Parameters (7)
NameTypeWhat it does
from*pointWhere it starts.
facingfacingdefault "north"Which way the job runs.
stepsint 1-128default 16How many steps.
widthint 1-4default 1How wide.
directionenum (down, up)default "down"down or up.
headroomint 2-3default 3Blocks of headroom.
torchesint 0-64default 0Place a torch every N blocks (0: none).

Verified:Dig a 2x2 tunnel 30 long west from the selected block, then stairs 10 down facing west from 375 69 -160Dig stairs down 30 steps from the selected block heading southMake a staircase 20 steps up facing east from 405 60 -160

Clear everything above the ground

clear_above

Removes trees, leaves and anything else above the ground line in an area, up to a height.

“Clear the trees in the selected area”“Flatten everything above the ground here, 10 high”
breaks: volumehonours: leave turtles out, home / stay / back, areas to avoid, stay inside, protect blocks
Parameters (4)
NameTypeWhat it does
area*areaThe area to clear.
heightint 1-64default 6How high above the ground.
crewint 1-16How many idle turtles help (default: the idle ones nearby, at most 8).
dropJunkbooldefault trueDrop cobblestone, dirt and gravel instead of carrying it home.

Verified:Clear the trees in the selected areaFlatten everything above the ground in the selection, 10 high

Break one block

dig

Breaks the block in front of, above or below one turtle (never chests, machines or computers).

“t2 break the block above”“Dig in front of the selected turtle”
breaks: onehonours: protect blocks
Parameters (2)
NameTypeWhat it does
turtle*turtleWhich turtle.
directiondirectiondefault "forward"forward, up or down.

Verified:Miner 2, break the block above you

Attack

attack

Swings at whatever mob is in front of, above or below the turtle.

“t4 attack the zombie in front”“Hit whatever is above t1”
breaks: none
Parameters (2)
NameTypeWhat it does
turtle*turtleWhich turtle.
directiondirectiondefault "forward"forward, up or down.

Verified:Scout, attack whatever is in front

Clear falling gravel or sand

clear_falling

Digs on one side until nothing falls back in.

“t3 clear the gravel above it”“Dig out the falling sand in front of the selected turtle”
breaks: pathhonours: protect blocks
Parameters (2)
NameTypeWhat it does
turtle*turtleWhich turtle.
directiondirectiondefault "forward"forward, up or down.

Verified:Miner 3, clear the gravel above it

Forget mining progress

forget_progress

Forgets how far earlier mines and holes got, so the next job from the same spot starts from the beginning.

“Forget where the mines stopped”“Reset t2's mine progress”
breaks: nonehonours: leave turtles out
Parameters (1)
NameTypeWhat it does
turtlesturtlesdefault "all"Which turtles.

Verified:Forget where the mines stopped

Plans

Mapping.

Surveys, scans and teaching the route planner.

Survey an area

survey

Turtles fly over an area just above the ground and record every block they see. Never digs, places or attacks.

“Survey a 100x100 area centred on 400 70 -150”“Map the selected area with 3 turtles”“Discover the terrain around here without digging”
breaks: nonehonours: leave turtles out, home / stay / back, areas to avoid, stay inside
Parameters (3)
NameTypeWhat it does
area*areaThe area to map.
passesint 1-3default 21 to 3 passes (more passes see walls face on).
crewint 1-16How many idle turtles help (default: the idle ones nearby, at most 8).

Verified:Refuel everyone to 50%, then survey the selected areaSurvey the selected area and at the same time deliver 64 torches, then say doneSurvey the selection now, and again in 10 minutesSurvey a 100x100 area centred on 400 70 -150

Look around

scan

Turns once around and looks up and down, recording the blocks next to each turtle on the map.

“Have every turtle look around”“t2 scan”
breaks: nonehonours: leave turtles out
Parameters (1)
NameTypeWhat it does
turtlesturtlesdefault "all"Which turtles.

Verified:Have every turtle look around

Scan with a geo scanner

geoscan

Uses an Advanced Peripherals geo scanner attached to the turtle to record every block within a radius.

“Geo scan 16 blocks around t5”“Use the geo scanner on the selected turtle”
breaks: none
Parameters (2)
NameTypeWhat it does
turtle*turtleWhich turtle.
radiusint 1-16default 8Blocks around (at most 16).

Verified:Geo scan 16 blocks around Scout

Teach the route planner a corridor

teach_route

Tells a turtle that an area (from its ground level up the given height) is open, so routes may use it (corridors somebody else dug).

“Teach t3 that the selected area is an open tunnel”“The corridor I dug here is open, remember it”
breaks: none
Parameters (3)
NameTypeWhat it does
turtle*turtleWhich turtle.
area*areaThe open space.
heightint 1-16default 2How high the space is.

Verified:Teach Miner 2 that the selected area is an open tunnel 3 high

Forget what a turtle has seen

forget_turtle_map

Clears a turtle's own memory of blocks (its local route planner); the website's map is kept.

“t4 forget its map”“Clear what the selected turtle remembers”
breaks: none
Parameters (1)
NameTypeWhat it does
turtle*turtleWhich turtle.

Verified:Miner 4, forget what you have seen

Plans

Building.

Blueprints, the storage tower and barrel upgrades.

Build a blueprint

build

Builds a blueprint layer by layer from the bottom up; each layer is shared across the crew and must finish before the next. Missing materials are fetched from the supply chest.

“Build my house blueprint at the selected block facing east”“Build the tower here with 2 turtles, pausing after each layer”
breaks: maybe, places: blueprint, uses materials from the supply chesthonours: leave turtles out, home / stay / back, areas to avoid, stay inside, protect blocks
Parameters (5)
NameTypeWhat it does
blueprint*blueprintA blueprint saved in Blueprints, or "tower".
at*pointWhere its near-left corner goes (on the ground).
facingfacingdefault "north"Which way the job runs.
crewint 1-16How many idle turtles help (default: the idle ones nearby, at most 8).
pausebooldefault falseWait after each layer until you continue (or the storage sees the new inventories).

Verified:Build my house blueprint at the selected block facing eastBuild the watchtower at the selected block with 2 turtles, pausing after each layerBuild something at the selected block

Build the storage tower

build_tower

Builds the barrel storage tower (barrels, modems and cable, with a walkway) sized to an area, layer by layer.

“Build a 3-layer storage tower on the selected area”“Extend the storage with a tower here”
breaks: maybe, places: blueprint, uses barrels, modems and cable from the supply chesthonours: leave turtles out, home / stay / back, areas to avoid, stay inside, protect blocks
Parameters (5)
NameTypeWhat it does
area*areaThe tower's footprint.
layersint 1-32default 2How many barrel layers.
crewint 1-16How many idle turtles help (default: the idle ones nearby, at most 8).
walkwaybooldefault trueLeave a walkway.
pausebooldefault trueWait after each layer for the storage to see it.

Verified:Build a 3-layer storage tower on the selected area

Continue a paused build

continue_build

Lets a build that waits after a layer carry on with the next one.

“Continue the build”“The layer is connected, go on”
breaks: none
Parameters (1)
NameTypeWhat it does
jobjobdefault "latest"Which build (default: the latest).

Verified:The layer is connected, continue the build

Upgrade barrels

upgrade_barrels

Walks a layer of barrels one block above them and replaces every barrel of one kind with another (empties each through a carried ender chest first).

“Upgrade the iron barrels in the selected area to diamond barrels”“t2 replace the barrels here with better ones”
breaks: volume, places: volume, needs the new barrels and an ender chesthonours: protect blocks
Parameters (4)
NameTypeWhat it does
turtle*turtleWhich turtle.
area*areaThe barrel layer.
fromitemdefault "sc-goodies:iron_barrel"Barrels to replace.
toitemdefault "sc-goodies:diamond_barrel"Replacement.

Verified:Upgrade the iron barrels in the selected area to diamond barrels with Miner 2

Place a block

place_block

Places a block from the inventory in front of, above or below one turtle.

“t1 place a torch below”“Put a chest in front of the selected turtle”
breaks: none, places: one
Parameters (3)
NameTypeWhat it does
turtle*turtleWhich turtle.
itemitemWhich block (none: the selected slot).
directiondirectiondefault "forward"forward, up or down.

Verified:Miner 1, place a torch below you

Plans

Storage and crafting.

Deliveries, crafting, smelting, recipes and storage stations.

Deliver items from storage

deliver

Takes items from the storage and delivers them to the output chest, to you (a manipulator) or to a turtle through the supply chest. What is missing is made from other forms (blocks, raw ore, nuggets) or crafted and smelted when a recipe allows.

“Deliver 64 torches to the output chest”“Give t3 32 coal”“Send me 17 iron ingots”
breaks: none
Parameters (4)
NameTypeWhat it does
item*itemThe item id.
count*int 1-10000How many.
toenum (output, turtle, player)default "output"Where to.
turtleturtleThe turtle (to: turtle).

Verified:Survey the selected area and at the same time deliver 64 torches, then say doneDeliver 64 torches to the output chestGive Miner 2 32 coalSend me 17 iron ingots

Craft items

craft

Makes items with the storage's crafty turtles and furnaces: takes what is stored, crafts and smelts what is missing, then delivers.

“Craft 16 chests”“Make 4 diamond pickaxes and send them to me”“Craft 64 torches for t2”
breaks: none, uses ingredients from storage
Parameters (4)
NameTypeWhat it does
item*itemWhat to make.
count*int 1-4096How many.
toenum (output, turtle, player, storage)default "output"Where the result goes (storage: keep it stored).
turtleturtleThe turtle (to: turtle).

Verified:When storage has 300 iron ingots, craft 10 hoppersMine for iron under the selection, and when storage has 400 iron ingots craft 16 iron pickaxesCraft 16 chestsMake 4 iron pickaxes and send them to me

Smelt items

smelt

Smelts raw items in the storage's furnaces (fuel taken from storage) and keeps or delivers the result. Name the result: minecraft:iron_ingot smelts raw iron.

“Smelt 64 iron ingots”“Turn the raw gold into ingots”“Smelt 32 glass and send it to me”
breaks: none, uses raw items and fuel from storage
Parameters (3)
NameTypeWhat it does
item*itemThe smelted result.
count*int 1-4096How many.
toenum (output, player, storage)default "storage"Where it goes.

Verified:Smelt 32 iron ingots and keep them in storageSmelt 64 glass and send it to me

Re-index the storage

reindex_storage

Has the storage station read every chest again (after chests were added or changed by hand).

“Re-index the storage”“Recount everything in storage”
breaks: none
Parameters (1)
NameTypeWhat it does
stationintWhich station (default: the online one).

Verified:Re-index the storage

Update the storage station

update_station

The storage station downloads the latest station program and restarts.

“Update the storage station”“Get the newest station program”
breaks: none
Parameters (1)
NameTypeWhat it does
stationintWhich station (default: the online one).

Verified:Update the storage station

Set the station's chests

setup_station

Tells the storage station which peripherals are the deposit chest, the output chest and the supply chest (peripheral names like minecraft:chest_3).

“Use minecraft:chest_2 as deposit and minecraft:chest_5 as output”
breaks: none
Parameters (4)
NameTypeWhat it does
stationintWhich station.
deposit*stringDeposit chest peripheral.
output*stringOutput chest peripheral.
supplystringSupply chest peripheral.

Verified:Use minecraft:chest_2 as the deposit chest and minecraft:chest_5 as the output chest

Learn a recipe from a crafty turtle

learn_recipe

Reads the crafting grid a player laid out in a crafty turtle, crafts it once and saves the recipe.

“Learn the recipe in Crafty's grid”“Save the recipe I laid out in t9”
breaks: none
Parameters (1)
NameTypeWhat it does
turtle*turtleThe crafty turtle with the grid laid out.

Verified:Learn the recipe in Crafty's grid

Save a recipe

save_recipe

Saves a crafting recipe (a 3x3 grid) or a smelting recipe (one input) so crafting and deliveries can use it.

“Save a recipe: 4 oak planks in a square make a crafting table”“Smelting cobblestone gives stone, remember that”
breaks: none
Parameters (5)
NameTypeWhat it does
output*itemWhat it makes.
countint 1-64default 1How many one craft makes.
kindenum (craft, smelt)default "craft"craft or smelt.
gridgridCraft: nine cells, row by row.
inputitemSmelt: the input item.

Verified:Save a recipe: 4 oak planks in a square make a crafting table

Delete a recipe

delete_recipe

Deletes a saved recipe of yours for an item.

“Delete my recipe for sticks”
breaks: none
Parameters (1)
NameTypeWhat it does
output*itemThe recipe's output.

Verified:Delete my recipe for sticks

Cancel a crafting job

cancel_craft

Cancels a running or queued crafting or delivery job.

“Cancel the crafting job”“Stop crafting the chests”
breaks: none
Parameters (1)
NameTypeWhat it does
jobjobdefault "latest"Which job (default: the latest).

Verified:Cancel the crafting job

Craft with a crafty turtle's own grid

craft_here

A crafty turtle crafts whatever is laid out in its grid, a number of times.

“Crafty, craft what is in your grid 4 times”
breaks: none
Parameters (2)
NameTypeWhat it does
turtle*turtleThe crafty turtle.
timesint 1-64default 1How many crafts.

Verified:Crafty, craft what is in your grid 4 times

Plans

Monitors.

Mirrored screens on the map.

Show a screen on a monitor in the map

show_screen

Pins a mirrored screen (a station's or a program's monitor) onto the monitor array containing a block in the 3D map.

“Show 12:monitor_0 on the monitor at the selected block”
breaks: none
Parameters (2)
NameTypeWhat it does
source*stringWhich screen: computer id and peripheral name.
at*pointA block of the monitor array.

Verified:Show 12:monitor_0 on the monitor at the selected block

Unpin a mirrored screen

hide_screen

The screen goes back to its automatic place (next to the computer that draws it).

“Unpin screen 12:monitor_0”
breaks: none
Parameters (1)
NameTypeWhat it does
source*stringWhich screen.

Verified:Unpin screen 12:monitor_0

Plans

Fleet management.

Names, homes, positions, worlds, updates and settings.

Rename a turtle

rename

Sets a turtle's label (its name everywhere).

“Rename t3 to Miner 3”“Call the selected turtle Scout”
breaks: none
Parameters (2)
NameTypeWhat it does
turtle*turtleWhich turtle.
label*stringThe new name.

Verified:Rename Miner 3 to Digger 2

Set home here

set_home

Each turtle remembers where it stands and which way it faces as home.

“Make this t2's home”“Set home for every turtle where they are”
breaks: nonehonours: leave turtles out
Parameters (1)
NameTypeWhat it does
turtlesturtlesdefault "all"Which turtles.

Verified:Set home for every turtle where they areSend Miner 2 to the selected block and make that its home

Forget home

clear_home

The turtle forgets its home.

“t5 forget your home”
breaks: none
Parameters (1)
NameTypeWhat it does
turtle*turtleWhich turtle.

Verified:Scout, forget your home

Tell a turtle where it is

set_position

Sets a turtle's position and facing by hand (no GPS). Its home moves with it; what it had seen is forgotten.

“t4 is really at 100 64 -20 facing north”
breaks: none
Parameters (3)
NameTypeWhat it does
turtle*turtleWhich turtle.
at*pointIts real position.
facing*facingWhich way it faces.

Verified:Miner 5 is really at 100 64 -20 facing north

Locate with GPS

locate_gps

Turtles find their real position with GPS (a wireless modem and a GPS constellation in range).

“Relocate every turtle with GPS”“t1 get a GPS fix”
breaks: nonehonours: leave turtles out
Parameters (1)
NameTypeWhat it does
turtlesturtlesdefault "all"Which turtles.

Verified:Relocate every turtle with GPS

Set a turtle's world

set_world

Tells a turtle which world (server or dimension) it is in; maps are kept per world.

“t6 is in the nether now”
breaks: none
Parameters (2)
NameTypeWhat it does
turtle*turtleWhich turtle.
world*stringThe world name.

Verified:Scout is in the nether now

Update the turtle program

update_turtles

Turtles download the latest TurtleDeck program and restart (running programs end first).

“Update all turtles”“Update every turtle except the crafters”
breaks: nonehonours: leave turtles out, crafters left out
Parameters (1)
NameTypeWhat it does
turtlesturtlesdefault "all"Which turtles.

Verified:Update all turtles except the crafters

Refresh a turtle's report

refresh

The turtle looks around, reads its home chest and reports its full state again.

“Refresh all turtles”“t2 report again”
breaks: nonehonours: leave turtles out
Parameters (1)
NameTypeWhat it does
turtlesturtlesdefault "all"Which turtles.

Verified:Refresh all turtles

Save a file on a turtle

write_file

Writes a text file on the turtle's disk (overwrites a file of that name).

“Save a startup file on t3 that prints hello”
breaks: none
Parameters (3)
NameTypeWhat it does
turtle*turtleWhich turtle.
path*stringThe file path.
content*textWhat goes in the file.

Verified:Save a startup file on Scout that prints hello

Plans

Programs.

Saved programs, verified code and new programs from the AI.

Run a saved program

run_program

Runs one of your saved programs on turtles, or split over an area (each turtle gets `area` and its own `lane` as Lua globals).

“Run tree-farm on t5”“Run my sorter program on all idle turtles”“Split the selected area across 3 turtles running farm.lua”
breaks: maybe, places: maybehonours: leave turtles out, digging on or off, home / stay / back, areas to avoid, stay inside, protect blocks
Parameters (4)
NameTypeWhat it does
program*programIts name in Programs.
turtlesturtlesWhich turtles (default: the selected one).
areaareaSplit this area across the turtles.
crewint 1-16How many idle turtles help (default: the idle ones nearby, at most 8).

Verified:Run tree-farm on Miner 5Run my sort program on all idle turtlesSplit the selected area across 3 turtles running wheat

Run checked code

run_code

Runs a Lua program (usually a verified example, whole or changed a little) on turtles. The AI service dry-runs it on the real turtle program in a mock world first; code that fails the check is never run.

“Farm the wheat in front of t2 and replant”“Build a 5x5 cobblestone floor under t3”“Plant saplings in a row of 8”
breaks: checked, places: checkedhonours: leave turtles out, digging on or off, home / stay / back, areas to avoid, stay inside, protect blocks
Parameters (4)
NameTypeWhat it does
code*codeThe Lua program.
namestringdefault "program"A name for the Console.
turtlesturtlesWhich turtles (default: the selected one).
areaareaSplit this area across the turtles (area and lane globals).

Verified:Dig a 1 wide 2 high tunnel 10 blocks ahead of Miner 2 and come backClear a 3x3x3 room in front of Miner 2 and come backBuild a 5x5 cobblestone platform next to Miner 2Walk back from Miner 3 and set a torch every 4 blocks, 5 torches

Write a new program

write_program

Hands the request to the AI program generator (Programs), which writes, checks and repairs a program you then run yourself.

“Write a program that farms sugar cane forever”“I need a program that sorts items by mod into different chests”
breaks: none
Parameters (1)
NameTypeWhat it does
prompt*textWhat the program should do, with sizes and coordinates.

Verified:Write a program that farms sugar cane foreverI need a program that sorts items by mod into different chests

Plans

Jobs and control.

Pause, resume, stop, wait and messages inside a plan.

Pause a job

pause_job

Pauses a plan, swarm job, crafting job or program: turtles finish the move they are making and wait.

“Pause the quarry”“Hold everything for a moment”
breaks: none
Parameters (1)
NameTypeWhat it does
jobjobdefault "latest"Which job.

Verified:Pause the quarry

Resume a job

resume_job

Resumes a paused job.

“Resume the survey”“Carry on”
breaks: none
Parameters (1)
NameTypeWhat it does
jobjobdefault "latest"Which job.

Verified:Resume the latest job

Stop a job

stop_job

Stops a job: every turtle in it stops at once, then goes home or stays where it is.

“Stop the quarry and bring them home”“Stop the strip mine, leave them there”
breaks: none
Parameters (2)
NameTypeWhat it does
jobjobdefault "latest"Which job.
homebooldefault trueGo home afterwards.

Verified:Stop the quarry and bring them homeStop the build, leave them where they are

Stop turtles

stop_turtles

Stops whatever the named turtles run (their command queue is cleared); they stay where they are.

“Stop t3”“Stop t1 and t2”
breaks: none
Parameters (1)
NameTypeWhat it does
turtles*turtlesWhich turtles.

Verified:Stop Miner 3

Stop everything

stop_all

Every job, plan and program of the account stops at once; turtles stay where they are or go home.

“Stop everything”“Emergency stop and send them all home”
breaks: none
Parameters (1)
NameTypeWhat it does
homebooldefault falseThen every turtle goes home (never digging).

Verified:Stop everythingEmergency stop and send them all home

Wait

wait

Waits inside a plan: a number of seconds, until the storage holds enough of an item, until turtles are idle, or until they have enough fuel. Steps after it start when it ends.

“Wait 5 minutes, then send them home”“When storage has 64 iron ingots, craft a hopper”“Once the miners are idle, unload them all”
breaks: none
Parameters (7)
NameTypeWhat it does
untilenum (seconds, storage, idle, fuel)default "seconds"What to wait for.
secondsseconds -21600until seconds: how long.
itemitemuntil storage: which item.
countint 1-100000until storage: how many.
turtlesturtlesuntil idle / fuel: which turtles.
percentint 1-100until fuel: the share of the tank.
timeoutMinutesint 1-1440default 60Give up after this long (the step fails).

Verified:Wait 5 minutes, then send everyone homeWhen storage has 300 iron ingots, craft 10 hoppersOnce the miners are idle, unload them allMine for iron under the selection, and when storage has 400 iron ingots craft 16 iron pickaxes

Write a line in the Console

say

Writes a message in the Console when the plan reaches this step (a milestone to look for).

“Say 'mining done' when they finish”
breaks: none
Parameters (1)
NameTypeWhat it does
text*textThe message.

Verified:Quarry the selection 4 deep and say 'mining done' when they finishSurvey the selected area and at the same time deliver 64 torches, then say done

Ask

Questions.

Read-only lookups: fleet, fuel, storage, recipes, the map and jobs.

Fleet summary

fleet_summaryquestion, read only

How many turtles are online, idle, busy, offline and crafters, and their average fuel.

“How many turtles do I have?”“How is the fleet doing?”“How many turtles are online?”
answered by the AI from the fleet

returns counts and average fuel

Verified:How many turtles do I have?How many turtles are online?

List turtles

list_turtlesquestion, read only

Turtles with their status, position and fuel, filtered and sorted.

“Which turtles are idle?”“List my offline turtles”“Which turtles are closest to the fuel chest?”
answered by the AI from the fleet

returns a list of turtles

Parameters (4)
NameTypeWhat it does
statusenum (all, idle, busy, offline, crafter, online)default "all"Which ones.
sortenum (name, fuel, distance)default "name"Order.
nearpointFor sort distance: from here.
limitint 1-96default 20At most this many results.

Verified:Which turtles are idle?

One turtle

turtle_infoquestion, read only

Everything about one turtle: position, facing, fuel, status, running program, home, equipment and inventory.

“What is t3 doing?”“Tell me about Miner 2”“Is the selected turtle busy?”
answered by the AI from the fleet

returns the turtle's state

Parameters (1)
NameTypeWhat it does
turtle*turtleWhich turtle.

Where is a turtle

where_isquestion, read only

A turtle's position and facing, and how far it is from home and from the fuel chest.

“Where is t4?”“How far is Scout from home?”
answered by the AI from the fleet

returns position and distances

Parameters (1)
NameTypeWhat it does
turtle*turtleWhich turtle.

Verified:Where is Scout?

Turtles low on fuel

low_fuelquestion, read only

Turtles under a share of their tank, lowest first.

“Which turtles are low on fuel?”“Who is under 10% fuel?”“Does anyone need fuel?”
answered by the AI from the fleet

returns turtles and their fuel

Parameters (1)
NameTypeWhat it does
percentint 1-100default 25Under this share.

Verified:Which turtles are low on fuel?

A turtle's inventory

turtle_inventoryquestion, read only

What a turtle carries, slot by slot, and what it has equipped.

“What does t2 carry?”“Is there coal in the selected turtle?”
answered by the AI from the fleet

returns slots and items

Parameters (1)
NameTypeWhat it does
turtle*turtleWhich turtle.

Verified:What is Miner 1 carrying?

Which turtles carry an item

who_carriesquestion, read only

Turtles carrying an item, and how many.

“Which turtle has diamonds on it?”“Who is carrying an ender chest?”
answered by the AI from the fleet

returns turtles and counts

Parameters (1)
NameTypeWhat it does
item*blockThe item id or part of it.

Verified:How many diamonds do I have?Which turtle has diamonds on it?

Turtles near a spot

turtles_nearquestion, read only

Turtles within a distance of a spot, nearest first.

“Which turtles are near the selected block?”“Is anyone within 20 blocks of 100 64 -20?”
answered by the AI from the fleet

returns turtles and distances

Parameters (2)
NameTypeWhat it does
at*pointThe spot.
radiusint 1-5000default 64Blocks.

Verified:Is anyone within 20 blocks of the fuel chest?

Distance between two spots

distancequestion, read only

Blocks between two spots (or a turtle and a spot): straight line and walking (x + y + z), and the fuel a trip takes.

“How far is t3 from the fuel chest?”“How much fuel to get to 400 70 -150?”
answered by the AI from the fleet

returns distances and fuel

Parameters (2)
NameTypeWhat it does
from*pointFrom (a point, or a turtle as "$t<id>").
to*pointTo.

Verified:How far is Miner 1 from the fuel chest?

How many of an item

storage_countquestion, read only

How many of an item the storage holds, counting other forms (ingots include blocks, raw ore and nuggets that can be turned into them).

“How many diamonds do I have?”“How much iron is in storage?”“Do I have enough coal for 100 torches?”
answered by the AI from the fleet

returns count, in which forms

Parameters (1)
NameTypeWhat it does
item*blockThe item id or part of it ("diamond").

Verified:How many diamonds do I have?How much iron is in storage?

Biggest stacks in storage

storage_topquestion, read only

The items the storage holds most of.

“What is filling up my storage?”“What do I have the most of?”
answered by the AI from the fleet

returns items and counts

Parameters (1)
NameTypeWhat it does
limitint 1-50default 15At most this many results.

Verified:What is filling up my storage?

How many can be made

can_makequestion, read only

How many of an item the storage could deliver right now: stored, plus what recipes, smelting and other forms can make from what is stored.

“How many chests can I craft?”“Can I make 10 hoppers?”“How many iron blocks could I make?”
answered by the website

returns the most that can be made, and what runs short

Parameters (1)
NameTypeWhat it does
item*itemThe item id.

Verified:How many chests can I craft?Can I make 10 hoppers?

Recipe for an item

recipe_forquestion, read only

The recipes that make an item (yours first, then built-in ones) and what they need.

“What is the recipe for a hopper?”“How do I make a turtle?”
answered by the website

returns recipes

Parameters (1)
NameTypeWhat it does
item*itemThe item id.

Verified:What is the recipe for a hopper?

Storage stations

stationsquestion, read only

The storage stations: online or not, furnaces, crafty turtles, supply chest, when the index was last read.

“Is the storage station online?”“How many furnaces does my storage have?”
answered by the AI from the fleet

returns stations

Verified:Is the storage station online?

Blocks in an area

map_areaquestion, read only

What the map knows about an area: block counts by type (between two heights), mapped and unknown columns.

“What blocks are in this area?”“Is there any ore in the selected area?”“How much stone is in the selection?”
answered by the relay (the whole map)

returns block counts

Parameters (4)
NameTypeWhat it does
area*areaThe area.
yMinint -64-320From this height.
yMaxint -64-320Up to this height.
limitint 1-50default 20At most this many results.

Verified:What blocks are in this area?

Nearest blocks of a kind

map_findquestion, read only

The nearest blocks on the map whose id contains some text ("iron_ore", "chest", "diamond"), from a spot or a turtle.

“Where is the nearest iron ore on the map?”“Find diamonds near t2”“Where are my chests?”
answered by the relay (the whole map)

returns blocks with positions and distances

Parameters (4)
NameTypeWhat it does
block*blockThe block id or part of it.
frompointFrom here (default: the selected turtle or block).
radiusint 1-512default 128Search this far.
limitint 1-50default 5At most this many results.

Verified:Where is the nearest iron ore on the map?Find diamonds near Miner 2

Block at a spot

map_blockquestion, read only

The block at a spot as the map knows it (with its state), or that it is air or unknown.

“What block is at 100 64 -20?”“What is the selected block?”
answered by the relay (the whole map)

returns block name and state

Parameters (1)
NameTypeWhat it does
at*pointThe spot.

Verified:What block is at 415 70 -158?

Ground height

map_surfacequestion, read only

The highest solid mapped block in a column (the ground under a spot).

“How high is the ground at 400 -150?”“What is the ground level of the selected area?”
answered by the relay (the whole map)

returns ground height

Parameters (1)
NameTypeWhat it does
at*pointThe spot (its y is ignored).

Verified:How high is the ground at 405 -160?

Map summary

map_summaryquestion, read only

How much of this world is mapped: bounds, block count and the most common blocks.

“How much of the world have my turtles mapped?”“How big is my map?”
answered by the relay (the whole map)

returns bounds and counts

Parameters (1)
NameTypeWhat it does
limitint 1-50default 10At most this many results.

Verified:How much of the world have my turtles mapped?

Running jobs

jobsquestion, read only

Running plans, swarm jobs, crafting jobs and fuel rescues, with progress and who works on them.

“What is running right now?”“How far is the quarry?”“Is the survey done?”
answered by the AI from the fleet

returns jobs

Verified:What is running right now?

Shared chests

shared_chestsquestion, read only

Where the fuel, unload and supply chests are.

“Where is the fuel chest?”“Is a supply chest set?”
answered by the AI from the fleet

returns chest positions

Verified:Where is the fuel chest?

Who is at a shared chest

chest_queuequestion, read only

The turtles using a shared chest right now and the ones waiting in line.

“Who is waiting at the fuel chest?”“Why is t4 standing still near the chest?”
answered by the relay (the whole map)

returns holders and waiting turtles

Parameters (1)
NameTypeWhat it does
kindchestKinddefault "fuel"fuel, unload or supply.

Verified:Who is waiting at the fuel chest?

What can I ask

what_can_i_askquestion, read only

Searches the list of everything TurtleDeck can do (this catalog) and the verified examples.

“Can the turtles build things?”“What can you do with storage?”“Can you farm?”
answered by the AI from the fleet

returns matching actions and examples

Parameters (1)
NameTypeWhat it does
topic*stringA word or two.

Verified:Can the turtles build things?

Program building blocks

The td library.

Functions every TurtleDeck program can call (td.*).

td.pos()

td.pos

Current position: returns { x, y, z, facing }.

“Print where the turtle is”“Remember the start position and come back to it”

returns { x, y, z, facing }

Full reference

td.home()

td.home

The saved home { x, y, z, facing }, or nil if none is set.

“Only go home if a home is set”“Show the turtle's home spot”

returns { x, y, z, facing }|nil

Full reference

td.face(f)

td.face

Turn to face 0 north, 1 east, 2 south, 3 west. Returns true when facing that way.

“Face north before digging”“Turn to face the chest”

returns boolean

Full reference

td.digMove(dir?)

td.digMove

Move one block, digging or attacking whatever is in the way. Falling gravel is handled by retrying; chests, machines, other turtles and protected blocks are never dug.

“Dig forward 10 blocks”“Go up 5, digging through anything”

returns ok: boolean, err: string|nil

Full reference

td.digTo(x, y, z)

td.digTo

Straight-line travel that digs its way: y first, then x, then z.

“Bore straight down to y 12”“Dig a line to the chest”

returns ok: boolean, err: string|nil

Full reference

td.goTo(x, y, z, opts?)

td.goTo

Smart travel: plans a route over every block the turtle has seen and replans when blocked.

“Walk to 100 64 -20 without digging”“Go to the fuel chest through known tunnels only”

returns ok: boolean, err: string|nil

Full reference

td.learn(boxes)

td.learn

Teach the route planner corridors somebody else dug. Returns how many cells were taught (at most 6000 per call).

“Teach the route planner my tunnel”“Tell the turtle a corridor is open”

returns integer

Full reference

td.setHome()

td.setHome

Remember the current spot and facing as home. Home is a parking spot: jobs do not unload there.

“Make this spot home”“Set home before the job starts”

returns true

Full reference

td.goHome(opts?)

td.goHome

Travel home with td.goTo and face the home direction. Fails with "No home set" when there is no home.

“Go home when done”“Return home without digging”

returns ok: boolean, err: string|nil

Full reference

td.emptySlots()

td.emptySlots

Number of empty inventory slots.

“Stop when fewer than 2 slots are free”“Count empty slots”

returns integer

Full reference

td.dropJunk()

td.dropJunk

Drop cobblestone, dirt, gravel, stone, deepslate, netherrack, tuff, granite, diorite, andesite and flint below the turtle.

“Throw away cobblestone when the inventory is full”“Drop dirt and gravel”
Full reference

td.refuel(target)

td.refuel

Burn fuel items from the inventory until the fuel level reaches target: one refuel call per stack with the count it needs (1.19.3). Returns whether it got there.

“Burn carried coal up to 1000 fuel”“Refuel from the inventory before starting”

returns boolean

Full reference

td.unload(keepFuel?)

td.unload

Empty the inventory into a chest / barrel touching the turtle. Keeps one stack of fuel if asked.

“Empty into the chest in front, keeping fuel”“Unload at the home chest”

returns ok: boolean, err: string|nil

Full reference

td.takeFuel(target, opts?)

td.takeFuel

Take fuel from the chest touching the turtle and burn it up to target, in as few pulls as it can (a stack a pull) and one refuel call per stack. What it does not burn goes back into the chest (opts.keep items stay on board).

“Take fuel from the chest in front up to 5000”“Fill up from the chest below”

returns ok: boolean, err: string|nil

Full reference

td.refuelAtDepot(target, opts?)

td.refuelAtDepot

Fill up at the shared fuel chest through its queue (td.useDepot), never digging, and come back.

“Fill up at the shared fuel chest and come back”“Refuel through the queue mid job”

returns ok: boolean, err: string|nil

Full reference

td.useDepot(kind, action, opts?)

td.useDepot

Use a shared chest without crowding it (1.19.3): the relay gives the turtle its turn when a spot next to the chest is free and a queue spot a few blocks away until then. The trips there and away never dig; a turtle that finds no way waits, says so and tries again.

“Take my turn at the supply chest and grab 16 torches”“Unload at the shared chest without crowding it”

returns ok: boolean, err: string|nil

Full reference

td.setEnderId(id)

td.setEnderId

Set the item id of the ender chest used by td.dumpViaEnder.

“Use enderstorage:ender_chest as the ender chest”
Full reference

td.dumpViaEnder(keep?)

td.dumpViaEnder

Empty the inventory through a carried ender chest (its other end is the deposit chest, which the storage station drains). Placed above, or in front if there is no room above. Returns true, or false and why.

“Empty the inventory through the ender chest”“Send ores home through the ender chest when full”

returns ok: boolean, err: string|nil

Full reference

td.forgetSites()

td.forgetSites

Forget the remembered progress of all mines and holes.

“Start the mine from scratch”“Forget earlier mine progress”
Full reference

td.clear(dir)

td.clear

Dig on one side until nothing falls back in (gravel, sand). Protected blocks are left alone.

“Dig out falling gravel above”“Clear sand in front until it stops falling”
Full reference

td.run(name, opts, body)

td.run

Run custom work as a job: same start/finish logging and return home as the built-in jobs. body receives check(), to call before each block: it keeps the fuel reserve and empties a full inventory (ender chest or shared unload chest).

“A custom mining job that unloads when full”“Farm rows with fuel checks between blocks”

returns ok: boolean, reason: string|nil

Full reference

td.mine

td.mine

Built-in mining jobs. Each follows ore veins, keeps enough fuel to get back and unloads when full.

“Use a built-in mining job”

td.mine.strip(opts?)

td.mine.strip

Main tunnel with side branches. Resumes where an earlier strip mine from the same spot stopped.

“Strip mine 64 blocks with branches every 3”“A strip mine with torches”

returns ok: boolean, reason: string|nil

Full reference

td.mine.tunnel(opts?)

td.mine.tunnel

A plain tunnel without side branches.

“A 3 wide 2 high tunnel 50 long”“Tunnel with torches every 8”

returns ok: boolean, reason: string|nil

Full reference

td.mine.ore(opts?)

td.mine.ore

Go down (or up) to the best level for an ore (td.ORE_LEVELS), then strip mine there. Needs real coordinates (GPS or setpos).

“Go to diamond level and mine”“Mine iron at its best level”

returns ok: boolean, reason: string|nil

Full reference

td.mine.stairs(opts?)

td.mine.stairs

Dig a walkable staircase down or up.

“Stairs down to y 0”“A staircase 30 steps up”

returns ok: boolean, reason: string|nil

Full reference

td.mine.hole(opts?)

td.mine.hole

Dig a box downwards. The turtle sits on the near-left corner: width runs to its right, length ahead, depth below. Resumes below layers dug on an earlier run.

“Dig an 8x8 hole 10 deep”“Excavate a room under the turtle”

returns ok: boolean, reason: string|nil

Full reference

td.build(bp, opts?)

td.build

Build a layered blueprint from the bottom up, standing above each layer. Rows run away from the turtle, characters to its right; "." or " " leaves a cell alone. Missing materials are fetched from the supply chest.

“Build a 5x5 platform of stone bricks”“Build a small hut from a blueprint”

returns ok: boolean, reason: string|nil

Full reference

td.upgradeBarrels(opts?)

td.upgradeBarrels

Walk a width x length area one block above a barrel layer, replacing every from barrel below with to. Needs a carried ender chest linked to the deposit chest.

“Replace iron barrels with diamond barrels”

returns ok: boolean, reason: string|nil

Full reference

td.mirrorMonitor(mon)

td.mirrorMonitor

Draw on the returned window instead of the monitor, and the website shows the screen on that monitor in the 3D map (about once a second, only rows that changed). Placed by itself when the monitor is on one of the turtle's sides; otherwise click the monitor in the map and pick the screen.

“Show a status screen on the monitor and on the map”“Draw fuel and position on the attached monitor”

returns window: table

td.depots()

td.depots

The shared chests this turtle knows, as set on the website and sent by the relay: { fuel = { x, y, z, facing }, unload = ..., supply = ... } (a copy; missing kinds are nil).

“Go to the fuel chest the turtle knows”“Print where the shared chests are”

returns depots: table

td.fuelRescue(opts)

td.fuelRescue

Fetch fuel from the shared fuel chest and hand it to the turtle at x, y, z: flies next to it without digging and drops the fuel into it. Used by the website's fuel rescue; returns false and why when it cannot.

“Bring fuel to a stranded turtle at 10 60 -5”

returns ok: boolean, count: integer|string, item: string|nil

Full reference

td.survey(opts)

td.survey

Fly over an area and record everything it sees (the ground, what is ahead and above, with block state). Never digs, places or attacks: climbs over obstacles, moves only into air and skips what it cannot reach. Returns true, { cells, of, blocks, skipped }.

“Fly over a 32x32 area and map it”

returns ok: boolean, result: table|string

Full reference

td.ORE_LEVELS

td.ORE_LEVELS

Best Y level per ore for Minecraft 1.18+, used by td.mine.ore: coal 96, copper 48, iron 16, gold -16, lapis 0, redstone -59, diamond -59, emerald 236, ancient_debris 15, quartz 15.

“Which level is best for diamonds”“Go to the redstone level”

returns table

Full reference

td.FUEL_VALUES

td.FUEL_VALUES

Fuel per item as td.refuel and td.takeFuel count it: coal and charcoal 80, coal block 800, lava bucket 1000, blaze rod 120, dried kelp block 200 (others are measured by burning one).

“How much fuel does a coal block give”“Pick the best fuel item in the inventory”

returns table

td.fence(opts?)

td.fenceturtle 1.20.0+

A plan's area rules for this program (1.20.0): every move, dig and place stays inside opts.within and out of every opts.avoid box; routes go round them. A turtle already inside a fenced cell may move out. Cleared when the program ends.

“Stay inside the farm while working”“Never walk through the village area”

returns true

td.protect(list?)

td.protectturtle 1.20.0+

Blocks this program never breaks, beyond chests, machines and computers (1.20.0). Digging one fails with "protected block" and jobs treat it as a wall. Cleared when the program ends.

“Never break the crops or the farmland”“Leave glass alone while digging”

returns integer

Program building blocks

CC:Tweaked turtle API.

Low-level turtle functions, for generated programs.

turtle.forward()

turtle.forward

Move the turtle forward one block

“Move forward one block”“Walk forward until something is in the way”

returns success: boolean, errorMessage: string|nil

Full reference

turtle.back()

turtle.back

Move the turtle back one block

“Step back one block”“Back away from the chest”

returns success: boolean, errorMessage: string|nil

Full reference

turtle.up()

turtle.up

Move the turtle up one block

“Go up one block”“Climb up to y 80”

returns success: boolean, errorMessage: string|nil

Full reference

turtle.down()

turtle.down

Move the turtle down one block

“Go down one block”“Descend until the ground is below”

returns success: boolean, errorMessage: string|nil

Full reference

turtle.turnLeft()

turtle.turnLeft

Rotate the turtle 90 degrees to the left

“Turn left”“Turn around by turning left twice”

returns success: boolean, errorMessage: string|nil

Full reference

turtle.turnRight()

turtle.turnRight

Rotate the turtle 90 degrees to the right

“Turn right”“Walk a square by turning right at each corner”

returns success: boolean, errorMessage: string|nil

Full reference

turtle.dig(side?)

turtle.dig

Attempt to break the block in front of the turtle

“Break the block in front”“Dig until the block in front is gone”

returns success: boolean, errorMessage: string|nil

Full reference

turtle.digUp(side?)

turtle.digUp

Attempt to break the block above the turtle

“Break the block above”“Clear a 2 high corridor”

returns success: boolean, errorMessage: string|nil

Full reference

turtle.digDown(side?)

turtle.digDown

Attempt to break the block below the turtle

“Break the block below”“Dig a shaft straight down”

returns success: boolean, errorMessage: string|nil

Full reference

turtle.place(text?)

turtle.place

Place a block or item in front of the turtle

“Place a block in front”“Put a torch on the wall”

returns success: boolean, errorMessage: string|nil

Full reference

turtle.placeUp(text?)

turtle.placeUp

Place a block or item above the turtle

“Place a block above”“Build a ceiling as it goes”

returns success: boolean, errorMessage: string|nil

Full reference

turtle.placeDown(text?)

turtle.placeDown

Place a block or item below the turtle

“Place a block below”“Lay a floor of cobblestone”

returns success: boolean, errorMessage: string|nil

Full reference

turtle.drop(count?)

turtle.drop

Drop the contents of the currently selected slot into the inventory in front of the turtle or into the world if there is no inventory

“Drop the selected items forward”“Put items into the chest in front”

returns success: boolean, errorMessage: string

Full reference

turtle.dropUp(count?)

turtle.dropUp

Drop the contents of the currently selected slot into the inventory above the turtle or into the world if there is no inventory

“Put items into the chest above”

returns success: boolean, errorMessage: string

Full reference

turtle.dropDown(count?)

turtle.dropDown

Drop the contents of the currently selected slot into the inventory below the turtle or into the world if there is no inventory

“Put items into the chest below”“Drop the harvest into a hopper under the turtle”

returns success: boolean, errorMessage: string

Full reference

turtle.select(slot)

turtle.select

Change the currently selected inventory slot

“Select slot 2”“Switch to the slot with seeds”

returns success: boolean

Full reference

turtle.getItemCount(slot?)

turtle.getItemCount

Get the number of items in the given slot

“How many items are in slot 1”“Stop when the seeds run out”

returns count: integer

Full reference

turtle.getItemSpace(slot?)

turtle.getItemSpace

Get the remaining space in a stack in a slot

“How much room is left in a slot”

returns count: integer

Full reference

turtle.detect()

turtle.detect

Check if there is a solid (non-air, non-liquid) block in front of the turtle

“Is there a block in front”“Walk until it hits a wall”

returns detected: boolean

Full reference

turtle.detectUp()

turtle.detectUp

Check if there is a solid (non-air, non-liquid) block above the turtle

“Is there a block above”

returns detected: boolean

Full reference

turtle.detectDown()

turtle.detectDown

Check if there is a solid (non-air, non-liquid) block below the turtle

“Is there ground below”“Go down until it lands”

returns detected: boolean

Full reference

turtle.compare()

turtle.compare

Check if the block in front of the turtle is the same as the item in the currently selected slot

“Is the block in front the same as the selected item”“Only dig blocks that match”

returns areSame: boolean

Full reference

turtle.compareUp()

turtle.compareUp

Check if the block above the turtle is the same as the item in the currently selected slot

“Is the block above the same as the selected item”

returns areSame: boolean

Full reference

turtle.compareDown()

turtle.compareDown

Check if the block below the turtle is the same as the item in the currently selected slot

“Is the block below the same as the selected item”

returns areSame: boolean

Full reference

turtle.attack(side?)

turtle.attack

Attack the entity in front of the turtle

“Attack the mob in front”“Guard a spot and hit anything that comes close”

returns attacked: boolean, errorMessage: string|nil

Full reference

turtle.attackUp(side?)

turtle.attackUp

Attack the entity above the turtle

“Attack the mob above”

returns attacked: boolean, errorMessage: string|nil

Full reference

turtle.attackDown(side?)

turtle.attackDown

Attack the entity below the turtle

“Attack the mob below”“A mob grinder turtle”

returns attacked: boolean, errorMessage: string|nil

Full reference

turtle.suck(count?)

turtle.suck

Suck an item from the inventory in front of the turtle or from the world if there is no inventory

“Take items from the chest in front”“Pick up drops in front”

returns success: boolean, errorMessage: string|nil

Full reference

turtle.suckUp(count?)

turtle.suckUp

Suck an item from the inventory above the turtle or from the world if there is no inventory

“Take items from the chest above”

returns success: boolean, errorMessage: string|nil

Full reference

turtle.suckDown(count?)

turtle.suckDown

Suck an item from the inventory below the turtle or from the world if there is no inventory

“Take items from the chest below”“Collect items off the ground under it”

returns success: boolean, errorMessage: string|nil

Full reference

turtle.getFuelLevel()

turtle.getFuelLevel

Get the amount of fuel this turtle has

“How much fuel is left”“Go home when fuel is low”

returns amount: number|"unlimited"

Full reference

turtle.refuel(count?)

turtle.refuel

Refuel this turtle using the item in the currently selected slot

“Burn the coal in the selected slot”“Check whether an item is fuel”

returns success: boolean, errorMessage: string|nil

Full reference

turtle.compareTo(slot)

turtle.compareTo

Compare the item in the currently selected slot to an item in another slot

“Are two slots holding the same item”

returns areSame: boolean

Full reference

turtle.transferTo(slot, count?)

turtle.transferTo

Move an item from the selected slot to another one

“Move items from slot 1 to slot 2”“Merge stacks”

returns success: boolean

Full reference

turtle.getSelectedSlot()

turtle.getSelectedSlot

Get the currently selected slot

“Which slot is selected”

returns slot: integer

Full reference

turtle.getFuelLimit()

turtle.getFuelLimit

Get the maximum amount of fuel that this turtle can hold

“How big is the fuel tank”“Refuel to half the tank”

returns limit: integer|"unlimited"

Full reference

turtle.equipLeft()

turtle.equipLeft

Equip/Unequip an item on the left side of this turtle

“Equip a pickaxe on the left”“Swap the modem for a crafting table”

returns success: boolean, errorMessage: string|nil

Full reference

turtle.equipRight()

turtle.equipRight

Equip/Unequip an item on the right side of this turtle

“Equip a modem on the right”

returns success: boolean, errorMessage: string|nil

Full reference

turtle.inspect()

turtle.inspect

Get information about the block in front of the turtle

“What block is in front”“Only harvest fully grown wheat”

returns blockPresent: boolean, info: inspectInfo|string

Full reference

turtle.inspectUp()

turtle.inspectUp

Get information about the block above the turtle

“What block is above”“Detect leaves overhead”

returns blockPresent: boolean, info: inspectInfo|string

Full reference

turtle.inspectDown()

turtle.inspectDown

Get information about the block below the turtle

“What block is below”“Check the crop under the turtle is ripe”

returns blockPresent: boolean, info: inspectInfo|string

Full reference

turtle.getItemDetail(slot?, detailed?)

turtle.getItemDetail

Get information about the items in the given slot

“What item is in slot 3”“Find the slot with saplings”

returns info: nil|turtleDetails|turtleDetailsDetailed

Full reference

turtle.craft(limit?)

turtle.craft

Craft a recipe based on the turtle's inventory

“Craft what is laid out in the inventory”“Craft planks from logs”

returns success: boolean, errorMessage: string|nil

Full reference
Program building blocks

Other CC:Tweaked APIs.

GPS, redstone, peripherals, rednet, os, files and text, for generated programs.

gps.locate(timeout, debug)

gps.locate

Attempt to retrieve the location of this computer

“Find the real position with GPS”“Where am I (GPS)”

returns x: number?, y: number?, z: number?

Full reference

vector.new(x, y, z)

vector.new

Create a new `Vector` object with the given coordinates

“Work out the distance between two positions”

returns vector: Vector

Full reference

redstone.getSides()

redstone.getSides

Get the valid sides of this computer

“List the sides redstone can use”

returns sides: computerSidesTable

Full reference

redstone.setOutput(side, state)

redstone.setOutput

Set the binary state of a redstone signal on a specific side of this computer

“Open the iron door behind the turtle”“Send a redstone pulse to the left”
Full reference

redstone.getOutput(side)

redstone.getOutput

Get the current redstone output state at the side of a computer

“Is the turtle sending redstone to the back”

returns state: boolean

Full reference

redstone.getInput(side)

redstone.getInput

Get the current redstone input of a given side

“Start when a lever at the back turns on”“Wait for a button press”

returns state: boolean

Full reference

redstone.setAnalogOutput(side, strength)

redstone.setAnalogOutput

Set the redstone signal strength for a given side

“Send a signal strength of 7”
Full reference

redstone.getAnalogOutput(side)

redstone.getAnalogOutput

Get the redstone analog output signal strength for a given side

“Which signal strength is the turtle sending”

returns strength: signalStrength

Full reference

redstone.getAnalogInput(side)

redstone.getAnalogInput

Get the current analog input strength for a given side

“Read a comparator's signal strength”“How full is the chest behind (via a comparator)”

returns strength: signalStrength

Full reference

redstone.setBundledOutput(side, colorSet)

redstone.setBundledOutput

Set the bundled cable output for a given side

“Turn on the white wire of a bundled cable”
Full reference

redstone.getBundledOutput(side)

redstone.getBundledOutput

Get the bundled cable output for a given side

“Which bundled wires is the turtle powering”

returns number: number

Full reference

redstone.getBundledInput(side)

redstone.getBundledInput

Get the bundled cable input for a given side

“Read a bundled cable”

returns number: number

Full reference

redstone.testBundledInput(side, colorSet)

redstone.testBundledInput

Test whether a bundled input is as expected

“Is the red wire on”

returns success: boolean

Full reference

peripheral.getNames()

peripheral.getNames

Get a list of all available peripherals

“List every attached peripheral”

returns peripherals: string[]

Full reference

peripheral.isPresent(name)

peripheral.isPresent

Determines if a peripheral is present

“Is there a peripheral on the right”

returns isPresent: boolean

Full reference

peripheral.getType(peripheral)

peripheral.getType

Get the type(s) of a peripheral

“What kind of block is attached below”

returns string

Full reference

peripheral.hasType(peripheral, peripheralType)

peripheral.hasType

Check that a peripheral has a given type

“Is the thing in front an inventory”

returns hasType: boolean|nil

Full reference

peripheral.getMethods(name)

peripheral.getMethods

Get the methods for the peripheral with a given name

“What can the attached peripheral do”

returns methods: string[]|nil

Full reference

peripheral.getName(peripheral)

peripheral.getName

Get the name of a wrapped peripheral

“The network name of a wrapped peripheral”

returns name: string

Full reference

peripheral.call(name, method, ...)

peripheral.call

Call a method on the peripheral with the provided name

“Call a method on a side without wrapping it”

returns any

Full reference

peripheral.wrap(name)

peripheral.wrap

Get a table containing all methods available on a peripheral

“Use the chest in front as an inventory”“Talk to the monitor on top”

returns wrappedPeripheral: wrappedPeripheral|nil

Full reference

peripheral.find(peripheralType, filter?)

peripheral.find

Find all peripherals of a given type and return them wrapped

“Find a monitor anywhere on the network”“Find the modem”

returns wrappedPeripherals: wrappedPeripheral[]

Full reference

rednet.open(modem)

rednet.open

Open a modem, allowing it to send and receive on rednet

“Open the wireless modem for messages”
Full reference

rednet.close(modem?)

rednet.close

Close a modem, preventing it from sending or receiving on rednet

“Close the modem”
Full reference

rednet.isOpen(modem)

rednet.isOpen

Get whether a modem is currently open on rednet

“Is the modem open”

returns isOpen: boolean

Full reference

rednet.send(recipient, message, protocol?)

rednet.send

Send a message to a target computer

“Send a message to computer 5”“Tell the base computer the job is done”

returns success: boolean

Full reference

rednet.broadcast(message, protocol)

rednet.broadcast

Broadcast a message over the channel defined by `rednet.CHANNEL_BROADCAST`

“Broadcast a message to every computer”
Full reference

rednet.receive(protocol?, timeout?)

rednet.receive

Receive a message over rednet

“Wait for a message”“Wait for a start signal from the base”

returns sender: number|nil, message: nil|number|boolean|string|table, protocol: nil

Full reference

rednet.host(protocol, hostname)

rednet.host

Register this computer as hosting a specific protocol under the provided hostname. This allows other computers to find this one by using `rednet.lookup()`

“Host a service name”
Full reference

rednet.unhost(protocol)

rednet.unhost

Stop hosting a certain protocol, preventing this computer from responding to `rednet.lookup()` requests

“Stop hosting a service name”
Full reference

rednet.lookup(protocol, hostname?)

rednet.lookup

Search the network for computers hosting a specific protocol

“Find the computer that hosts a service”

returns number|nil

Full reference

os.pullEvent(event?)

os.pullEvent

Pause execution of the current thread and wait for an event to fire

“Wait for any event”“Wait for a key press”

returns event: event|string, any

Full reference

os.pullEventRaw(event?)

os.pullEventRaw

Pause execution of the current thread and wait for an event to fire, including the terminate event

“Wait for events without stopping on Ctrl+T”

returns event: event|string, any

Full reference

os.sleep(time)

os.sleep

Pauses execution for the specified number of seconds. An alias for `_G.sleep()`

“Wait 5 seconds”“Check the farm every minute”
Full reference

sleep(time?)

sleep

Pauses execution for the specified number of seconds.

“Wait 5 seconds between harvests”
Full reference

os.startTimer(seconds)

os.startTimer

Start a timer that will fire a `timer` event when it reaches the specified number of seconds.

“Do something every 10 seconds while also listening for messages”

returns ID: integer

Full reference

os.cancelTimer(ID)

os.cancelTimer

Cancels a timer that was started with `os.startTimer()`

“Cancel a timer”
Full reference

os.queueEvent(name, ...)

os.queueEvent

Adds an event to the event queue that can later be listened to with `os.pullEvent()`

“Wake up another coroutine”
Full reference

os.getComputerID()

os.getComputerID

Get the ID of this computer

“What is this turtle's computer id”

returns ID: integer

Full reference

os.getComputerLabel()

os.getComputerLabel

Get the label of this computer

“What is this turtle called”

returns label: string|nil

Full reference

os.setComputerLabel(label?)

os.setComputerLabel

Set the label of this computer

“Rename this turtle”
Full reference

os.clock()

os.clock

Get the number of seconds that this computer has been running for

“How long has the program been running”

returns uptime: number

Full reference

os.time(locale?)

os.time

Get the current time in one of the below formats

“What time is it in game”“Only work during the day”

returns time: number

Full reference

os.day(locale?)

os.day

Get the amount of days since UNIX epoch in one of the below formats

“Which in-game day is it”

returns days: number

Full reference

os.epoch(locale)

os.epoch

Get the number of milliseconds since an epoch

“A timestamp in milliseconds”

returns milliseconds: number

Full reference

os.date(format?, time?)

os.date

Get a date string (or table)

“Today's date on the server”

returns string|dateTable

Full reference

os.reboot()

os.reboot

Reboot this computer immediately

“Restart the turtle”
Full reference

os.shutdown()

os.shutdown

Shut down this computer immediately

“Turn the turtle off”
Full reference

textutils.serialize(tbl, options?)

textutils.serialize

Get a textual representation of a Lua object, suitable for saving to a file or printing

“Save a table to a file”

returns serialized: string

Full reference

textutils.unserialize(str)

textutils.unserialize

Convert a serialized string back into a Lua object

“Read a table back from a file”

returns tbl: serializable

Full reference

textutils.serializeJSON(tbl, NBTstyle?)

textutils.serializeJSON

Get a JSON representation of the given value

“Turn a table into JSON”

returns JSON: string

Full reference

textutils.unserializeJSON(str, options?)

textutils.unserializeJSON

Convert a serialized JSON string back into a Lua table

“Read JSON”

returns unserialized: serializable|nil, errorMessage: string|nil

Full reference

textutils.formatTime(time, twentyFourHr)

textutils.formatTime

Formats a time value into a readable string

“Show the in-game time as 12:30 PM”

returns formattedTime: string

Full reference

textutils.tabulate(...)

textutils.tabulate

Print tables in a structured form

“Print a table of items in columns”
Full reference

parallel.waitForAny(...)

parallel.waitForAny

Switches between the execution of the functions until any one of them finishes

“Mine while listening for a stop message”“Run two loops, stop when either ends”
Full reference

parallel.waitForAll(...)

parallel.waitForAll

Switches between the execution of the functions until they all finish

“Run two tasks side by side until both finish”
Full reference

fs.list(path)

fs.list

Get a list of files in a directory

“List the files on the turtle”

returns files: string[]|table

Full reference

fs.exists(path)

fs.exists

Get whether a path exists

“Is there a saved progress file”

returns exists: boolean

Full reference

fs.open(path, mode)

fs.open

Opens a file for reading/writing

“Write progress to a file”“Read a file”

returns handler: ReadHandle|BinaryReadHandle|WriteHandle|BinaryWriteHandle|nil, errorMessage: nil|string

Full reference

fs.delete(path)

fs.delete

Deletes a file/directory

“Delete the progress file when done”
Full reference

fs.makeDir(path)

fs.makeDir

Create a directory, including any missing parents

“Make a folder for logs”
Full reference

fs.move(origin, destination)

fs.move

Move a file/directory to another path

“Rename a file”
Full reference

fs.copy(origin, destination)

fs.copy

Copy a file/directory to another path

“Copy a file”
Full reference

fs.isDir(path)

fs.isDir

Get whether a path is a directory

“Is this path a folder”

returns isDirectory: boolean

Full reference

fs.combine(path, ...)

fs.combine

Combine multiple components of a path into a single path

“Join a folder and a file name”

returns string: string

Full reference

fs.getSize(path)

fs.getSize

Get the size of a file

“How big is a file”

returns bytes: number

Full reference

fs.getFreeSpace(path)

fs.getFreeSpace

Get the amount of free space on the mount that the specified path is located on

“How much disk space is left”

returns free: number|"unlimited"

Full reference

settings.get(name, default?)

settings.get

Get the value of a setting

“Read a saved setting”

returns value: any

Full reference

settings.set(name, value)

settings.set

Set the value of a setting

“Change a setting”
Full reference

settings.save(path?)

settings.save

Save settings to a file

“Save settings to disk”

returns success: boolean

Full reference

settings.load(path?)

settings.load

Load settings from a file

“Load saved settings”

returns success: boolean

Full reference

settings.define(name, options?)

settings.define

Define a new setting

“Declare a setting with a default”
Full reference

term.clear()

term.clear

Clears the terminal, filling it with the current background color

“Clear the screen”
Full reference

term.write(text)

term.write

Write `text` at the current cursor position, moving the cursor to the end of the text

“Write text at the cursor”
Full reference

term.setCursorPos(x, y)

term.setCursorPos

Set the position of the cursor

“Write on line 3”
Full reference

term.setTextColor(color)

term.setTextColor

Set the color that text should be drawn in

“Print in red”
Full reference

term.getSize()

term.getSize

Get the size of the terminal

“How big is the screen”

returns width: integer, height: integer

Full reference

http.get(url, headers?, binary?)

http.get

Make a GET request

“Download a file from a URL”

returns response: Response|BinaryResponse|nil, message: string, failedResponse: nil|Response

Full reference

http.post(url, body, headers?, binary?)

http.post

Make a POST request

“Send a report to a web address”

returns response: Response|BinaryResponse|nil, message: string, failedResponse: nil|Response

Full reference

disk.isPresent(name)

disk.isPresent

Checks that an item is in a disk drive

“Is there a floppy in the drive”

returns present: boolean

Full reference

disk.eject(name)

disk.eject

Ejects any item that is in the drive, dropping it into the world

“Eject the floppy”
Full reference
Checked before you see them

Verified examples.

Requests whose plan passed every check against a test fleet, and whose code (where there is any) ran on the real turtle program in a mock world and loads in CC:Tweaked's own Lua. The AI is shown the ones closest to what you ask and may reuse their plan or code; it says when it does. Copy any of them, or open them in the command bar.

Building

“Build my house blueprint at the selected block facing east”build / reference plan / 2026-09-25
“Build my house blueprint at the selected block facing east”
  1. 01Build the house blueprint at 405 69 -160 facing east with 1 turtle.
“Build the watchtower at the selected block with 2 turtles, pausing after each layer”build / reference plan / 2026-09-25
“Build the watchtower at the selected block with 2 turtles, pausing after each layer”
  1. 01Build the watchtower blueprint at 405 69 -160 facing north with 2 turtles, waiting after each layer.
“Build a 3-layer storage tower on the selected area”build_tower / reference plan / 2026-09-25
“Build a 3-layer storage tower on the selected area”
  1. 01Build a storage tower of 3 barrel layers on x 402..417, z -170..-155 (16 x 16) with 1 turtle, waiting after each layer.
“The layer is connected, continue the build”continue_build / reference plan / 2026-09-25
“The layer is connected, continue the build”
  1. 01Continue a paused build (job latest).
“Upgrade the iron barrels in the selected area to diamond barrels with Miner 2”upgrade_barrels / reference plan / 2026-09-25
“Upgrade the iron barrels in the selected area to diamond barrels with Miner 2”
  1. 01Upgrade barrels (turtle 11, area x 402..417, z -170..-155 (16 x 16), from sc-goodies:iron_barrel, to sc-goodies:diamond_barrel).
“Miner 1, place a torch below you”place_block / reference plan / 2026-09-25
“Miner 1, place a torch below you”
  1. 01Place a block (turtle 10, item minecraft:torch, direction down).

Shared chests

“Use the chest Miner 2 is facing as the fuel chest”set_shared_chest / reference plan / 2026-09-25
“Use the chest Miner 2 is facing as the fuel chest”
  1. 01Make a chest a shared chest (kind fuel, turtle 11).
“Set the supply chest where the selected turtle stands”set_shared_chest / reference plan / 2026-09-25
“Set the supply chest where the selected turtle stands”
  1. 01Make a chest a shared chest (kind supply, turtle @selected_turtle).
“Forget the unload chest”clear_shared_chest / reference plan / 2026-09-25
“Forget the unload chest”
  1. 01Forget a shared chest (kind unload).
“Send Miner 4 to the supply chest”go / reference plan / 2026-09-25
“Send Miner 4 to the supply chest”
  1. 01Send Miner 4 to 415 71 -158 without breaking blocks.

clarify

“Dig a hole”hole / reference plan / 2026-09-25
“Dig a hole”
  1. 01Hole from 405 69 -160 heading north, 5 long, 5 wide, 5 deep.
“Mine”mine_ore / reference plan / 2026-09-25
“Mine”
  1. 01Mine for diamond under x 402..417, z -170..-155 (16 x 16) heading north, with 8 turtles.
“Build something at the selected block”build / reference plan / 2026-09-25
“Build something at the selected block”
  1. 01Build the house blueprint at 405 69 -160 facing north with 1 turtle.
“Send them over there”go / reference plan / 2026-09-25
“Send them over there”
  1. 01Send Scout to 405 69 -160 without breaking blocks.

Jobs and control

“Pause the quarry”pause_job / reference plan / 2026-09-25
“Pause the quarry”
  1. 01Pause a job (job plan:pq1).
“Resume the latest job”resume_job / reference plan / 2026-09-25
“Resume the latest job”
  1. 01Resume a job (job latest).
“Stop the quarry and bring them home”stop_job / reference plan / 2026-09-25
“Stop the quarry and bring them home”
  1. 01Stop a job (job plan:pq1, home true).
“Stop the build, leave them where they are”stop_job / reference plan / 2026-09-25
“Stop the build, leave them where they are”
  1. 01Stop a job (job swarm:sb2).
“Stop Miner 3”stop_turtles / reference plan / 2026-09-25
“Stop Miner 3”
  1. 01Stop turtles (turtles 12).
“Stop everything”stop_all / reference plan / 2026-09-26
“Stop everything”
  1. 01Stop every job and program; the turtles stay where they are.
“Emergency stop and send them all home”stop_all / reference plan / 2026-09-26
“Emergency stop and send them all home”
  1. 01Stop every job and program, then every turtle goes home without digging.
“Wait 5 minutes, then send everyone home”wait + home / reference plan / 2026-09-25
“Wait 5 minutes, then send everyone home”
  1. 01Wait 300 seconds.
  2. 02Send 9 turtles home without breaking blocks. Crafty is left out. (after step 1)
“When storage has 300 iron ingots, craft 10 hoppers”wait + craft / reference plan / 2026-09-25
“When storage has 300 iron ingots, craft 10 hoppers”
  1. 01Wait until the storage has 300 iron ingot.
  2. 02Craft 10 hopper to the output chest. (after step 1)
“Once the miners are idle, unload them all”wait + unload / reference plan / 2026-09-25
“Once the miners are idle, unload them all”
  1. 01Wait until the turtles are idle.
  2. 02Unload 6 turtles at the unload chest, one at a time, keeping a stack of fuel, then home. (after step 1)
“Quarry the selection 4 deep and say 'mining done' when they finish”quarry + say / reference plan / 2026-09-25
“Quarry the selection 4 deep and say 'mining done' when they finish”
  1. 01Quarry x 402..417, z -170..-155 (16 x 16), 4 blocks deep, with 8 turtles.
  2. 02Say "mining done" in the Console. (after step 1)

Fuel

“Refuel all turtles to 50%. Do not include crafty turtles.”refuel / reference plan / 2026-09-25
“Refuel all turtles to 50%. Do not include crafty turtles.”
  1. 01Refuel 5 turtles under 50% at the fuel chest (411 71 -158), one at a time, without breaking blocks, then home. The other 3 have enough. Crafty and Crafty 2 are left out.
“Refuel all turtles one at a time to 50%. Do not include crafty turtles. Do not break blocks. Return home once finished.”refuel / reference plan / 2026-09-26
“Refuel all turtles one at a time to 50%. Do not include crafty turtles. Do not break blocks. Return home once finished.”
  1. 01Refuel 5 turtles under 50% at the fuel chest (411 71 -158), one at a time, without breaking blocks, then home. The other 3 have enough. Crafty and Crafty 2 are left out.
“Top up Miner 1 to 80% and bring it back here”refuel / reference plan / 2026-09-26
“Top up Miner 1 to 80% and bring it back here”
  1. 01Refuel 1 turtle under 80% (Miner 1) at the fuel chest (411 71 -158), one at a time, without breaking blocks, then back to where they were.
“Refuel every turtle under 20% to half a tank”refuel / reference plan / 2026-09-25
“Refuel every turtle under 20% to half a tank”
  1. 01Refuel 6 turtles under 50% at the fuel chest (411 71 -158), one at a time, without breaking blocks, then home. The other 3 have enough. Crafty is left out. Only turtles under 20% fuel then.
“Have every turtle burn the coal it carries”burn_fuel / reference plan / 2026-09-25
“Have every turtle burn the coal it carries”
  1. 019 turtles burn the fuel they carry, up to 100% of the tank. Crafty is left out.
“Refuel Miner 2 from its own inventory to 30%”burn_fuel / reference plan / 2026-09-25
“Refuel Miner 2 from its own inventory to 30%”
  1. 01Miner 2 burn the fuel they carry, up to 30% of the tank.
“Miner 1 ran out of fuel, send it some”send_fuel / reference plan / 2026-09-25
“Miner 1 ran out of fuel, send it some”
  1. 01Fuel rescue for Miner 1: a turtle with fuel brings it some from the fuel chest, never digging.
“Cancel the fuel rescue for Miner 1”cancel_rescue / reference plan / 2026-09-25
“Cancel the fuel rescue for Miner 1”
  1. 01Cancel a fuel rescue (turtle 10).
“Turn off automatic fuel rescue”auto_rescue / reference plan / 2026-09-25
“Turn off automatic fuel rescue”
  1. 01Automatic fuel rescue on or off.
“Refuel all turtles to 50%, they can all crowd the chest at once”refuel / reference plan / 2026-09-26
“Refuel all turtles to 50%, they can all crowd the chest at once”
  1. 01Refuel 6 turtles under 50% at the fuel chest (411 71 -158), as many at once as the chest has room for, without breaking blocks, then home. The other 3 have enough. Crafty is left out.
“Refuel everyone to 60% and let them dig through if they get stuck”refuel / reference plan / 2026-09-26
“Refuel everyone to 60% and let them dig through if they get stuck”
  1. 01Refuel 6 turtles under 60% at the fuel chest (411 71 -158), one at a time, digging only where there is no clear way, then home. The other 3 have enough. Crafty is left out.

Fleet management

“Rename Miner 3 to Digger 2”rename / reference plan / 2026-09-25
“Rename Miner 3 to Digger 2”
  1. 01Rename a turtle (turtle 12, label Digger 2).
“Set home for every turtle where they are”set_home / reference plan / 2026-09-25
“Set home for every turtle where they are”
  1. 019 turtles remember where they stand as home.
“Scout, forget your home”clear_home / reference plan / 2026-09-25
“Scout, forget your home”
  1. 01Forget home (turtle 40).
“Miner 5 is really at 100 64 -20 facing north”set_position / reference plan / 2026-09-25
“Miner 5 is really at 100 64 -20 facing north”
  1. 01Tell a turtle where it is (turtle 14, at 100 64 -20, facing north).
“Relocate every turtle with GPS”locate_gps / reference plan / 2026-09-25
“Relocate every turtle with GPS”
  1. 01Locate with GPS (turtles all).
“Scout is in the nether now”set_world / reference plan / 2026-09-25
“Scout is in the nether now”
  1. 01Set a turtle's world (turtle 40, world nether).
“Update all turtles except the crafters”update_turtles / reference plan / 2026-09-25
“Update all turtles except the crafters”
  1. 01Update the turtle program (turtles all).
“Refresh all turtles”refresh / reference plan / 2026-09-25
“Refresh all turtles”
  1. 01Refresh a turtle's report (turtles all).
“Save a startup file on Scout that prints hello”write_file / reference plan / 2026-09-25
“Save a startup file on Scout that prints hello”
  1. 01Save a file on a turtle (turtle 40, path startup.lua, content print("hello")).

graphs

“Refuel everyone to 50%, then survey the selected area”refuel + survey / reference plan / 2026-09-25
“Refuel everyone to 50%, then survey the selected area”
  1. 01Refuel 6 turtles under 50% at the fuel chest (411 71 -158), one at a time, without breaking blocks, then home. The other 3 have enough. Crafty is left out.
  2. 02Survey x 402..417, z -170..-155 (16 x 16) in 2 passes with 8 turtles, never digging or placing. (after step 1)
“Quarry the selected area 5 deep, then have everyone unload”quarry + unload / reference plan / 2026-09-25
“Quarry the selected area 5 deep, then have everyone unload”
  1. 01Quarry x 402..417, z -170..-155 (16 x 16), 5 blocks deep, with 8 turtles.
  2. 02Unload 9 turtles at the unload chest, one at a time, keeping a stack of fuel, then home. Crafty is left out. (after step 1)
“Survey the selected area and at the same time deliver 64 torches, then say done”survey + deliver + say / reference plan / 2026-09-25
“Survey the selected area and at the same time deliver 64 torches, then say done”
  1. 01Survey x 402..417, z -170..-155 (16 x 16) in 2 passes with 8 turtles, never digging or placing.
  2. 02Deliver 64 torch to the output chest.
  3. 03Say "done" in the Console. (after step 1 and 2)
“Refuel only the turtles under 30% fuel, then send Scout to the selected block”refuel + go / reference plan / 2026-09-25
“Refuel only the turtles under 30% fuel, then send Scout to the selected block”
  1. 01Refuel 6 turtles under 50% at the fuel chest (411 71 -158), one at a time, without breaking blocks, then home. The other 3 have enough. Crafty is left out. Only turtles under 30% fuel then.
  2. 02Send Scout to 405 69 -160 without breaking blocks. (after step 1)
“Mine for iron under the selection, and when storage has 400 iron ingots craft 16 iron pickaxes”mine_ore + wait + craft / reference plan / 2026-09-25
“Mine for iron under the selection, and when storage has 400 iron ingots craft 16 iron pickaxes”
  1. 01Mine for iron under x 402..417, z -170..-155 (16 x 16) heading north, with 8 turtles.
  2. 02Wait until the storage has 400 iron ingot.
  3. 03Craft 16 iron pickaxe to the output chest. (after step 2)
“Unload everyone one at a time, then refuel them to 60%, then home”unload + refuel / reference plan / 2026-09-25
“Unload everyone one at a time, then refuel them to 60%, then home”
  1. 01Unload 9 turtles at the unload chest, one at a time, keeping a stack of fuel, then home. Crafty is left out.
  2. 02Refuel 6 turtles under 60% at the fuel chest (411 71 -158), one at a time, without breaking blocks, then home. The other 3 have enough. Crafty is left out. (after step 1)
“Dig a 2x2 tunnel 30 long west from the selected block, then stairs 10 down facing west from 375 69 -160”tunnel + stairs / reference plan / 2026-09-25
“Dig a 2x2 tunnel 30 long west from the selected block, then stairs 10 down facing west from 375 69 -160”
  1. 01Tunnel from 405 69 -160 heading west, 30 long, 2 wide and 2 high.
  2. 02Stairs down from 375 69 -160 heading west, 10 steps. (after step 1)
“Send Miner 2 to the selected block and make that its home”go + set_home / reference plan / 2026-09-25
“Send Miner 2 to the selected block and make that its home”
  1. 01Send Miner 2 to 405 69 -160 without breaking blocks.
  2. 02Miner 2 remembers where it stands as home. (after step 1)
“Send Miner 1 and Miner 2 to the fuel chest, wait 30 seconds, and bring them home”gather + wait + home / reference plan / 2026-09-25
“Send Miner 1 and Miner 2 to the fuel chest, wait 30 seconds, and bring them home”
  1. 01Gather Miner 1, Miner 2 around 411 71 -158 without breaking blocks.
  2. 02Wait 30 seconds. (after step 1)
  3. 03Send Miner 1, Miner 2 home without breaking blocks. (after step 2)
“Survey the selection now, and again in 10 minutes”survey + wait + survey / reference plan / 2026-09-25
“Survey the selection now, and again in 10 minutes”
  1. 01Survey x 402..417, z -170..-155 (16 x 16) in 2 passes with 8 turtles, never digging or placing.
  2. 02Wait 600 seconds. (after step 1)
  3. 03Survey x 402..417, z -170..-155 (16 x 16) in 2 passes with 8 turtles, never digging or placing. (after step 2)
“Quarry the selection 4 deep; even if that fails, send everyone home afterwards”quarry + home / reference plan / 2026-09-25
“Quarry the selection 4 deep; even if that fails, send everyone home afterwards”
  1. 01Quarry x 402..417, z -170..-155 (16 x 16), 4 blocks deep, with 8 turtles.
  2. 02Send 9 turtles home without breaking blocks. Crafty is left out. (after step 1)
“Turtles that carry coal burn it, then everyone goes home”burn_fuel + home / reference plan / 2026-09-25
“Turtles that carry coal burn it, then everyone goes home”
  1. 019 turtles burn the fuel they carry, up to 100% of the tank. Crafty is left out. Only turtles carrying coal.
  2. 02Send 9 turtles home without breaking blocks. Crafty is left out. (after step 1)

Inventory

“Everyone unload at the deposit chest”unload / reference plan / 2026-09-26
“Everyone unload at the deposit chest”
  1. 01Unload 9 turtles at the unload chest, one at a time, keeping a stack of fuel, then home. Crafty is left out.
“Empty Miner 3's inventory into storage and come back”unload / reference plan / 2026-09-25
“Empty Miner 3's inventory into storage and come back”
  1. 01Unload Miner 3 at the unload chest, one at a time, keeping a stack of fuel, then back to where they were.
“Have all turtles drop their cobblestone”drop_junk / reference plan / 2026-09-25
“Have all turtles drop their cobblestone”
  1. 01Drop junk (turtles all).
“Scout, dump everything through the ender chest”unload_ender / reference plan / 2026-09-25
“Scout, dump everything through the ender chest”
  1. 01Unload through an ender chest (turtle 40, keepFuel true).
“Equip the diamond pickaxe on Miner 5's left”equip / reference plan / 2026-09-25
“Equip the diamond pickaxe on Miner 5's left”
  1. 01Equip a tool or modem (turtle 14, item minecraft:diamond_pickaxe, side left).
“Select slot 3 on Miner 1”select_slot / reference plan / 2026-09-25
“Select slot 3 on Miner 1”
  1. 01Select a slot (turtle 10, slot 3).
“Move Miner 1's slot 1 into slot 5”move_items / reference plan / 2026-09-25
“Move Miner 1's slot 1 into slot 5”
  1. 01Move items between slots (turtle 10, from 1, to 5, count 64).
“Tidy up every turtle's inventory”stack_items / reference plan / 2026-09-25
“Tidy up every turtle's inventory”
  1. 01Stack items together (turtles all).
“Miner 1, put all your raw iron in the chest in front”drop_items / reference plan / 2026-09-25
“Miner 1, put all your raw iron in the chest in front”
  1. 01Drop or put items somewhere (turtle 10, item minecraft:raw_iron, direction forward).
“Scout, take a stack from the chest below”pick_up / reference plan / 2026-09-25
“Scout, take a stack from the chest below”
  1. 01Take items from a chest or the ground (turtle 40, direction down, count 64).
“Miner 2 uses enderstorage:ender_chest as its ender chest”set_ender_chest / reference plan / 2026-09-25
“Miner 2 uses enderstorage:ender_chest as its ender chest”
  1. 01Set the ender chest item (turtle 11, item enderstorage:ender_chest).

Moving turtles

“Send Miner 2 to 420 70 -140”go / reference plan / 2026-09-25
“Send Miner 2 to 420 70 -140”
  1. 01Send Miner 2 to 420 70 -140 without breaking blocks.
“Move turtle 12 to the selected block”go / reference plan / 2026-09-25
“Move turtle 12 to the selected block”
  1. 01Send Miner 3 to 405 69 -160 without breaking blocks.
“Take Miner 1 to the fuel chest without breaking anything”go / reference plan / 2026-09-25
“Take Miner 1 to the fuel chest without breaking anything”
  1. 01Send Miner 1 to 411 71 -158 without breaking blocks.
“Go to 430 70 -140 using only known tunnels”go / reference plan / 2026-09-25
“Go to 430 70 -140 using only known tunnels”
  1. 01Send Miner 2 to 430 70 -140 through known tunnels only.
“Send everyone home”home / reference plan / 2026-09-26
“Send everyone home”
  1. 01Send 9 turtles home without breaking blocks. Crafty is left out.
“Miner 3 and Miner 4 go home without digging”home / reference plan / 2026-09-26
“Miner 3 and Miner 4 go home without digging”
  1. 01Send Miner 3, Miner 4 home without breaking blocks.
“Return all turtles home except the crafty ones”home / reference plan / 2026-09-26
“Return all turtles home except the crafty ones”
  1. 01Send 8 turtles home without breaking blocks. Crafty and Crafty 2 are left out.
“Turn Miner 2 to face north”face / reference plan / 2026-09-25
“Turn Miner 2 to face north”
  1. 01Turn Miner 2 to face north.
“Make all turtles face east”face / reference plan / 2026-09-25
“Make all turtles face east”
  1. 01Turn 9 turtles to face east.
“Move Scout forward 5 blocks”move / reference plan / 2026-09-25
“Move Scout forward 5 blocks”
  1. 01Move Scout 5 blocks forward without breaking blocks.
“Take the selected turtle up 10”move / reference plan / 2026-09-25
“Take the selected turtle up 10”
  1. 01Move the selected turtle 10 blocks up without breaking blocks.
“Turn Scout around”turn / reference plan / 2026-09-25
“Turn Scout around”
  1. 01Turn left or right (turtle 40, side right, times 2).
“Bring every idle turtle to the selected block”gather / reference plan / 2026-09-25
“Bring every idle turtle to the selected block”
  1. 01Gather 8 turtles around 405 69 -160 without breaking blocks.
“Have Miner 2 dig straight down to y 40”dig_to / reference plan / 2026-09-25
“Have Miner 2 dig straight down to y 40”
  1. 01Dig straight to a spot (turtle 11, to 402 40 -150).

Monitors

“Show 12:monitor_0 on the monitor at the selected block”show_screen / reference plan / 2026-09-25
“Show 12:monitor_0 on the monitor at the selected block”
  1. 01Show a screen on a monitor in the map (source 12:monitor_0, at 405 69 -160).
“Unpin screen 12:monitor_0”hide_screen / reference plan / 2026-09-25
“Unpin screen 12:monitor_0”
  1. 01Unpin a mirrored screen (source 12:monitor_0).

Mapping

“Survey a 100x100 area centred on 400 70 -150”survey / reference plan / 2026-09-25
“Survey a 100x100 area centred on 400 70 -150”
  1. 01Survey x 351..450, z -199..-100 (100 x 100) in 2 passes with 8 turtles, never digging or placing.
“Map the selected area with 3 turtles”survey / reference plan / 2026-09-25
“Map the selected area with 3 turtles”
  1. 01Survey x 402..417, z -170..-155 (16 x 16) in 2 passes with 3 turtles, never digging or placing.
“Discover the terrain in the selected area without digging”survey / reference plan / 2026-09-25
“Discover the terrain in the selected area without digging”
  1. 01Survey x 402..417, z -170..-155 (16 x 16) in 2 passes with 8 turtles, never digging or placing.
“Have every turtle look around”scan / reference plan / 2026-09-25
“Have every turtle look around”
  1. 01Look around (turtles all).
“Geo scan 16 blocks around Scout”geoscan / reference plan / 2026-09-25
“Geo scan 16 blocks around Scout”
  1. 01Scan with a geo scanner (turtle 40, radius 16).
“Teach Miner 2 that the selected area is an open tunnel 3 high”teach_route / reference plan / 2026-09-25
“Teach Miner 2 that the selected area is an open tunnel 3 high”
  1. 01Teach the route planner a corridor (turtle 11, area x 402..417, z -170..-155 (16 x 16), height 3).
“Miner 4, forget what you have seen”forget_turtle_map / reference plan / 2026-09-25
“Miner 4, forget what you have seen”
  1. 01Forget what a turtle has seen (turtle 13).
“Survey the selected area in one pass, but keep out of the village from 395 -175 to 400 -171”survey / reference plan / 2026-09-25
“Survey the selected area in one pass, but keep out of the village from 395 -175 to 400 -171”
  1. 01Survey x 402..417, z -170..-155 (16 x 16) in 1 pass with 8 turtles, never digging or placing.

Programs

“Run tree-farm on Miner 5”run_program / reference plan / 2026-09-25
“Run tree-farm on Miner 5”
  1. 01Run tree-farm on Miner 5.
“Run my sort program on all idle turtles”run_program / reference plan / 2026-09-25
“Run my sort program on all idle turtles”
  1. 01Run sort.
“Split the selected area across 3 turtles running wheat”run_program / reference plan / 2026-09-25
“Split the selected area across 3 turtles running wheat”
  1. 01Run wheat over x 402..417, z -170..-155 (16 x 16).
“Write a program that farms sugar cane forever”write_program / reference plan / 2026-09-25
“Write a program that farms sugar cane forever”
  1. 01No built-in action fits, so the AI writes a program for: A program that farms sugar cane forever: harvest cane above the bottom block along a row, wait, repeat.
“I need a program that sorts items by mod into different chests”write_program / reference plan / 2026-09-25
“I need a program that sorts items by mod into different chests”
  1. 01No built-in action fits, so the AI writes a program for: A program that sorts items from an input chest into one chest per mod namespace.
“Dig a 1 wide 2 high tunnel 10 blocks ahead of Miner 2 and come back”run_code / with verified code / reference plan / 2026-09-25
“Dig a 1 wide 2 high tunnel 10 blocks ahead of Miner 2 and come back”
  1. 01Run "tunnel 10" on Miner 2, checked in a dry run (it dug 20, placed 0, used 22 fuel).

Dry run on the real turtle program: finished, dug 20, placed 0, fuel used 22. Loads in CC:Tweaked's Lua.

ex-pr10.lualua
-- A 1 wide, 2 high tunnel straight ahead, then back to the start.local LENGTH = 10td.setHome()local dug = 0for i = 1, LENGTH do  local ok, err = td.digMove("forward")  if not ok then print("Stopped after " .. dug .. " blocks: " .. tostring(err)) break end  if turtle.detectUp() then turtle.digUp() end  dug = dug + 1endprint("Tunnel " .. dug .. " long")assert(td.goHome({ dig = false }))
“Clear a 3x3x3 room in front of Miner 2 and come back”run_code / with verified code / reference plan / 2026-09-25
“Clear a 3x3x3 room in front of Miner 2 and come back”
  1. 01Run "clear a room" on Miner 2, checked in a dry run (it dug 27, placed 0, used 56 fuel).

Dry run on the real turtle program: finished, dug 27, placed 0, fuel used 56. Loads in CC:Tweaked's Lua.

ex-pr11.lualua
-- Clear a 3 x 3 x 3 room ahead of the turtle (it stands just outside it), then come back.local W, L, H = 3, 3, 3td.setHome()local home = td.pos()td.run("Clear a room", {}, function(check)  for layer = 0, H - 1 do    for row = 1, L do      for col = 0, W - 1 do        check()        -- the cell in front of the start, `row` blocks ahead, `col` to the right, `layer` up        local dx = ({ [0] = 0, 1, 0, -1 })[home.facing] * row + ({ [0] = 1, 0, -1, 0 })[home.facing] * col        local dz = ({ [0] = -1, 0, 1, 0 })[home.facing] * row + ({ [0] = 0, 1, 0, -1 })[home.facing] * col        assert(td.digTo(home.x + dx, home.y + layer, home.z + dz))      end    end  endend)
“Build a 5x5 cobblestone platform next to Miner 2”run_code / with verified code / reference plan / 2026-09-25
“Build a 5x5 cobblestone platform next to Miner 2”
  1. 01Run "cobblestone platform" on Miner 2, checked in a dry run (it dug 0, placed 25, used 38 fuel).

Dry run on the real turtle program: finished, dug 0, placed 25, fuel used 38. Loads in CC:Tweaked's Lua.

ex-pr12.lualua
-- A 5 x 5 cobblestone platform one block above the ground, behind the turtle, then back to the start.local SIZE, BLOCK = 5, "minecraft:cobblestone"td.setHome()local start = td.pos()local function selectBlock()  for s = 1, 16 do local d = turtle.getItemDetail(s) if d and d.name == BLOCK then turtle.select(s) return true end end  return falseendlocal placed = 0td.face((start.facing + 2) % 4) -- behind is openassert(td.digMove("forward")) -- off the start spot, so the platform never covers itassert(td.digMove("up"))for row = 1, SIZE do  for col = 1, SIZE do    if not selectBlock() then print("Out of " .. BLOCK) break end    if turtle.placeDown() then placed = placed + 1 end    if col < SIZE then assert(td.digMove("forward")) end  end  if row < SIZE then    local turn = row % 2 == 1 and turtle.turnRight or turtle.turnLeft    turn() assert(td.digMove("forward")) turn()  endendprint("Placed " .. placed .. " blocks")assert(td.goHome({ dig = false }))
“Walk back from Miner 3 and set a torch every 4 blocks, 5 torches”run_code / with verified code / reference plan / 2026-09-25
“Walk back from Miner 3 and set a torch every 4 blocks, 5 torches”
  1. 01Run "torch line" on Miner 3, checked in a dry run (it dug 0, placed 5, used 44 fuel).

Dry run on the real turtle program: finished, dug 0, placed 5, fuel used 44. Loads in CC:Tweaked's Lua.

ex-pr13.lualua
-- Walk backwards along open ground and set a torch every 4 blocks, 5 torches, then come back.local COUNT, GAP = 5, 4td.setHome()local function selectTorch()  for s = 1, 16 do local d = turtle.getItemDetail(s) if d and d.name == "minecraft:torch" then turtle.select(s) return true end endendtd.face((td.pos().facing + 2) % 4)assert(td.digMove("up"))local set = 0for i = 1, COUNT do  for _ = 1, GAP do assert(td.digMove("forward")) end  if not selectTorch() then print("No torches left") break end  if turtle.placeDown() then set = set + 1 endendprint("Set " .. set .. " torches")assert(td.goHome({ dig = false }))
“Have Scout build a 6 high cobblestone pillar and come back down”run_code / with verified code / reference plan / 2026-09-25
“Have Scout build a 6 high cobblestone pillar and come back down”
  1. 01Run "pillar" on Scout, checked in a dry run (it dug 0, placed 6, used 20 fuel).
  2. 02Run "pillar" on Scout.

Dry run on the real turtle program: finished, dug 0, placed 6, fuel used 20. Loads in CC:Tweaked's Lua.

ex-pr14.lualua
-- Build a 6 high cobblestone pillar under the turtle while climbing, then climb back down beside it and go home.local HEIGHT = 6td.setHome()local function selectCobble()  for s = 1, 16 do local d = turtle.getItemDetail(s) if d and d.name == "minecraft:cobblestone" then turtle.select(s) return true end endendtd.face((td.pos().facing + 2) % 4)assert(td.digMove("forward")) -- step off the home chest spotlocal built = 0for i = 1, HEIGHT do  assert(td.digMove("up"))  if selectCobble() and turtle.placeDown() then built = built + 1 endendprint("Pillar " .. built .. " high")assert(td.digMove("forward"))assert(td.goHome({ dig = false }))
“Build a wall of oak planks 5 long and 3 high next to Miner 4”run_code / with verified code / reference plan / 2026-09-25
“Build a wall of oak planks 5 long and 3 high next to Miner 4”
  1. 01Run "plank wall" on Miner 4, checked in a dry run (it dug 0, placed 15, used 24 fuel).

Dry run on the real turtle program: finished, dug 0, placed 15, fuel used 24. Loads in CC:Tweaked's Lua.

ex-pr15.lualua
-- A 5 long, 3 high wall of oak planks to the turtle's right side, built from behind it, then home.local LENGTH, HEIGHT, BLOCK = 5, 3, "minecraft:oak_planks"td.setHome()local start = td.pos()local function selectBlock()  for s = 1, 16 do local d = turtle.getItemDetail(s) if d and d.name == BLOCK then turtle.select(s) return true end endendtd.face((start.facing + 2) % 4) -- open ground behindassert(td.digMove("forward"))local placed = 0for h = 1, HEIGHT do  for i = 1, LENGTH do    turtle.turnRight()    if selectBlock() and turtle.place() then placed = placed + 1 end    turtle.turnLeft()    if i < LENGTH then assert(td.digMove("forward")) end  end  if h < HEIGHT then assert(td.digMove("up")) turtle.turnLeft() turtle.turnLeft() endendprint("Placed " .. placed .. " planks")assert(td.goHome({ dig = false }))
“Build a 10 block plank bridge 3 blocks up with Miner 2”run_code / with verified code / reference plan / 2026-09-25
“Build a 10 block plank bridge 3 blocks up with Miner 2”
  1. 01Run "plank bridge" on Miner 2, checked in a dry run (it dug 0, placed 10, used 28 fuel).

Dry run on the real turtle program: finished, dug 0, placed 10, fuel used 28. Loads in CC:Tweaked's Lua.

ex-pr16.lualua
-- A 10 long plank bridge, 3 blocks above the ground, heading away from the hill, then back.local LENGTH, RISE = 10, 3td.setHome()local function selectPlanks()  for s = 1, 16 do local d = turtle.getItemDetail(s) if d and d.name == "minecraft:oak_planks" then turtle.select(s) return true end endendtd.face((td.pos().facing + 2) % 4)for _ = 1, RISE do assert(td.digMove("up")) endlocal laid = 0for i = 1, LENGTH do  assert(td.digMove("forward"))  if selectPlanks() and turtle.placeDown() then laid = laid + 1 endendprint("Bridge of " .. laid .. " planks")assert(td.goHome({ dig = false }))
“Have Scout patrol a 6x6 square once without digging and come home”run_code / with verified code / reference plan / 2026-09-25
“Have Scout patrol a 6x6 square once without digging and come home”
  1. 01Run "patrol" on Scout, checked in a dry run (it dug 0, placed 0, used 26 fuel).
  2. 02Run "patrol" on Scout.

Dry run on the real turtle program: finished, dug 0, placed 0, fuel used 26. Loads in CC:Tweaked's Lua.

ex-pr17.lualua
-- Walk a 6 x 6 square behind the turtle once, looking around at each corner, never digging, then home.local SIDE = 6td.setHome()local h = td.pos()local back = (h.facing + 2) % 4local DX, DZ = { [0] = 0, 1, 0, -1 }, { [0] = -1, 0, 1, 0 }local right = (back + 1) % 4local corners = {  { h.x + DX[back] * SIDE, h.z + DZ[back] * SIDE },  { h.x + DX[back] * SIDE + DX[right] * SIDE, h.z + DZ[back] * SIDE + DZ[right] * SIDE },  { h.x + DX[right] * SIDE, h.z + DZ[right] * SIDE },}for i, c in ipairs(corners) do  local ok, err = td.goTo(c[1], h.y, c[2], { dig = false })  if not ok then print("Could not reach corner " .. i .. ": " .. tostring(err)) break end  print(("Corner %d at %d %d %d"):format(i, c[1], h.y, c[2]))endassert(td.goHome({ dig = false }))
“Miner 1, empty everything except fuel into the chest under your home”run_code / with verified code / reference plan / 2026-09-25
“Miner 1, empty everything except fuel into the chest under your home”
  1. 01Run "unload at home" on Miner 1, checked in a dry run (it dug 0, placed 0, used 2 fuel).

Dry run on the real turtle program: finished, dug 0, placed 0, fuel used 2. Loads in CC:Tweaked's Lua.

ex-pr18.lualua
-- Empty everything but the fuel into the chest under the turtle's home spot.if td.home() then assert(td.goHome({ dig = false })) end -- no home: the chest is under the turtle alreadylocal kept, moved = 0, 0for s = 1, 16 do  local d = turtle.getItemDetail(s)  if d then    turtle.select(s)    if d.name == "minecraft:coal" or d.name == "minecraft:charcoal" then kept = kept + d.count    elseif turtle.dropDown() then moved = moved + d.count end  endendturtle.select(1)print(("Put %d items in the chest, kept %d fuel"):format(moved, kept))
“Miner 1, take coal from the chest under your home and refuel to 2000”run_code / with verified code / reference plan / 2026-09-25
“Miner 1, take coal from the chest under your home and refuel to 2000”
  1. 01Run "refuel at home" on Miner 1, checked in a dry run (it dug 0, placed 0, used 2 fuel).

Dry run on the real turtle program: finished, dug 0, placed 0, fuel used 2. Loads in CC:Tweaked's Lua.

ex-pr19.lualua
-- Take coal from the chest under home and burn it up to 2000 fuel.local TARGET = 2000if td.home() then assert(td.goHome({ dig = false })) end -- no home: the chest is under the turtle alreadylocal ok, why = td.takeFuel and td.takeFuel(TARGET) or td.refuel(TARGET)print("Fuel is now " .. tostring(turtle.getFuelLevel()) .. (ok and "" or (" (" .. tostring(why) .. ")")))
“Dig a staircase 5 steps down in front of Miner 2 and come back up”run_code / with verified code / reference plan / 2026-09-25
“Dig a staircase 5 steps down in front of Miner 2 and come back up”
  1. 01Run "stairs down" on Miner 2, checked in a dry run (it dug 15, placed 0, used 22 fuel).

Dry run on the real turtle program: finished, dug 15, placed 0, fuel used 22. Loads in CC:Tweaked's Lua.

ex-pr20.lualua
-- Dig a staircase 5 steps down ahead, with headroom, then climb back up and go home.local STEPS = 5td.setHome()for i = 1, STEPS do  assert(td.digMove("forward"))  if turtle.detectUp() then turtle.digUp() end  assert(td.digMove("down"))endprint("Staircase " .. STEPS .. " steps down")assert(td.goHome({ dig = "fallback" }))
“Tunnel 12 blocks ahead with Miner 2 and mine every ore vein it touches, then come back”run_code / with verified code / reference plan / 2026-09-25
“Tunnel 12 blocks ahead with Miner 2 and mine every ore vein it touches, then come back”
  1. 01Run "vein miner" on Miner 2, checked in a dry run (it dug 13, placed 0, used 28 fuel).

Dry run on the real turtle program: finished, dug 13, placed 0, fuel used 28. Loads in CC:Tweaked's Lua.

ex-pr21.lualua
-- Tunnel 12 blocks ahead and mine every ore vein the tunnel touches (up to 48 ore blocks), then come back.local LENGTH, MAX = 12, 48td.setHome()local mined = 0local function oreAt(dir)  local ok, data  if dir == "up" then ok, data = turtle.inspectUp() elseif dir == "down" then ok, data = turtle.inspectDown() else ok, data = turtle.inspect() end  return ok and data.name:find("_ore", 1, true) ~= nilendlocal back = { up = "down", down = "up" }local function vein(depth)  if mined >= MAX or depth > 6 then return end  for _, dir in ipairs({ "up", "down" }) do    if oreAt(dir) and td.digMove(dir) then mined = mined + 1 vein(depth + 1) assert(td.digMove(back[dir])) end  end  for _ = 1, 4 do    if oreAt("forward") and td.digMove("forward") then      mined = mined + 1      vein(depth + 1)      turtle.turnLeft() turtle.turnLeft() assert(td.digMove("forward")) turtle.turnLeft() turtle.turnLeft()    end    turtle.turnRight()  endendfor i = 1, LENGTH do  local ok, err = td.digMove("forward")  if not ok then print("Tunnel stopped: " .. tostring(err)) break end  vein(0)endprint("Mined " .. mined .. " ore blocks along a " .. LENGTH .. " block tunnel")assert(td.goHome({ dig = "fallback" }))
“Chop the tree in front of Miner 5”run_code / with verified code / reference plan / 2026-09-25
“Chop the tree in front of Miner 5”
  1. 01Run "chop a tree" on Miner 5, checked in a dry run (it dug 0, placed 0, used 2 fuel).

Dry run on the real turtle program: finished, dug 0, placed 0, fuel used 2. Loads in CC:Tweaked's Lua.

ex-pr22.lualua
-- Chop the tree in front: the trunk up as high as it goes, then back down and home. Nothing to chop: says so.td.setHome()local ok, data = turtle.inspect()if not (ok and data.name:find("log", 1, true)) then print("No tree in front") return endassert(td.digMove("forward"))local height = 0while true do  local up, above = turtle.inspectUp()  if not (up and above.name:find("log", 1, true)) then break end  assert(td.digMove("up"))  height = height + 1endprint("Chopped a trunk " .. (height + 1) .. " high")assert(td.goHome({ dig = false }))
“Harvest the row of 8 sugar cane to the right of Miner 6”run_code / with verified code / reference plan / 2026-09-25
“Harvest the row of 8 sugar cane to the right of Miner 6”
  1. 01Run "harvest cane" on Miner 6, checked in a dry run (it dug 0, placed 0, used 18 fuel).

Dry run on the real turtle program: finished, dug 0, placed 0, fuel used 18. Loads in CC:Tweaked's Lua.

ex-pr23.lualua
-- Walk a row of 8 sugar cane beside the turtle (to its right) and cut every cane above the bottom block.local LENGTH = 8td.setHome()local cut = 0td.face((td.pos().facing + 2) % 4)assert(td.digMove("up"))for i = 1, LENGTH do  turtle.turnRight()  local ok, data = turtle.inspect()  if ok and data.name == "minecraft:sugar_cane" and turtle.dig() then cut = cut + 1 end  turtle.turnLeft()  if i < LENGTH then assert(td.digMove("forward")) endendprint("Cut " .. cut .. " sugar cane")assert(td.goHome({ dig = false }))
“Bore a 1x1 shaft 12 blocks down next to Miner 2 and come back up”run_code / with verified code / reference plan / 2026-09-25
“Bore a 1x1 shaft 12 blocks down next to Miner 2 and come back up”
  1. 01Run "shaft" on Miner 2, checked in a dry run (it dug 12, placed 0, used 28 fuel).

Dry run on the real turtle program: finished, dug 12, placed 0, fuel used 28. Loads in CC:Tweaked's Lua.

ex-pr24.lualua
-- Bore a 1x1 shaft 12 blocks straight down, then climb back up and go home.local DEPTH = 12td.setHome()local start = td.pos()td.face((start.facing + 2) % 4)assert(td.digMove("forward"))local down = 0for i = 1, DEPTH do  local ok, err = td.digMove("down")  if not ok then print("Stopped at " .. down .. ": " .. tostring(err)) break end  down = down + 1endprint("Shaft " .. down .. " deep")assert(td.goHome({ dig = "fallback" }))
“Print what Miner 1 carries, slot by slot”run_code / with verified code / reference plan / 2026-09-25
“Print what Miner 1 carries, slot by slot”
  1. 01Run "inventory report" on Miner 1, checked in a dry run (it dug 0, placed 0, used 2 fuel).

Dry run on the real turtle program: finished, dug 0, placed 0, fuel used 2. Loads in CC:Tweaked's Lua.

ex-pr25.lualua
-- Print what the turtle carries, slot by slot, with totals per item and its fuel.local totals = {}for s = 1, 16 do  local d = turtle.getItemDetail(s)  if d then    print(("slot %2d: %d %s"):format(s, d.count, d.name))    totals[d.name] = (totals[d.name] or 0) + d.count  endendfor name, n in pairs(totals) do print(name .. ": " .. n) endprint("Fuel: " .. tostring(turtle.getFuelLevel()) .. " / " .. tostring(turtle.getFuelLimit()) .. ", free slots: " .. td.emptySlots())
“Have Scout look in every direction and say what is there”run_code / with verified code / reference plan / 2026-09-25
“Have Scout look in every direction and say what is there”
  1. 01Run "look around" on Scout, checked in a dry run (it dug 0, placed 0, used 2 fuel).
  2. 02Run "look around" on Scout.

Dry run on the real turtle program: finished, dug 0, placed 0, fuel used 2. Loads in CC:Tweaked's Lua.

ex-pr26.lualua
-- Look in every direction and say what is there.local names = { [0] = "north", "east", "south", "west" }for i = 1, 4 do  local ok, data = turtle.inspect()  print(names[td.pos().facing] .. ": " .. (ok and data.name or "air"))  turtle.turnRight()endlocal up, a = turtle.inspectUp()local down, b = turtle.inspectDown()print("up: " .. (up and a.name or "air") .. ", down: " .. (down and b.name or "air"))
“Merge the partial stacks in Miner 1 with a small program”run_code / with verified code / reference plan / 2026-09-25
“Merge the partial stacks in Miner 1 with a small program”
  1. 01Run "stack items" on Miner 1, checked in a dry run (it dug 0, placed 0, used 2 fuel).

Dry run on the real turtle program: finished, dug 0, placed 0, fuel used 2. Loads in CC:Tweaked's Lua.

ex-pr27.lualua
-- Merge partial stacks so the inventory has as many free slots as possible.local before = td.emptySlots()for a = 16, 2, -1 do  local da = turtle.getItemDetail(a)  if da then    for b = 1, a - 1 do      local db = turtle.getItemDetail(b)      if db and db.name == da.name and turtle.getItemSpace(b) > 0 then        turtle.select(a)        turtle.transferTo(b)        if turtle.getItemCount(a) == 0 then break end      end    end  endendturtle.select(1)print(("Free slots: %d before, %d after"):format(before, td.emptySlots()))
“Send three 2 second redstone pulses out of the back of Scout”run_code / with verified code / reference plan / 2026-09-25
“Send three 2 second redstone pulses out of the back of Scout”
  1. 01Run "redstone pulses" on Scout, checked in a dry run (it dug 0, placed 0, used 2 fuel).
  2. 02Run "redstone pulses" on Scout.

Dry run on the real turtle program: finished, dug 0, placed 0, fuel used 2. Loads in CC:Tweaked's Lua.

ex-pr28.lualua
-- Send a 2 second redstone pulse out of the back (a door, a lamp), three times, a second apart.for i = 1, 3 do  redstone.setOutput("back", true)  sleep(2)  redstone.setOutput("back", false)  sleep(1)endprint("Sent 3 pulses")
“When Miner 2 gets a redstone signal on its back, dig 4 blocks ahead and come back”run_code / with verified code / reference plan / 2026-09-25
“When Miner 2 gets a redstone signal on its back, dig 4 blocks ahead and come back”
  1. 01Run "dig on a signal" on Miner 2, checked in a dry run (it dug 0, placed 0, used 2 fuel).

Dry run on the real turtle program: running, dug 0, placed 0, fuel used 2. Loads in CC:Tweaked's Lua.

ex-pr29.lualua
-- Wait for a redstone signal on the back, then dig a 1 x 1 tunnel 4 blocks ahead and come back. Once.td.setHome()print("Waiting for a redstone signal on the back")repeat os.pullEvent("redstone") until redstone.getInput("back")for i = 1, 4 do assert(td.digMove("forward")) endprint("Dug 4 blocks")assert(td.goHome({ dig = false }))
“Walk to the edge of a 7x7 box around Miner 4 without leaving it or breaking glass or farmland”run_code / with verified code / reference plan / 2026-09-25
“Walk to the edge of a 7x7 box around Miner 4 without leaving it or breaking glass or farmland”
  1. 01Run "fenced walk" on Miner 4, checked in a dry run (it dug 0, placed 0, used 8 fuel).

Dry run on the real turtle program: finished, dug 0, placed 0, fuel used 8. Loads in CC:Tweaked's Lua.

ex-pr30.lualua
-- Work only inside a 7 x 7 box around the start, never breaking glass or farmland: walk its edge, then home.td.setHome()local h = td.pos()if td.fence then td.fence({ within = { h.x - 3, h.y - 2, h.z - 3, h.x + 3, h.y + 2, h.z + 3 } }) endif td.protect then td.protect({ "glass", "farmland" }) endlocal DX, DZ = { [0] = 0, 1, 0, -1 }, { [0] = -1, 0, 1, 0 }local back = (h.facing + 2) % 4local ok, err = td.goTo(h.x + DX[back] * 3, h.y, h.z + DZ[back] * 3, { dig = false })print(ok and "Reached the edge of the box" or ("Stopped: " .. tostring(err)))local out = td.goTo(h.x + DX[back] * 6, h.y, h.z + DZ[back] * 6, { dig = false })print(out and "Left the box (should not happen)" or "Stayed inside the box")assert(td.goHome({ dig = false }))
“Show fuel and position on the monitor attached to Scout”run_code / with verified code / reference plan / 2026-09-25
“Show fuel and position on the monitor attached to Scout”
  1. 01Run "status screen" on Scout, checked in a dry run (it dug 0, placed 0, used 2 fuel).
  2. 02Run "status screen" on Scout.

Dry run on the real turtle program: finished, dug 0, placed 0, fuel used 2. Loads in CC:Tweaked's Lua.

ex-pr31.lualua
-- Show fuel and position on an attached monitor (mirrored on the map), refreshed 5 times a second apart.local mon = peripheral.find("monitor")if not mon then print("No monitor attached: nothing to draw on") return endlocal win = td.mirrorMonitor and td.mirrorMonitor(mon) or monfor i = 1, 5 do  local p = td.pos()  win.clear()  win.setCursorPos(1, 1) win.write("Fuel: " .. tostring(turtle.getFuelLevel()))  win.setCursorPos(1, 2) win.write(("At %d %d %d"):format(p.x, p.y, p.z))  sleep(1)end
“Build a 3x3 plank hut with a roof behind Miner 2”run_code / with verified code / reference plan / 2026-09-25
“Build a 3x3 plank hut with a roof behind Miner 2”
  1. 01Run "plank hut" on Miner 2, checked in a dry run (it dug 0, placed 25, used 46 fuel).

Dry run on the real turtle program: finished, dug 0, placed 25, fuel used 46. Loads in CC:Tweaked's Lua.

ex-pr32.lualua
-- A 3 x 3 plank hut, 2 walls high with a roof, built behind the turtle with td.build, then home.local bp = {  palette = { P = "minecraft:oak_planks" },  layers = {    { "PPP", "P.P", "PPP" },    { "PPP", "P.P", "PPP" },    { "PPP", "PPP", "PPP" },  },}td.setHome()td.face((td.pos().facing + 2) % 4)assert(td.digMove("forward"))local ok, why = td.build(bp, { name = "Hut" })print(ok and "Hut built" or ("Build stopped: " .. tostring(why)))td.goHome({ dig = false })
“Dig a 3x3 hole 3 deep behind Miner 2 with the hole job and come back”run_code / with verified code / reference plan / 2026-09-25
“Dig a 3x3 hole 3 deep behind Miner 2 with the hole job and come back”
  1. 01Run "small hole" on Miner 2, checked in a dry run (it dug 27, placed 0, used 20 fuel).

Dry run on the real turtle program: finished, dug 27, placed 0, fuel used 20. Loads in CC:Tweaked's Lua.

ex-pr33.lualua
-- Dig a 3 x 3 hole 3 deep with the built-in hole job (the turtle is its near-left top corner), then home.td.setHome()td.face((td.pos().facing + 2) % 4)assert(td.digMove("forward"))local ok, why = td.mine.hole({ width = 3, length = 3, depth = 3 })print(ok and "Hole dug" or ("Hole stopped: " .. tostring(why)))assert(td.goHome({ dig = "fallback" }))
“Have Scout tell me its position, its GPS fix and its home”run_code / with verified code / reference plan / 2026-09-25
“Have Scout tell me its position, its GPS fix and its home”
  1. 01Run "where am i" on Scout, checked in a dry run (it dug 0, placed 0, used 2 fuel).
  2. 02Run "where am i" on Scout.

Dry run on the real turtle program: finished, dug 0, placed 0, fuel used 2. Loads in CC:Tweaked's Lua.

ex-pr34.lualua
-- Say where the turtle is: its own count, and GPS when a constellation answers.local p = td.pos()print(("I think I am at %d %d %d facing %d"):format(p.x, p.y, p.z, p.facing))local x, y, z = gps.locate(2)if x then print(("GPS says %d %d %d"):format(math.floor(x + 0.5), math.floor(y + 0.5), math.floor(z + 0.5))) else print("No GPS fix") endlocal h = td.home()print(h and ("Home is %d %d %d"):format(h.x, h.y, h.z) or "No home set")
“Dig 8 blocks ahead with Miner 2, dropping junk when it gets full, then come back”run_code / with verified code / reference plan / 2026-09-25
“Dig 8 blocks ahead with Miner 2, dropping junk when it gets full, then come back”
  1. 01Run "tunnel, junk dropped" on Miner 2, checked in a dry run (it dug 8, placed 0, used 18 fuel).

Dry run on the real turtle program: finished, dug 8, placed 0, fuel used 18. Loads in CC:Tweaked's Lua.

ex-pr35.lualua
-- Dig 8 blocks forward, dropping cobblestone, dirt and gravel whenever fewer than 3 slots are free, then back.td.setHome()for i = 1, 8 do  if td.emptySlots() < 3 then td.dropJunk() end  local ok, err = td.digMove("forward")  if not ok then print("Stopped: " .. tostring(err)) break endendtd.dropJunk()print("Free slots: " .. td.emptySlots())assert(td.goHome({ dig = false }))

Mining and digging

“Quarry the selected area 6 deep”quarry / reference plan / 2026-09-25
“Quarry the selected area 6 deep”
  1. 01Quarry x 402..417, z -170..-155 (16 x 16), 6 blocks deep, with 8 turtles.
“Dig out a 16x16 area centred on 410 69 -160, 10 deep, with 4 turtles”quarry / reference plan / 2026-09-25
“Dig out a 16x16 area centred on 410 69 -160, 10 deep, with 4 turtles”
  1. 01Quarry x 403..418, z -167..-152 (16 x 16), 10 blocks deep, with 4 turtles.
“Excavate the selection down 20 blocks and drop the junk”quarry / reference plan / 2026-09-25
“Excavate the selection down 20 blocks and drop the junk”
  1. 01Quarry x 402..417, z -170..-155 (16 x 16), 20 blocks deep, with 8 turtles.
“Dig a 5x5 hole 8 deep at the selected block”hole / reference plan / 2026-09-25
“Dig a 5x5 hole 8 deep at the selected block”
  1. 01Hole from 405 69 -160 heading north, 5 long, 5 wide, 8 deep.
“Strip mine the selected area heading north”strip / reference plan / 2026-09-25
“Strip mine the selected area heading north”
  1. 01Strip mine x 402..417, z -170..-155 (16 x 16) heading north, with 8 turtles.
“Strip mine 40 below the surface across the selection with 3 turtles”strip / reference plan / 2026-09-25
“Strip mine 40 below the surface across the selection with 3 turtles”
  1. 01Strip mine x 402..417, z -170..-155 (16 x 16) heading north, 40 blocks down, with 3 turtles.
“Mine for diamonds under the selected area with 4 turtles”mine_ore / reference plan / 2026-09-25
“Mine for diamonds under the selected area with 4 turtles”
  1. 01Mine for diamond under x 402..417, z -170..-155 (16 x 16) heading north, with 4 turtles.
“Send two turtles to mine iron heading east under the selection”mine_ore / reference plan / 2026-09-25
“Send two turtles to mine iron heading east under the selection”
  1. 01Mine for iron under x 402..417, z -170..-155 (16 x 16) heading east, with 2 turtles.
“Dig a 2x2 tunnel 50 long heading west from the selected block”tunnel / reference plan / 2026-09-25
“Dig a 2x2 tunnel 50 long heading west from the selected block”
  1. 01Tunnel from 405 69 -160 heading west, 50 long, 2 wide and 2 high.
“Tunnel 100 blocks north from 400 40 -150 with torches every 8”tunnel / reference plan / 2026-09-25
“Tunnel 100 blocks north from 400 40 -150 with torches every 8”
  1. 01Tunnel from 400 40 -150 heading north, 100 long, 1 wide and 2 high.
“Dig stairs down 30 steps from the selected block heading south”stairs / reference plan / 2026-09-25
“Dig stairs down 30 steps from the selected block heading south”
  1. 01Stairs down from 405 69 -160 heading south, 30 steps.
“Make a staircase 20 steps up facing east from 405 60 -160”stairs / reference plan / 2026-09-25
“Make a staircase 20 steps up facing east from 405 60 -160”
  1. 01Stairs up from 405 60 -160 heading east, 20 steps.
“Clear the trees in the selected area”clear_above / reference plan / 2026-09-25
“Clear the trees in the selected area”
  1. 01Clear everything above the ground in x 402..417, z -170..-155 (16 x 16), 6 high, with 8 turtles.
“Flatten everything above the ground in the selection, 10 high”clear_above / reference plan / 2026-09-25
“Flatten everything above the ground in the selection, 10 high”
  1. 01Clear everything above the ground in x 402..417, z -170..-155 (16 x 16), 10 high, with 8 turtles.
“Miner 2, break the block above you”dig / reference plan / 2026-09-25
“Miner 2, break the block above you”
  1. 01Break one block (turtle 11, direction up).
“Scout, attack whatever is in front”attack / reference plan / 2026-09-25
“Scout, attack whatever is in front”
  1. 01Attack (turtle 40, direction forward).
“Miner 3, clear the gravel above it”clear_falling / reference plan / 2026-09-25
“Miner 3, clear the gravel above it”
  1. 01Clear falling gravel or sand (turtle 12, direction up).
“Forget where the mines stopped”forget_progress / reference plan / 2026-09-25
“Forget where the mines stopped”
  1. 01Forget mining progress (turtles all).
“Quarry the selected area 6 deep, leave Miner 1 out, and stay there afterwards”quarry / reference plan / 2026-09-25
“Quarry the selected area 6 deep, leave Miner 1 out, and stay there afterwards”
  1. 01Quarry x 402..417, z -170..-155 (16 x 16), 6 blocks deep, with 7 turtles. The turtles stay where they finish. Miner 1 is left out.
“Quarry the selected area 5 deep, but do not break any glass”quarry / reference plan / 2026-09-25
“Quarry the selected area 5 deep, but do not break any glass”
  1. 01Quarry x 402..417, z -170..-155 (16 x 16), 5 blocks deep, with 8 turtles.

Questions

“How many diamonds do I have?”question / reference plan / 2026-09-26
“How many diamonds do I have?”

You have 32 diamonds in storage, 41 counting other forms (blocks, raw ore). Miner 1 carries 3 more.

“How much iron is in storage?”question / reference plan / 2026-09-26
“How much iron is in storage?”

In storage: 140 iron ingots (212 counting other forms).

“Which turtles are low on fuel?”question / reference plan / 2026-09-26
“Which turtles are low on fuel?”

6 turtles are under 25% fuel: Crafty (0%), Crafty 2 (0%), Digger (1%), Miner 1 (4%), Miner 2 (7%) and Miner 3 (20%).

“Where is Scout?”question / reference plan / 2026-09-26
“Where is Scout?”

Scout is at 450 72 -120 (idle).

“What is Miner 1 carrying?”question / reference plan / 2026-09-25
“What is Miner 1 carrying?”

Miner 1 carries 12 coal, 3 diamonds and 20 raw iron.

“How many turtles do I have?”question / reference plan / 2026-09-26
“How many turtles do I have?”

You have 11 turtles: 10 online (8 idle, 1 busy, 1 crafting) and 1 offline. The online ones have 31% fuel on average.

“Which turtles are idle?”question / reference plan / 2026-09-26
“Which turtles are idle?”

8 idle turtles: Crafty 2, Miner 1, Miner 2, Miner 3, Miner 4, Miner 5, Miner 6 and Scout.

“Which turtle has diamonds on it?”question / reference plan / 2026-09-26
“Which turtle has diamonds on it?”

Carrying diamond: Miner 1 (3).

“Is anyone within 20 blocks of the fuel chest?”question / reference plan / 2026-09-25
“Is anyone within 20 blocks of the fuel chest?”

Yes: the six miners are within 20 blocks of it.

“How far is Miner 1 from the fuel chest?”question / reference plan / 2026-09-26
“How far is Miner 1 from the fuel chest?”

From Miner 1 to the fuel chest (411 71 -158): 20 blocks walking, 14 in a straight line; the trip takes about 25 fuel.

“What kinds of wood do I have?”question / reference plan / 2026-09-26
“What kinds of wood do I have?”

2 kinds in storage match "oak": 96 oak logs and 21 oak saplings.

“What is filling up my storage?”question / reference plan / 2026-09-26
“What is filling up my storage?”

Most stored: cobblestone 4200, redstone 250, coal 180, iron ingot 140, oak log 96, glass 64, wheat seeds 44, diamond 32, torch 30 and oak sapling 21.

“How many chests can I craft?”question / reference plan / 2026-09-25
“How many chests can I craft?”

You could make 96 chests from what is stored.

“What is the recipe for a hopper?”question / reference plan / 2026-09-25
“What is the recipe for a hopper?”

A hopper is 5 iron ingots around a chest.

“Is the storage station online?”question / reference plan / 2026-09-25
“Is the storage station online?”

Yes, Vault is online with 2 furnaces and 1 crafty turtle.

“What blocks are in this area?”question / reference plan / 2026-09-25
“What blocks are in this area?”

Grass on top, dirt under it and stone further down: 256 columns, all mapped.

“Where is the nearest iron ore on the map?”question / reference plan / 2026-09-25
“Where is the nearest iron ore on the map?”

The nearest iron ore is at 404 55 -148.

“What block is at 415 70 -158?”question / reference plan / 2026-09-25
“What block is at 415 70 -158?”

A chest.

“How high is the ground at 405 -160?”question / reference plan / 2026-09-25
“How high is the ground at 405 -160?”

The ground there is at y 69.

“How much of the world have my turtles mapped?”question / reference plan / 2026-09-25
“How much of the world have my turtles mapped?”

About 3,355 blocks between x 395 and 430, z -175 and -140.

“What is running right now?”question / reference plan / 2026-09-26
“What is running right now?”

Running: Quarry 16 x 16 (running, 40%); Build house (running, layer 2 of 5, waiting).

“Where is the fuel chest?”question / reference plan / 2026-09-25
“Where is the fuel chest?”

The fuel chest is at 411 71 -158.

“Who is waiting at the fuel chest?”question / reference plan / 2026-09-25
“Who is waiting at the fuel chest?”

Miner 3 is at the chest; Miner 1 and Miner 2 are waiting.

“Can the turtles build things?”question / reference plan / 2026-09-25
“Can the turtles build things?”

Yes: blueprints, the storage tower, walls and floors with a program.

“Find diamonds near Miner 2”question / reference plan / 2026-09-25
“Find diamonds near Miner 2”

There is deepslate diamond ore at 410 -58 -150.

“How many turtles are online?”question / reference plan / 2026-09-25
“How many turtles are online?”

10 of your 11 turtles are online.

“Can I make 10 hoppers?”question / reference plan / 2026-09-25
“Can I make 10 hoppers?”

Yes: up to 23 hoppers can be made from what is stored.

Storage and crafting

“Deliver 64 torches to the output chest”deliver / reference plan / 2026-09-25
“Deliver 64 torches to the output chest”
  1. 01Deliver 64 torch to the output chest.
“Give Miner 2 32 coal”deliver / reference plan / 2026-09-25
“Give Miner 2 32 coal”
  1. 01Deliver 32 coal to Miner 2.
“Send me 17 iron ingots”deliver / reference plan / 2026-09-25
“Send me 17 iron ingots”
  1. 01Deliver 17 iron ingot to you.
“Craft 16 chests”craft / reference plan / 2026-09-25
“Craft 16 chests”
  1. 01Craft 16 chest to the output chest.
“Make 4 iron pickaxes and send them to me”craft / reference plan / 2026-09-25
“Make 4 iron pickaxes and send them to me”
  1. 01Craft 4 iron pickaxe to you.
“Craft 64 torches for Miner 3”craft / reference plan / 2026-09-25
“Craft 64 torches for Miner 3”
  1. 01Craft 64 torch to Miner 3.
“Smelt 32 iron ingots and keep them in storage”smelt / reference plan / 2026-09-25
“Smelt 32 iron ingots and keep them in storage”
  1. 01Smelt 32 iron ingot, kept in storage.
“Smelt 64 glass and send it to me”smelt / reference plan / 2026-09-25
“Smelt 64 glass and send it to me”
  1. 01Smelt 64 glass to you.
“Re-index the storage”reindex_storage / reference plan / 2026-09-25
“Re-index the storage”
  1. 01Re-index the storage.
“Update the storage station”update_station / reference plan / 2026-09-25
“Update the storage station”
  1. 01Update the storage station.
“Use minecraft:chest_2 as the deposit chest and minecraft:chest_5 as the output chest”setup_station / reference plan / 2026-09-25
“Use minecraft:chest_2 as the deposit chest and minecraft:chest_5 as the output chest”
  1. 01Set the station's chests (deposit minecraft:chest_2, output minecraft:chest_5).
“Learn the recipe in Crafty's grid”learn_recipe / reference plan / 2026-09-25
“Learn the recipe in Crafty's grid”
  1. 01Learn a recipe from a crafty turtle (turtle 30).
“Save a recipe: 4 oak planks in a square make a crafting table”save_recipe / reference plan / 2026-09-25
“Save a recipe: 4 oak planks in a square make a crafting table”
  1. 01Save a recipe (output minecraft:crafting_table, count 1, kind craft, grid minecraft:oak_planks minecraft:oak_planks minecraft:oak_planks minecraft:oak_planks ).
“Delete my recipe for sticks”delete_recipe / reference plan / 2026-09-25
“Delete my recipe for sticks”
  1. 01Delete a recipe (output minecraft:stick).
“Cancel the crafting job”cancel_craft / reference plan / 2026-09-25
“Cancel the crafting job”
  1. 01Cancel a crafting job (job latest).
“Crafty, craft what is in your grid 4 times”craft_here / reference plan / 2026-09-25
“Crafty, craft what is in your grid 4 times”
  1. 01Craft with a crafty turtle's own grid (turtle 30, times 4).