hey so im makeing a TPA to kill goblens.. i couldnt seem to get it to work so i looked up a TPA / ATPA tutorial and i did learn some useful things ;D but my function still isnt working =/
SCAR Code:
function Attack : Boolean;
var
x, y, i, H, count : Integer;
Color : TIntegerArray;
TPA : TPointArray;
ATPA : T2DPointArray;
begin
Color := [3908509, 4417328, 3842202, 5867839];
x := MSCX;
y := MSCY;
for i := 0 to High(Color) do
begin
Writeln('Test');
if FindColorsSpiralTolerance(x, y, TPA, Color[i], MSX1, MSX2, MSX2, MSY2, 7) then
begin
Writeln('FOUND MONSTER');
ATPA := TPAtoATPA(TPA, 15);
if Length(ATPA) > 0 then
begin
H := High(ATPA);
for i := 0 to H do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 2, 2);
Wait(10+Random(20));
if IsUpText('oblin') then
begin
GetMousePos(x, y);
if MouseCross(x, y, 0, 0, true) then
begin
Status('Fighting');
Wait(1000+Random(500)+RanInt(100));
end;
end;
end;
end;
end;
end;
end;
when it rolls over the Attack function in the mainloop, it does write 'Test' in the debug.. and then the function exits. so from that ive concludedd that im not useing FindColorsSpiralTolerance correctly.. but i dont see what im doing wrong =/ could anyone show me how to properly use it?