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...
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...
Edit: There's a normal FindBitmapSpiralTolerance but not one using deformed bitmap..
PHP Code:function FindBitmapSpiralTolerance(bitmap: Integer; var x, y: Integer; x1, y1, x2, y2: Integer; Tolerance: Integer): Boolean;
Works like FindBitmapSpiral but with a tolerance parameter for finding any similar colored bitmap. Tolerance is used to find a colored bitmap in range of the bitmap you are looking for. The greater color range you want, the higher the tolerance parameter should be.
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]



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;
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



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