SRL Archive - Jr. Member General Help and Discussion

FindColorTolerance help.


BigRedJapan

2014-11-02 22:14:00

Function RoughWall(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
if R_NearTile(Point(2037204196, 185627106), 10) then

begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.14, 0.52);

if not(FindColorsTolerance(arP, 1584441, 1, 1, 764, 501, 7)) then
begin
Writeln('Failed to find the color, no object found.');
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
MMouse(x, y, 3, 3);
if R_IsUpText('climb') then
begin
writeLn('Climbin');
ClickMouse2(mouse_Right);
R_WaitChooseOption('Climb', RandomRange(150, 250));
Result :=True;
end;
end;
end;


Its pretty simple. its telling me that there is a mismatch, yet i cant find the error.

TomTuff

2014-11-02 22:15:41

Need to use IntToBox. Or just do mainscreen.getBounds.

BigRedJapan

2014-11-02 22:18:50

k let me rephrase this question is their a better way to find objects without having to use color tolerances?

TomTuff

2014-11-02 22:25:28

Post a screenshot of wha you're trying to do.