SCAR Code:
function CloseWindow: Boolean;
var
Col: TIntegerArray;
b: T2DPointArray;
a: T2DPointArray;
Pa: TBox;
I, ii, h, l: Integer;
begin
Result := CloseBank; //Eh??
Col := [1118997, 1449250, {Main typ 1}
8042720, 4160933, {Skill}
6854059, 2902100, {Quest}
4282212, 2503226, {Main typ 2}
39423, 13567, {Red X}
1514271, 1580837, {Deposit Box}
2106925, 1250584];
SetLength(b, 2);
for I := 0 to 6 do
begin
FindColors(b[0], Col[i*2], MSCX, MSY1, MSX2, MSCY);
FindColors(b[1], Col[i*2+1], MSCX, MSY1, MSX2, MSCY);
l := (High(b[0]) + High(b[1]));
//Writeln(IntToStr(i) + ' Col1: ' + IntToStr(High(b[0])) + ' Col2: ' + IntToStr(High(b[1])) + ' T: ' + IntToStr(l));
if InRange(l, 6, 53) or InRange(l, 94, 250) then
begin
a := SplitTPA(CombineTPA(b[0], b[1]), 5);
SortATPAFromFirstPoint(a, Point(385, 100));
//DebugATPA(a, '');
for ii := 0 to h do
begin
Pa := GetTPABounds(a[ii]);
if ((Pa.x2 - Pa.x1) > 50) or ((Pa.y2 - Pa.y1) > 50) then Continue;
MMouse(RandomRange(Pa.x1, Pa.x2), RandomRange(Pa.y1, Pa.y2), 0, 0);
Wait(100 + Random(50));
if rs_GetUpText = 'Close' then
begin
GetMousePos(Pa.x1, Pa.y1);
Mouse(Pa.x1, Pa.y1, 0, 0, True);
Result := True;
Writeln('Close Window Type ' + IntToStr(i));
Exit;
end;
end;
end;
end;
end;