Simba Code:
program new;
{$Define SMART}
{$I SRL/SRL.Simba}
{$i srl/srl/misc/debug.simba}
{$I SRL/SRL/MISC/SMARTGRAPHICS.SIMBA}
procedure FindBanker;
var
TPA: Array of TPoint;
ATPA: T2DPointArray;
Box: TBox;
TheCTS, I, X, Y, H : Integer;
begin
theCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.04, 0.40);
FindColorsSpiralTolerance(301,175,TPA,11192042, MSX1, MSY1, MSX2, MSY2,6);
ATPA := TPAToATPAEx(TPA, 40, 40);
SetColorToleranceSpeed(theCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
H := High(ATPA);
If Length(ATPA) = 0 Then
WriteLn('Length = O, Exiting FindBanker');
Exit;
For I := 0 To H Do
begin
WriteLn('FindBanker ATPA Length = ' + IntToStr (Length(ATPA)));
//SortATPASize(ATPA,True);
SortTPAFrom(TPA, Point(301,175));
MiddleTPAEx(ATPA[I], X, Y);
MMouse(x,y,4,2);
Clickmouse2(mouse_right);
if WaitOption('ank ',500) then
begin
WriteLn('We have found the Banker!');
Wait(1000+random(500));
break;
end;
end;
debugatpabounds(atpa);
end;
begin
setupSRL
begin
FindBanker;
writeln('yay');
end;
end.
Debug:
Progress Report:
Paired with SMART[20388]
Failed to RSReady
Failed to RSReady
yay
Successfully executed.
Why will it not find the object or even say the length? I have debug for all outcomes and its not doing anything? Surely I am doing something wrong and I cannot see it. On another script it seems to work. Any help appreciated.