NCDS
2010-01-20 19:42:16
For comparison I timed each function 5 times.
Five tries with Current BankScreen:
Re-organized version:
Five tries with Current BankScreen:
102
137
104
131
117
5 tries with re-organized BankScreen:
8
15
18
13
37
All I did was make the function check for the result first so it doesn't get held up on the filasafes if it doesn't need to.Re-organized version:
{*******************************************************************************
function BankScreen: Boolean;
by: NCDS, Coh3n, Sabzi, nielsie95, and Timer
Description: Finds Bankscreen. Returns true if Found.
*******************************************************************************}
function BankScreen: Boolean;
var
c: Integer;
begin
c := GetTimeRunning + 5000;
repeat
Result := FindTextTPA(4106994, 20, 20, 22, 400, 45, 'Bank', upchars, Nothing);
if Result then
Exit;
Wait(50);
until ((GetTimeRunning > c));
Wait(RandomRange(100, 150));
end;
Doesn't it make more sense to have it this way?