HyperSecret
2010-04-28 14:23:50
I was looking through the GameTab function today and thought I would bring something to attention.
The way it is now:
Now the way I understand this (maybe I am wrong) but when it enters the 2nd while loop, if it ends up with a 'Result := True' it will then exit that loop, it will then inc(tries) go back up to Mouse again and repeat Mouse more times.
So shouldn't there be a 'If Result Then Exit' somewhere in this loop so we don't repeatedly Mouse to the GameTab?
Like I said, maybe I am wrong or missing something but that is how I understand it.
The way it is now:
Tries := 0;
while (Tries < 3) do
begin
Mouse(tP.X, tP.Y, 0, 0, True);
T := GetSystemTime;
while (not Result) and (GetSystemTime - T < 2000) do
begin
Result := (GetCurrentTab = Tab);
Wait(100 + Random(100));
end;
Inc(Tries);
end;
Now the way I understand this (maybe I am wrong) but when it enters the 2nd while loop, if it ends up with a 'Result := True' it will then exit that loop, it will then inc(tries) go back up to Mouse again and repeat Mouse more times.
So shouldn't there be a 'If Result Then Exit' somewhere in this loop so we don't repeatedly Mouse to the GameTab?
Like I said, maybe I am wrong or missing something but that is how I understand it.