Imanoobbot
2012-03-25 10:01:27
Hey I am in writing a simple IronMiner with ACA v2. My problem is at the beginning it already got Compiling errors. Here are the coded lines.
Error: [Error] (17:13): Unknown identifier 'GetColorToleranceSpeed' at line 16
Compiling failed.
If I am making it this way i got the same error.
Maybe someone could explain me how to build ACA into a script and how to drop the ores after full invintory.
-Imanoobbot
program IronMiner;
var
x, y: Integer;
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
R, G, B: Integer;
X, Y, Z: Extended;
function FindObject(var fx, fy: Integer): Boolean;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.04, 0.10);
if not(FindColorsTolerance(arP, 2964581, MSX1, MSY1, MSX2, MSY2, 6)) then
begin
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
ColorToRGB(arC[i], R, G, B);
if (R >= 81) and (R <= 121) and (G >= 48) and (G <= 73) and (B >= 36) and (B <= 55) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 4.89) and (X <= 10.75) and (Y >= 4.10) and (Y <= 8.92) and (Z >= 2.27) and (Z <= 4.66) 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;
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('Iron Ore Rock')) 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;
procedure MineIron;
if (FindColorsTolerance(arP, 2964581, MSX1, MSY1, MSX2, MSY2, 6) then
begin MoveMouse(x, y);
ClickMouse(x, y, 2);
end;
begin
SetupSRL;
FindObject(x, y);
MineIron;
end; Error: [Error] (17:13): Unknown identifier 'GetColorToleranceSpeed' at line 16
Compiling failed.
If I am making it this way i got the same error.
program AutoMiner;
var
x, y: Integer;
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
function IronColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.04, 0.10);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 2964581, MSX1, MSY1, MSX2, MSY2, 6);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 4.89) and (X <= 10.75) and (Y >= 4.10) and (Y <= 8.92) and (Z >= 2.27) and (Z <= 4.66) then
begin
Result := arC[i];
//Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
//Writeln('AutoColor failed in finding the color.');
end;
procedure MineIron;
var x, y: integer;
begin
if FindObj(x, y, 'ine', IronColor, 35) then
begin
Mouse(x, y, 2, 2, false);
ChooseOption('ine');
end;
end;
begin
IronColor;
MineIron;
end. Maybe someone could explain me how to build ACA into a script and how to drop the ores after full invintory.
-Imanoobbot
Any suggestions?