Code:
function TRSBankScreen.__openGE(): Boolean;
function findBankerAreas(): TBoxArray;
var
TPA: TPointArray;
ATPA: T2DPointArray;
i: Integer;
b: TBox;
begin
FindColorsTolerance(TPA, 6580588, MainScreen.GetBounds(), 5, ColorSetting(2, 2.09, 0.55));
ATPA := ClusterTPAEx(TPA, 5, 5);
for i := 0 to High(ATPA) do
begin
if (Length(ATPA[i]) < 100) then
Continue;
b := GetTPABounds(ATPA[i]);
if (b.getWidth() < 15) or (b.getHeight() < 15) or
(b.getWidth() > 220) or (b.getHeight() > 220) or
(ATPA[i].getDensity() < 0.10) then
Continue;
b.Expand(10);
b.setLimit(MainScreen.getBounds());
Result := Result + b;
end;
end;
function findBanker(const Area: TBox): Boolean;
var
tFace, TPA: TPointArray;
aFace, ATPA: T2DPointArray;
i, j: Integer;
b: TBox;
p: TPoint;
begin
if (not FindColorsTolerance(tFace, 5408694, Area, 15, ColorSetting(2, 0.18, 0.67))) then
Exit(False);
aFace := ClusterTPAEx(tFace, 3, 3);
SortATPAFromMidPoint(aFace, MiddleBox(Area));
for i := 0 to High(aFace) do
if (Length(aFace[i]) > 4) and (Length(aFace[i]) < 50) then
begin
p := MiddleTPA(aFace[i]);
b := intToBox(p.x - 12, p.y, p.x + 12, p.y + 30);
if (not FindColorsTolerance(TPA, 11382432, b, 9, ColorSetting(2, 5.57, 0.48))) then
Continue();
ATPA := ClusterTPAEx(TPA, 4, 4);
SortATPASize(ATPA, True);
for j := 0 to High(ATPA) do
begin
if (Length(ATPA[j]) < 15) then
Continue();
mouse(ATPA[j].getMiddle().randRange(-4, 5));
if (isMouseOverText(['Bank Banker', 'ank Bank'])) then
begin
fastClick(MOUSE_LEFT);
if (minimap.isFlagPresent(Random(300, 600))) then
minimap.waitFlag(10);
Result := _waitBankOrPinScreen(Random(4000, 5000));
if (Result) then
Exit(True);
end;
end;
end;
end;
var
i: Integer;
Boxes: TBoxArray;
begin
Result := False;
Boxes := findBankerAreas();
if (Length(Boxes) = 0) then
Exit(print('bankScreen.__openGE(): Found no possible area''s for a banker to be in', False));
SortBoxesFromMidPoint(Boxes, MainScreen.playerPoint);
for i := 0 to High(Boxes) do
if (FindBanker(Boxes[i])) then
Exit(print('bankScreen.__openGE(): Succesfully opened the GE bank', True, '', TDebug.DEBUG));
end;
Line to rightclick, chose option It should be able to open the collect box at the GE banker?