function FindKarajamaRoadColour: Integer;
function FindKarajamaRoadColour: Integer;
This function automatically detects the Karajama Road colour. I've tested this on over 30 occasions (with over 20 logging in and out, and changing worlds :)) and it works perfectly.
This is for the Karajama Road Colour, that olive colour which represents the road in Karajama when you get off the wharf, which holds the boat from Port Sarim.
Follow these instructions to include it into your script :):
Append (place at the last line) the following code into SRL\SRL\core\AutoColor.scar:
scar Code:
{*******************************************************************************
function FindKarajamaRoadColour: Integer;
by: Dan's The Man
Description: Autodetecs the Karajama Road Colour on the Minimap
*******************************************************************************}
function FindKarajamaRoadColour: Integer;
var
TPA: TPointArray;
i, bI, BakColour: Integer;
Red, Green, Blue: Integer;
TemporaryCTS: Integer;
begin
TemporaryCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
FindColorsSpiralTolerance(MMCX, MMCY, TPA, 1341335, MMX1, MMY1, MMX2, MMY2, 40);
bI := High(TPA);
if(bI + 1 > 0) then
begin
for i := 0 to bI do
begin
BakColour := GetColor(TPA[i].X, TPA[i].Y);
ColorToRGB(BakColour, Red, Green, Blue);
if(InRange(Red, 120, 175)) then
if(InRange(Green, 80, 155)) then
if(InRange(Blue, 10, 30)) then
if(GetColor(TPA[i].X + 2, TPA[i].Y) = BakColour) then
if(GetColor(TPA[i].X, TPA[i].Y + 2) = BakColour) then
if(GetColor(TPA[i].X + 2, TPA[i].Y + 2) = BakColour) then
if(GetColor(TPA[i].X + 1, TPA[i].Y) = BakColour) then
begin
Result := BakColour;
Writeln('Found the Karajama Road Colour');
ColorToleranceSpeed(TemporaryCTS);
Exit;
end;
end;
end;
Writeln('Could not find the Karajama Road Colour =(');
ColorToleranceSpeed(TemporaryCTS);
end;
Enjoy :)