Yeah,
For the simplicity; We'll say you got 12h online training time, then the script would have to wait for 24h before logging back in (12h training, 12h for regain)
So if you have 6h, that would be 6h+12h before logging back in. Also a random interval between 0-2h before logging back in (after regain is completed) so that it isn't so suspicious?