Results 1 to 8 of 8

Thread: FindDeformedBitmapTolerancespiral?

  1. #1
    Join Date
    Jun 2007
    Posts
    246
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default FindDeformedBitmapTolerancespiral?

    is there a function to find a deformed bitmap with tolerance in a spiral? im using openbankquiet and i just want to add something into my script for that because it keeps clicking the one on the left...

  2. #2
    Join Date
    Mar 2007
    Posts
    3,681
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by zenma View Post
    is there a function to find a deformed bitmap with tolerance in a spiral? im using openbankquiet and i just want to add something into my script for that because it keeps clicking the one on the left...
    sorry what exactly do you want to do?

  3. #3
    Join Date
    Aug 2007
    Posts
    429
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Edit: There's a normal FindBitmapSpiralTolerance but not one using deformed bitmap..

    PHP Code:
    function FindBitmapSpiralTolerance(bitmapInteger; var xyIntegerx1y1x2y2IntegerToleranceInteger): Boolean
    Works like FindBitmapSpiral but with a tolerance parameter for finding any similar colored bitmapTolerance is used to find a colored bitmap in range of the bitmap you are looking for. The greater color range you wantthe higher the tolerance parameter should be

  4. #4
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Well I can tell you how to do it if you want..

    First, do FindDeformed... until you find all the ones on teh screen, which you can detect by doing until( stuff that sorts through every found point and this includes in em and so...), and then, make an array of integer where you sort the distances of the points from MSCx and y, and then do BubbleSort and the closest is Array[0]

  5. #5
    Join Date
    Jun 2007
    Posts
    246
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by n3ss3s View Post
    Well I can tell you how to do it if you want..

    First, do FindDeformed... until you find all the ones on teh screen, which you can detect by doing until( stuff that sorts through every found point and this includes in em and so...), and then, make an array of integer where you sort the distances of the points from MSCx and y, and then do BubbleSort and the closest is Array[0]
    lmao thats confusing but ill try to learn how to do that
    edit: but what do you mean by "and this includes in em and so..." do you mean that finddeformed includes stuff to sort through every found point or waht do you mean?

  6. #6
    Join Date
    May 2006
    Posts
    1,230
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by zenma View Post
    lmao thats confusing but ill try to learn how to do that
    edit: but what do you mean by "and this includes in em and so..." do you mean that finddeformed includes stuff to sort through every found point or waht do you mean?
    What you want to do is CopyClientToBitmap the rs screen to a bitmap, set that bitmap as target, Do FindDeformedBitmapToleranceIn and Black out the area where one is found, and add the position to a TPoint array. Do this until it doesn't find the bitmap anymore, then arrange the array from the points that are closest to the center to the farthest from the center, pick the closest one, and then set the client back as the target.

    Confusing, Yes, Easy, Yes.

    EDIT: Never tested...
    SCAR Code:
    function FindDeformedBitmapToleranceSpiralIn(bitmap : integer; var x, y : integer; x1, y1, x2, y2 : integer; Tolerance : integer; Range : integer; AllowPartialAccuracy : boolean; var Angle : extended) : boolean;
    var
      Handle : integer;
      CH : TCanvas;
      Screen : integer;
      TempX, TempY : integer;
      w, h, i : integer;
      Pos, Backup : TPointArray;
      Angles : array of extended;
      Ang : extended;
    begin
      GetBitmapSize(bitmap, w, h);
      Screen := BitmapFromString(iAbs(x1 - x2), iAbs(y1 - y2), '');
      CH := GetBitmapCanvas(Screen);
      CH.Pen.Color := 0;
      CH.Brush.Color := 0;
      CopyClientToBitmap(Screen, x1, y1, x2, y2);
      Handle := GetClientWindowHandle;
      SetTargetBitmap(Screen);
      repeat
        if FindDeformedBitmapToleranceIn(bitmap, TempX, TempY, x1, y1, x2, y2, Tolerance, Range, AllowPartialAccuracy, Ang) then
        begin
          i := GetArrayLength(Pos);
          SetArrayLength(Pos, i + 1);
          SetArrayLength(Angles, i + 1);
          Pos[i] := Point(TempX, TempY);
          Angles[i] := Ang;
          CH.Rectangle(TempX, TempY, TempX + w, TempY + h);
        end else
        begin
          Break;
        end;
      until false
      if GetArrayLength(Pos) > 0 then
      begin
        Backup := Pos;
        //Requires WizzyPlugin
        SortTPAFrom(Pos, Point(x, y));
        for i := 0 to GetArrayLength(Backup) - 1 do
        begin
          if (Backup[i].x = Pos[0].x) and (Backup[i].y = Pos[0].y) then
          begin
            x := Pos[0].x;
            y := Pos[0].y;
            Angle := Angles[i];
            Result := True;
            Break;
          end;
        end;
      end;
      FreeBitmap(Screen);
      SetClientWindowHandle(Handle);
    end;

  7. #7
    Join Date
    Jun 2007
    Posts
    246
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks.. bout to test it in a min. so many things i havent even heard of >.< where do you learn this stuff theres like no tutorials or anything
    edit: didndt work for me, gonna try to fix it

  8. #8
    Join Date
    May 2006
    Posts
    1,230
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by zenma View Post
    thanks.. bout to test it in a min. so many things i havent even heard of >.< where do you learn this stuff theres like no tutorials or anything
    You learn overtime, looking at various tutorials and sources, and also experimenting.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •