SRL Archive - Help

ACA with RSPS.


TuSaliHai

2013-01-25 10:05:14

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.

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
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?

Wardancer

2013-01-25 11:23:11

Even if the tutorials are based on the real runescape, the ACA functions should work for anything as they're used to find a colour and not accomplish a particular task within runescape. All I see that you need to change are the coordinates to get rid of the MSX1, MSY1, etc.

Gucci

2013-01-25 13:39:19

if not (FindColorsTolerance(arP, 3167850, MSX1, MSY1, MSX2, MSY2, 9)) then./SIMBA]

Replace the MSX1 and MSY1 with the upper left most coordinate of the client and for MSX2 and MSY2 the lower right most coordinates