Simba Code:
FindColorsSpiralTolerance(MMCX, MMCY, arP, 3487543 , {MMX1, MMY1, MMX2, MMY2}, 3);
In blue your saying if it finds the colour in the Mini Map.
Try this:
Simba Code:
program new;
{$Define Smart}
{$i srl/srl.scar}
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='ojd67';
Players[0].Pass :='';
Players[0].Nick :='jd67';
Players[0].Active:=True;
end;
function BearColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
H, S, L: Extended;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
FindColorsSpiralTolerance(MMCX, MMCY, arP, 3290164, MSX1, MSY1, MSX2, MSY2, 3);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToHSL(arC[i], H, S, L);
if (H >= 16.65) and (H <= 16.69) and (S >= 1.90) and (S <= 3.05) and (L >= 19.39) and (L <= 20.41) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 3.06) and (X <= 3.36) and (Y >= 3.26) and (Y <= 3.56) and (Z >= 3.25) and (Z <= 3.66) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
procedure Bearkiller;
var x, y: integer;
begin
if FindObj(x, y, 'ttack', Bearcolor, 35) then
begin
Mouse(x, y, 2, 2, false);
ChooseOption('ttack');
end;
end;
begin
Smart_Server:= 11;
Smart_Members:= False;
Smart_Signed:= True;
ClearDebug();
SetupSRL();
DeclarePlayers;
LoginPlayer;
bearkiller;
end.
Mat