extern void object::CollectTitanium2() { // 1) Variable definition. object item; // info. about objects // 2) Goes toward the titanium ore and grabs it. item = radar(TitaniumOre);// looks for titanium ore goto(item.position); // goes to the position grab(); // grabs the titanium // 3) Goes toward the converter and drops it. item = radar(Converter); // looks for converter goto(item.position); // goes to the position drop(); // drops the titanium move(-2.5); // steps back 2.5 m // 4) If power cell half empty, recharges. if ( energyCell.energyLevel < 0.5 ) { // if so: item = radar(PowerStation); // looks for station goto(item.position); // goes there wait(5); // waits } }