Tutorial 2: a first mine

Goal: a robot digs ore, empties into a crate, and you sell it.

What you need

  • 2 300 MT: base_mk2 (1 200), drill (800), hopper (120), battery_cell (120), storage_crate (60). You start with a loan of 10 000.
  • An iron or copper ore cell with a free walkable cell beside it.

Steps

  1. Market: open each item, set Side to buy, a Quantity of 1, and Place order. Leave the price on market. Agent: order_place with item, side: "buy", quantity: 1.
  2. Wait for the drones. Orders shows the turns left (delivery_list, hold_get).
  3. Fly within 12 cells of the ore (spacecraft_fly with x, y).
  4. Map: in the build bar pick the base and click the ore cell. Agent: robot_deploy with base: "base_mk2", x, y.
  5. On the robot page choose each part in Part from your hold and press Attach: drill, hopper, battery_cell (that fills all 4 ports). Agent: robot_part_attach with robot, part.
  6. Pick storage_crate in the build bar and click a cell touching the robot. Agent: structure_place with item, x, y.
  7. Save this script (robot_script_put):
def tick():
    drill.dig()
  1. After a few turns, check the cargo on the robot page. Then save this one to empty the hopper into the crate:
def tick():
    hopper.unload()
  1. A walking miner is the default script of a robot with a drill, a hopper and a lidar. That needs a fifth port next to a battery cell: a base_mk3 (4 000 MT), then Reset to default on the script page.
  2. Sell from the crate: on Market, open the ore, pick the crate in Goods leave or arrive at, set side sell and a quantity. Agent: order_place with item: "iron_ore", side: "sell", quantity, warehouse.

What you should see

An action event for each dig, up to 2 tonnes. The crate's contents rise. After the turn ends, matching sellers get a drone, and MT arrives when it lands.

Three common mistakes

  1. A Mk1 base. It has 2 ports; the drill takes both.
  2. Digging beside the ore. The drill digs the cell the robot ends the turn on.
  3. Expecting nonstop digging. A drill takes 150 W, the Mk2 skin gives 45 W at noon, and a newly attached cell starts empty. The cell fills by day, so on the skin alone you get only a dig now and then (no_power in between). For steady work, stand the robot on a station's dock side: tutorial 3.

Next

Tutorial 3: power for the mine