I can use this function I made, sometimes - once. Then it will highlight or automatically highlight an out of range error, but I can't seem to see the reason/var I need to limit?
The function is suppose to find the given input colors (preferabbly all/all but 1) within a 50x50 ATPA of the TPA(mainscreen). Then that box becomes the result, and we'll click there.
example:
Simba Code:
{$include SRL\SRL.simba}
function a_Bank(colors:tintegerarray; tries, tol: integer): boolean;
var
count, lala, i: integer;
bankerTPA: TPointArray;
The_Banker_Box_50_x_50: T2DPointArray;
begin
result := false;
if not loggedin then
exit;
lala := Length(colors);
for count := 1 to high(tries - 1) do
begin
for i := 0 to high(lala) do
if findcolorstolerance(bankerTPA, colors[i], msx1, msy1, msx2, msy2, tol) then
// Out of Range @ this line above ^^^
begin
SortATPAFrom(The_Banker_Box_50_x_50, Point(MSCX, MSCY));
SplitTPAWrap(bankerTPA, 50, The_Banker_Box_50_x_50);
if TPAInATPA(bankerTPA, The_Banker_Box_50_x_50, i) then
begin
mouse(The_Banker_Box_50_x_50[i][i].x, The_Banker_Box_50_x_50[i][i].y, 5, 5, mouse_right);
result := waitoption('nk Ba', 1000);
exit;
end;
end;
if count >= tries then
exit;
end;
end;
begin
SetupSRL;
a_Bank([14474983, 7576783, 5059387, 6505035, 3230297], 5, 5);
end.
Any help on this would be much appreciated!