See below
public class AutoAim extends NeverEndingCommand{
public String currentCommand = new FaceNorthAimCenter().getName();
protected void initialize() {
}
protected void execute() {
if(Bob.dt.isFacingEast() &&
! currentCommand.equalsIgnoreCase(new FaceEast().getName())){
currentCommand = new FaceEast().getName();
new FaceEast().start();
}else if (Bob.dt.isFacingWest() &&
!currentCommand.equalsIgnoreCase(new FaceWest().getName())){
currentCommand = new FaceWest().getName();
new FaceWest().start();
}else if(!currentCommand.equalsIgnoreCase(new FaceNorthAimCenter().getName())){
currentCommand = new FaceNorthAimCenter().getName();
new FaceNorthAimCenter().start();
}else{
//do nothing, the right command is alreay executing
}
}
}