Hero
2012-02-23 03:22:33
What can I do to improve this ATPA that I have worked up?

I want to expand my knowledge of TPAs and possible make beautiful things like Flight's Farmer :P
procedure IronRock;
var
CTS, I, x, y: Integer;
Iron1, Iron2, Iron3, Iron4, ITPA1, ITPA2, ITPA3: TPointArray;
ITTPA: Array of TPointArray;
begin
Smart_ClearCanvas;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX, MSCY, Iron1, 2042183, MSX1, MSY1, MSX2, MSY2, 9);
FindColorsSpiralTolerance(MSCX, MSCY, Iron2, 2635355, MSX1, MSY1, MSX2, MSY2, 9);
FindColorsSpiralTolerance(MSCX, MSCY, Iron3, 1910594, MSX1, MSY1, MSX2, MSY2, 8);
FindColorsSpiralTolerance(MSCX, MSCY, Iron4, 2503511, MSX1, MSY1, MSX2, MSY2, 10);
ColorToleranceSpeed(CTS);
ITPA1 := CombineTPA(Iron1, Iron2);
ITPA2 := CombineTPA(Iron3, Iron4);
ITPA3 := CombineTPA(ITPA1, ITPA2);
ITTPA := TPAtoaTPAEx(ITPA3, 15, 15);
For I := 0 to High(ITTPA) do
begin
SMART_DrawPolygons(true, ITTPA, clBlue);
MiddleTPAEx(ITTPA[i], x, y);
MMouse(x, y, 0, 0);
If(WaitUpText('ine', 200)) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
If DidRedClick then
Wait(2400);
Exit;
end;
end;
end; I want to expand my knowledge of TPAs and possible make beautiful things like Flight's Farmer :P