SCAR Code:
function FindVarrockRoadColor2: Integer;
var
GC, a, l, TestColor, Red, Green, Blue : integer;
var
P:array of Tpoint;
begin
GC := 7304312; //Ground color I believe
Flag; //Hopefull you know Flag.. but.. it will just wait until the Flag is gone or 30 seconds have past (I believe it's 30 seconds..)
FindColorsSpiralTolerance(x, y, P, GC, MMX1, MMY1, MMX2, MMY2, 60); //Looks in a spiral starting from the center of the 4 points (this will start at the center of the Mini Map and it will look for color GC (determined above) with a tolerance of 60
l:=GetArrayLength(P); //Gets the length of the array.. how many points I think..
for a:= 0 to l-1 do //from 0 to the points minus 1 do..
begin //this stuff..
TestColor := GetColor(P[a].x, P[a].y); //TestColor is the point x and y..
red := (TestColor mod 256); //mod will get the remainder of something (dividing someting..) //These are all RGB stuff for autocoloring I think?
green := ((TestColor / 256) mod 256); //same thing //These are all for RGB coloring
blue := ((TestColor / 256) / 256); //same thing //Stated above..
if Red - Blue <= 12 then if Red - Blue >= 8 then //a bunch of if the colors are a certain color things..
if Red - Green <= 6 then if Red - Green >= -1 then //a bunch of if the colors are a certain color things..
if Green - Blue <= 10 then if Green - Blue >= 4 then //a bunch of if the colors are a certain color things..
if GetColor(P[a].x + 5, P[a].y + 5) = TestColor then //if the points from above (from the GetArrayLength(P); + 5 on the x axis and + 5 on the y axes is the test color then..
if GetColor(P[a].x + 3, P[a].y + 3) = TestColor then //same but +3 on the x axis and +3 on the y axis
if GetColor(P[a].x, P[a].y + 5) = TestColor then //all the same stuff but different points
if GetColor(P[a].x + 5, P[a].y) = TestColor then //all the same stuff but different points
if GetColor(P[a].x, P[a].y + 3) = TestColor then //all the same stuff but different points
if GetColor(P[a].x + 3, P[a].y) = TestColor then //all the same stuff but different points
if GetColor(P[a].x + 5, P[a].y + 3) = TestColor then //all the same stuff but different points
if GetColor(P[a].x + 3, P[a].y + 5) = TestColor then //all the same stuff but different points
begin
Result := TestColor; //"saves" the test color for later use.. like.. if(FindVarrockRoadColor2 = 1234567890)then something
Exit; //you should know..
end;
end;
WriteLn('Could not find Varrock Road Color!');
Result := 0; //if it can't find the color, it will return 0.. so then you would use it like..
end; //if(FindVarrockRoadColor2 = 0)then TerminateScript;
//Hopefully you understand all this now :D you can just use FindVarrockRoadColor I think.. dunno if anything is wrong with it.. he just edited it slightly because he's pro at life :p
^^