SRL Archive - Help and Support

Improving TPA?


Hero

2012-02-23 03:22:33

What can I do to improve this ATPA that I have worked up?



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

YoHoJo

2012-02-23 03:25:34

Check out my PowerMiner (or ANY of my scripts).

You can break TPAs into ATPAs with certain boundaries, and serach each ATPA for a pixel check, etc etc :D!

TPA/ATPAs are fking amazing!

I can explain more later, but this guide is AMAZING and reading it along with looking at Flight/My/Anyone's scripts with TPA/ATPA should help you out a lot:

http://villavu.com/forum/showthread.php?t=49067

Hero

2012-02-23 03:33:30

Thank you for the information but that is where I have picked up a few of the ideas above. I am just using the iron rocks as a easy starter.