euphemism

Untitled

Dec 11th, 2011
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 3.51 KB | None | 0 0
  1. procedure ATPASortFrom(var ATPA: T2DPointArray; SortPoint: TPoint);
  2. var
  3.   I, Len, MinDist, Swaps, TestDist: Integer;
  4.   MinTP, TestTP: TPoint;
  5. begin
  6.  
  7.   Swaps := 1;
  8.   Len := Length(ATPA);
  9.  
  10.   MinTP := IntToPoint(MiddleTPA(ATPA[0]).x, MiddleTPA(ATPA[0]).y);
  11.   MinDist := Distance(MinTP.x, MinTP.y, SortPoint.x, SortPoint.y);
  12.  
  13.   while (Swaps <> 0) do
  14.   begin
  15.  
  16.     Swaps := 0;
  17.  
  18.     for I := 0 to (Len - 1) do
  19.     begin
  20.  
  21.       TestTP := IntToPoint(MiddleTPA(ATPA[i]).x, MiddleTPA(ATPA[i]).y);
  22.       TestDist := Distance(TestTP.x, TestTP.y, SortPoint.x, SortPoint.y);
  23.  
  24.       if (MinDist > TestDist) then
  25.       begin
  26.  
  27.         Inc(Swaps);
  28.         MinDist := TestDist;
  29.         TPASwap(ATPA[i], ATPA[0]);
  30.       end;
  31.     end;
  32.   end;
  33. end;
  34.  
  35. function OpenLumBank: Boolean;
  36. var
  37.   CTS, FrameColor, FrameTol, GlassColor, GlassTol, I, Match, Tol, X, Y: Integer;
  38.   FrameHue, FrameSat, GlassHue, GlassSat: Extended;
  39.   GlassPoint: TPoint;
  40.   FrameTPA, GlassTPA: TPointArray;
  41.   FrameATPA, NewATPA: T2DPointArray;
  42. begin
  43.  
  44.   Result := False;
  45.   Match := 0;
  46.   SetLength(NewATPA, 0);
  47.  
  48.   if FindNormalRandoms then
  49.     Exit;
  50.  
  51.   if (not LoggedIn) then
  52.     Exit;
  53.  
  54.   if BankScreen then
  55.   begin
  56.  
  57.     Result := True;
  58.     Exit;
  59.   end;
  60.   FrameColor := 3882046; FrameTol := 2; FrameHue := 2.78; FrameSat := 0.38;
  61.   GlassColor := 8159110; GlassTol := 3; GlassHue := 0.81; GlassSat := 0.26;
  62.  
  63.   CTS := GetColorToleranceSpeed;
  64.   SetColorToleranceSpeed(2);
  65.   SetColorSpeed2Modifiers(FrameHue, FrameSat);
  66.   Tol := FrameTol;
  67.  
  68.   while Tol < 80 do
  69.   begin
  70.  
  71.     if not FindColorsTolerance(FrameTPA, FrameColor, MSX1, MSY1, MSX2, MSY2, Tol) then
  72.     begin
  73.  
  74.       IncEx(Tol, 5);
  75.     end else
  76.     begin
  77.  
  78.       Break;
  79.     end;
  80.   end;
  81.  
  82.   SetColorSpeed2Modifiers(GlassHue, GlassSat);
  83.  
  84.   if not FindColorsTolerance(GlassTPA, GlassColor, MSX1, MSY1, MSX2, MSY2, GlassTol) then
  85.   begin
  86.  
  87.     GlassPoint := IntToPoint(263, 154);
  88.   end else
  89.   begin
  90.  
  91.     LinearSort(GlassTPA, MSCX, MSCY, 0, False);
  92.     GlassPoint := IntToPoint(GlassTPA[0].x, GlassTPA[0].y);
  93.   end;
  94.  
  95.   SetColorToleranceSpeed(CTS);
  96.   SetColorSpeed2Modifiers(0.2, 0.2);
  97.  
  98.   SplitTPAExWrap(FrameTPA, 1, 1, FrameATPA);
  99.   SortATPASize(FrameATPA, True);
  100.  
  101.   for I := 0 to High(FrameATPA) do
  102.   begin
  103.  
  104.     if InRange(Length(FrameATPA[i]), 30, 160) then
  105.     begin
  106.  
  107.       SetLength(NewATPA, Length(NewATPA) + 1);
  108.       NewATPA[Match] := FrameATPA[i];
  109.       Inc(Match);
  110.     end;
  111.   end;
  112.  
  113.   FrameTPA := MergeATPA(NewATPA);
  114.   SplitTPAExWrap(FrameTPA, 25, 25, FrameATPA);
  115.  
  116.  
  117.   ATPASortFrom(FrameATPA, GlassPoint);
  118.  
  119.   FrameTPA := FrameATPA[0];
  120.  
  121.   SplitTPAExWrap(FrameTPA, 1, 1, FrameATPA);
  122.  
  123.   ATPASortFrom(FrameATPA, GlassPoint);
  124.  
  125.   for I := 0 to High(FrameATPA) do
  126.   begin
  127.  
  128.     Match := Random(High(FrameATPA[i]));
  129.  
  130.     SortATPAFrom(FrameATPA, GlassPoint);
  131.  
  132.     MMouse(FrameATPA[i][Match].x, FrameATPA[i][Match].y, 0, 0);
  133.     GetMousePos(X, Y);
  134.  
  135.     if WaitUpTextMulti(['ank', 'boo', 'booth', 'se', 'an'], 500) then
  136.     begin
  137.  
  138.       Mouse(X, Y, 0, 0, False);
  139.       Wait(200 + Random(300));
  140.  
  141.       if ChooseOptionMulti(['uik', 'se-q', 'q']) then
  142.       begin
  143.  
  144.         ClearRSCanvas(SMART_Canvas.canvas);
  145.  
  146.         if (WaitFunc(@BankScreen,100,3000)or(PinScreen)) then
  147.         begin
  148.  
  149.           if WaitFunc(@PinScreen, 100, 3000) then
  150.             if not(InPin(Players[CurrentPlayer].Pin)) then
  151.               CloseBank;
  152.  
  153.         end;
  154.  
  155.         Result := BankScreen;
  156.         Break;
  157.       end;
  158.     end else
  159.     begin
  160.  
  161.       Continue;
  162.     end;
  163.   end;
  164. end;
  165.  
Advertisement
Add Comment
Please, Sign In to add comment