Log in

View Full Version : Help to attack



begginer
01-27-2012, 11:21 AM
I got the code from ACA

but when I type this
if (FindColorsTolerance(arP, 995123, MSX1, MSY1, MSX2, MSY2, 1)) then
begin
MMouse(x, y, 3, 3, True); // this won't work for me
Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

What am I doing wrong


This is the all code



program FindObject;
{.include SRL\SRL.scar}

var
x, y: Integer;

function FindCrawler(var fx, fy: Integer): Boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.47, 1.61);

if (FindColorsTolerance(arP, 995123, MSX1, MSY1, MSX2, MSY2, 1)) then
begin
MMouse(x, y, 3, 3, True);
Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
arUC := arC;
ClearSameIntegers(arUC);
arL := High(arUC);
arL2 := High(arC);

for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 2.31) and (X <= 2.63) and (Y >= 2.62) and (Y <= 2.98) and (Z >= 0.82) and (Z <= 0.94) then
begin
for j := 0 to arL2 do
begin
if (arUC[i] = arC[j]) then
begin
SetLength(arAP, Length(arAP) + 1);
arAP[High(arAP)] := arP[j];
end;
end;
end;
end;

SortTPAFrom(arAP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arAP, 10, 10);
arL := High(ararP);

for i := 0 to arL do
begin
if (Length(ararP[i]) < 10) then Continue;
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 5, 5);
Wait(100 + Random(100));
if (IsUpText('Flesh Crawler')) then
begin;
Result := True;
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
begin
Writeln('FindObject could not find object.');
Exit;
end;

GetMousePos(fx, fy);
end;





begin
SetupSRL;
FindCrawler(x, y);
end.

lilcmp1
01-27-2012, 02:25 PM
Well your first problem is your second line needs to be changed from .scar to .simba

begginer
01-29-2012, 08:44 PM
no it's not. I found my problem myself.

NexPB
01-29-2012, 08:52 PM
Its 'Mouse' instead of 'MMouse'

begginer
01-30-2012, 10:03 AM
Yes, something like it. Thanks for help.