
Originally Posted by
MasterCrimez
I don't understand. What does Breakearly mean and nobreak?
Well it was just a suggestion so that you don't end up breaking out of the "mainloop" every 30 minutes. That seems somewhat predictable; to me at least. I guess I could show you how I meant for those variables to be used:
Simba Code:
var
BreakTime, t: Integer;
BreakEarly, NoBreak: Boolean;
// ^ Note that these are global vars
procedure HandleBreak;
var
Rand: Integer;
begin
if BreakEarly or NoBreak then
Exit;
Rand := Random(500);
case Rand of
0: BreakEarly := True;
1: NoBreak := True;
end;
end;
begin
BreakTime := (30 * 1000);
BreakEarly := False;
NoBreak := False;
repeat
SetupScript;
// ...
MarkTime(t);
repeat
HandleBreak;
MainLoop;
// ...
if BreakEarly then // Nifty feature #1
begin
BreakEarly := False;
Break;
end;
if NoBreak then // Nifty feature #2
begin
NoBreak := False;
MarkTime(t);
end;
until (TimeFromMark(t) >= BreakTime)
until (Whatever)
end.
Taking a look back at your original code, I think you might be confused because your MainLoop has repeats. This would only work if you don't repeat your MainLoop inside the MainLoop. Instead you use the repeats of what I did above to cycle through the HandleBreak, MainLoop, etc. So you essentially make your MainLoop equivalent to one load, or one complete cycle of your script. Then it will check for a BreakEarly and a NoBreak quite often.