Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure ATPASortFrom(var ATPA: T2DPointArray; SortPoint: TPoint);
- var
- I, Len, MinDist, Swaps, TestDist: Integer;
- MinTP, TestTP: TPoint;
- begin
- Swaps := 1;
- Len := Length(ATPA);
- MinTP := IntToPoint(MiddleTPA(ATPA[0]).x, MiddleTPA(ATPA[0]).y);
- MinDist := Distance(MinTP.x, MinTP.y, SortPoint.x, SortPoint.y);
- while (Swaps <> 0) do
- begin
- Swaps := 0;
- for I := 0 to (Len - 1) do
- begin
- TestTP := IntToPoint(MiddleTPA(ATPA[i]).x, MiddleTPA(ATPA[i]).y);
- TestDist := Distance(TestTP.x, TestTP.y, SortPoint.x, SortPoint.y);
- if (MinDist > TestDist) then
- begin
- Inc(Swaps);
- MinDist := TestDist;
- TPASwap(ATPA[i], ATPA[0]);
- end;
- end;
- end;
- end;
- function OpenLumBank: Boolean;
- var
- CTS, FrameColor, FrameTol, GlassColor, GlassTol, I, Match, Tol, X, Y: Integer;
- FrameHue, FrameSat, GlassHue, GlassSat: Extended;
- GlassPoint: TPoint;
- FrameTPA, GlassTPA: TPointArray;
- FrameATPA, NewATPA: T2DPointArray;
- begin
- Result := False;
- Match := 0;
- SetLength(NewATPA, 0);
- if FindNormalRandoms then
- Exit;
- if (not LoggedIn) then
- Exit;
- if BankScreen then
- begin
- Result := True;
- Exit;
- end;
- FrameColor := 3882046; FrameTol := 2; FrameHue := 2.78; FrameSat := 0.38;
- GlassColor := 8159110; GlassTol := 3; GlassHue := 0.81; GlassSat := 0.26;
- CTS := GetColorToleranceSpeed;
- SetColorToleranceSpeed(2);
- SetColorSpeed2Modifiers(FrameHue, FrameSat);
- Tol := FrameTol;
- while Tol < 80 do
- begin
- if not FindColorsTolerance(FrameTPA, FrameColor, MSX1, MSY1, MSX2, MSY2, Tol) then
- begin
- IncEx(Tol, 5);
- end else
- begin
- Break;
- end;
- end;
- SetColorSpeed2Modifiers(GlassHue, GlassSat);
- if not FindColorsTolerance(GlassTPA, GlassColor, MSX1, MSY1, MSX2, MSY2, GlassTol) then
- begin
- GlassPoint := IntToPoint(263, 154);
- end else
- begin
- LinearSort(GlassTPA, MSCX, MSCY, 0, False);
- GlassPoint := IntToPoint(GlassTPA[0].x, GlassTPA[0].y);
- end;
- SetColorToleranceSpeed(CTS);
- SetColorSpeed2Modifiers(0.2, 0.2);
- SplitTPAExWrap(FrameTPA, 1, 1, FrameATPA);
- SortATPASize(FrameATPA, True);
- for I := 0 to High(FrameATPA) do
- begin
- if InRange(Length(FrameATPA[i]), 30, 160) then
- begin
- SetLength(NewATPA, Length(NewATPA) + 1);
- NewATPA[Match] := FrameATPA[i];
- Inc(Match);
- end;
- end;
- FrameTPA := MergeATPA(NewATPA);
- SplitTPAExWrap(FrameTPA, 25, 25, FrameATPA);
- ATPASortFrom(FrameATPA, GlassPoint);
- FrameTPA := FrameATPA[0];
- SplitTPAExWrap(FrameTPA, 1, 1, FrameATPA);
- ATPASortFrom(FrameATPA, GlassPoint);
- for I := 0 to High(FrameATPA) do
- begin
- Match := Random(High(FrameATPA[i]));
- SortATPAFrom(FrameATPA, GlassPoint);
- MMouse(FrameATPA[i][Match].x, FrameATPA[i][Match].y, 0, 0);
- GetMousePos(X, Y);
- if WaitUpTextMulti(['ank', 'boo', 'booth', 'se', 'an'], 500) then
- begin
- Mouse(X, Y, 0, 0, False);
- Wait(200 + Random(300));
- if ChooseOptionMulti(['uik', 'se-q', 'q']) then
- begin
- ClearRSCanvas(SMART_Canvas.canvas);
- if (WaitFunc(@BankScreen,100,3000)or(PinScreen)) then
- begin
- if WaitFunc(@PinScreen, 100, 3000) then
- if not(InPin(Players[CurrentPlayer].Pin)) then
- CloseBank;
- end;
- Result := BankScreen;
- Break;
- end;
- end else
- begin
- Continue;
- end;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment