Can't help you without code, but I'd imagine it would like something like this
Code:
boolean autonEnabled = true;
public void autonomousInit(){
autonEnabled = true;
}
public void autonomosPeriodic(){
if(!autonEnabled) return;
//doStuff();
if(autonDone) autonEnabled = false;
}