The scene from the README: a control computer with a monitor wall, four GPS hosts, and three turtles at
work. Each turtle reports what it's doing on the fleet rednet protocol, and the control computer draws
them all. Two of the programs are Rust and two are Lua. They share one protocol, so any mix works.
| Program | Language | Runs on | Does |
|---|---|---|---|
fleet-dashboard |
Rust | A computer with a monitor and a modem | Shows every turtle that reports: name, job, status, position, fuel and its tally. |
fleet-quarry |
Rust | A turtle with a pickaxe and a modem | Digs a 5 × 5 pit, 8 layers deep. Unloads into a chest behind it when full. |
tower.lua |
Lua | A turtle with a modem and building blocks | Builds a hollow 3 × 3 tower. |
lumberjack.lua |
Lua | A turtle with an axe and a modem | Walks a row of trees, felling each one. |
fleet.lua |
Lua | The Lua turtles' shared code: rednet, GPS, fuel and reporting. |
Every turtle broadcasts a table on the fleet protocol each time it makes progress:
{
name = "Digger", -- the turtle's label
job = "Quarry", -- what kind of work
status = "Layer 2 of 8",
count = 41, -- the job's own tally: blocks dug, placed, logs cut
fuel = 5230, fuelLimit = 20000,
x = 21, y = 62, z = 73, -- from GPS, if it has a fix
}The dashboard greys out a turtle it hasn't heard from in 10 seconds and drops it after 30. Add your own turtle by broadcasting the same table.
-
GPS. Build four GPS hosts within 64 blocks of where the turtles work, at different heights, and run
gps host <x> <y> <z>on each fromstartup.lua. See GPS. -
Build the Rust programs.
cd guest cargo build --release --target wasm32-unknown-unknown -p fleet-dashboard -p fleet-quarry -
The control computer. Attach a wireless modem and a monitor (the scene uses 5 × 4 blocks). Copy
fleet_dashboard.wasminto its folder and give it astartup.lua:shell.run("wasm", "fleet_dashboard.wasm")
-
The quarry. A turtle with a pickaxe and a wireless modem (craft a Mining Turtle, then
equipa modem on its other side), coal in its inventory, and a chest behind it. Copyfleet_quarry.wasminto its folder, label it, and start it the same way. -
The Lua turtles. Copy
fleet.luaandtower.luaorlumberjack.luainto each turtle's folder, give it fuel (and blocks, for the tower), and start it fromstartup.lua:shell.run("tower", 12)
Turtle folders are wasmcraft/computer/<id>/ in the world; run id on a turtle to find its ID.
Start with fleet-quarry. It's the kind of program that
earns Rust: it keeps its own position and heading, reasons about fuel against the distance home, leaves
the pit and comes back to the exact spot, and reports world coordinates without a GPS round trip on
every step. tower.lua is the opposite end: twenty-five lines you could type at the
terminal.
