MylesMadness
2008-09-27 16:53:34
Everyone else was making some so I decided to make one.
The x and y variable are also the screen middle point.
Function MadnessFindObj(var x, y:Integer; Colors:TIntegerArray; UpText:String; x1, y1, x2, y2, tol:Integer):Boolean;
var
Points, ATPA:T2DPointArray;
TPA:TPointArray;
TP:TPoint;
I:Integer;
begin
SetArrayLength(Points, GetArrayLength(Colors));
For I:=0 to high(Colors)do
FindColorsSpiralTolerance(X, Y, Points[i], Colors[i], x1, y1, x2, y2, Tol);
For I:=0 to high(Colors)do
TPA:=CombineTPA(TPA, Points[i]);
SortTPAFrom(TPA, Point(x, y));
ATPA:=TPAtoATPA(TPA, 10);
For I:=0 to high(ATPA)do
begin
TP:=MiddleTPA(ATPA[i])
MMouse(TP.x, TP.y, 2, 2)
If IsUpText(UpText)then
begin
Result:=True;
GetMousePos(x, y);
exit;
end;
end;
end;
The x and y variable are also the screen middle point.