Advertisement
WarPie90

Untitled

Jun 18th, 2016
422
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.83 KB | None | 0 0
  1. function LocateFishingspots(runs:Int32=4; wt:Int32=90): TPointArray;
  2. var
  3.   area:TBox = [0,0,515,337];
  4.   j,i,x,y:Int32;
  5.   BMP1,BMP2:TMufasaBitmap;
  6. begin
  7.   SetColorToleranceSpeed(2);
  8.   SetToleranceSpeed2Modifiers(0.2,0.7);
  9.   SetLength(Result, 512);
  10.  
  11.   for j:=0 to runs do
  12.   begin
  13.     BMP1 := GetMufasaBitmap( BitmapFromClient(area) );
  14.     Wait(wt);
  15.     BMP2 := GetMufasaBitmap( BitmapFromClient(area) );
  16.  
  17.     for y:=0 to BMP1.GetHeight()-1 do
  18.       for x:=0 to BMP1.GetWidth()-1 do
  19.         if SimilarColors(BMP1.GetPixel(x,y), 9270889, 25) and
  20.           (BMP1.GetPixel(x,y) <> BMP2.GetPixel(x,y)) then
  21.         begin
  22.           if i = Length(Result) then
  23.             SetLength(Result, i*2);
  24.           Result[i] := Point(x,y);
  25.           Inc(i);
  26.         end;
  27.  
  28.     BMP1.Free();
  29.     BMP2.Free();
  30.   end;
  31.   SetLength(Result, i);
  32. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement