SRL Archive - OSR Help

Need TPA help..


Chris

2012-01-13 12:38:48

Hi, I need some help with TPA's..
I have something like this:


if (FindBitmapToleranceIn(MyBMP, x, y, xs, ys, xe, ye, 15)) then
begin
BitmapsFound[0] := IntToPoint(x, y);
end;
if (FindBitmapToleranceIn(MyOtherBMP, x, y, xs, ys, xe, ye, 15)) then
begin
BitmapsFound[1] := IntToPoint(x, y);
end;

MiddleTPAEx(BitmapsFound, x, y);
Mouse(x, y, 5, 5, True);

Now the problem is: when it cant find the bitmap the Tpoint will be (0, 0) and this will greatly affect the x, y..
Im trying to make it delete the points which are (0, 0), but I dont know how to do this..
Any ideas from the experienced scripters? :D

Kasi

2012-01-13 12:53:10

your using it in the wrong way,
Use
FindBitmapsSpiralTolerance(bitmap:integer; x, y: integer; var Points : TPointArray; xs, ys, xe, ye, tolerance): Boolean;

this will place all the points at which it has found your bitmap in a TPointArray from then you can remove the Point(0, 0)

Chris

2012-01-13 13:02:36

From: pur3b100d
your using it in the wrong way,
Use
FindBitmapsSpiralTolerance(bitmap:integer; x, y: integer; var Points : TPointArray; xs, ys, xe, ye, tolerance): Boolean;

this will place all the points at which it has found your bitmap in a TPointArray from then you can remove the Point(0, 0)


I know about that function, but the bitmap im searching for in the beginning is different than the bitmap im searching for in BitmapsFound(1);
With your function, I can only input one bitmap to search for.

Kasi

2012-01-13 13:04:55

oh right sorry i get you one sec lemme find something that deletes points

Chris

2012-01-13 13:32:55

Ok thanks, I got to go right now but Ill be back in ~1 hour

Kasi

2012-01-13 13:40:03


Var
T, C : TPointArray;

Begin
T := [Point(0, 0), Point(7, 7), Point(8, 8), Point(9, 9), Point(5, 5), Point(0, 0), Point(0, 0)];
C := ClearTPAFromTPA(T, [Point(0, 0)]);
End.

Use ClearTPAFromTPA

Chris

2012-01-13 14:08:19

From: pur3b100d

Var
T, C : TPointArray;

Begin
T := [Point(0, 0), Point(7, 7), Point(8, 8), Point(9, 9), Point(5, 5), Point(0, 0), Point(0, 0)];
C := ClearTPAFromTPA(T, [Point(0, 0)]);
End.

Use ClearTPAFromTPA



Thanks, its exactly what I needed :)

Kasi

2012-01-13 14:20:22

your welcome =]