Final Code

//Reverse all motors

reverse(4);

//Accelerate all motors from 0 to 23% power in 2 sec

celerate(4,0,23,2);

//Run all motors at 23% power.

motorSpeed(4,23);

//Go to an absolute position of -362 marks.

goToAbsolutePosition(-362);

//Reverse all motors.

reverse(4);

//Accelerate all motors from 23 to 0% power in 5 sec

celerate(4,23,0,5);

//Brake all motors

brake(4);

//Go for 7 seconds

goFor(7);

//Stop at gate

//Reverse all motors

reverse(4);

//Run all motors at 23 % power

motorSpeed(4,23);

//Go to a relative position of of -338 marks

goToRelativePosition(-338);

//Brake all motors

brake(4);

//Go for 10 seconds

goFor(10);

//Pick-up Cargo

//Reverse all motors.

reverse(4);

//Accelerate all motors from 0 to 35% power in 2 sec

celerate(4,0,35,2);

//Run all motors at 35% power

motorSpeed(4,35);

//Go to a relative position of 355.

goToRelativePosition(355);

//Brake all motors

brake(4);

//Go for 8 seconds

goFor(8);

//Stop at gate

//Accelerate all motors from 0 to 35% power in 2 sec

celerate(4,0,35,2);

//Run all motors at 35% power

motorSpeed(4,35);

//Go to a relative position of 355 marks

goToRelativePosition(355);

//Brake all motors

brake(4);