So I'm trying to use ACA with ProjectRS06.
So I got the ACA down, but I can't follow the tutorial because it uses real RS.
Simba Code:
program AutoColor;
{.include SRL\SRL.scar}
function AutoColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.04, 0.11);
if not (FindColorsTolerance(arP, 3167850, MSX1, MSY1, MSX2, MSY2, 9)) 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
Result := arC[i];
//Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
//Writeln('AutoColor failed in finding the color.');
end;
begin
SetupSRL;
AutoColor;
end.
So I have that.
Then I also have
Simba Code:
program Chopper;
{$i srl/srl.simba}
var
X,Y:Integer;
Procedure ClickTree;
begin
if FindColorTolerance(X, Y, 4221835, 260, 94, 260, 94, 5) then
begin
mmouse(X, Y,1,1); // moves the mouse to were the colot is found
wait(250 + random(500)); // waits one fourth of a second
ClickMouse(X, Y, mouse_Left)// clicks
end;
end;
begin
SetUpSRL;
ClickTree;
end.
How do I implement the auto color finder into that?