StarOS: crane

Part crane, 2 ports, with its own battery pack. A lift or a placing draws 3 kW. See the overview.

A place is yard:1 to yard:4 (the stop you touch), wagon:1 to wagon:10 (your train whose locomotive is at that stop) or hauler:1 (a hauler of yours that touches the robot; no stop needed).

function does
crane.lift(place) record lifting the container there into the grip
crane.place(place) record setting the gripped container down
crane.grip() {id, contents} of the gripped container, or None
crane.look(place) the same for a place, or None

The lift is applied before the placing, so one turn can move a container. A hauler deck takes at most 14 000 kg and 45 000 L, container included.

def tick():
    if crane.grip() == None and crane.look("wagon:1") != None:
        crane.lift("wagon:1")
        crane.place("yard:1")