I think you're talking about overriding the default random manager so you could perform a task before activating it if I understand correctly...
In your onStart():
randomManager.registerHook(new RandomBehaviourHook(randomManager.LOGIN_MANAGER)){
@Override
public boolean shouldActivatePostLoop(){
return true;
}
@Override
public int postLoop() throws InterruptedException{
//task to perform
return 0;
}
}
Note: If you want to exit the postLoop then have it return -1
2- There are a variety of methods you can override which can be found here