Inside SRL/misc/ are all my color finders. They are based on a very simple but highly effective principle.
If you know your starting position, you know where the colors are on the MiniMap. If you face the MiniMap North, all the colors are in more or less the same place.
Here is how my color finders work. There are directly based of Stupid3ooo's work.
[FONT="Courier New"]Function FindFaladorRoadColor: Integer;
var C,TX,TY,FaladorRoad:integer;
begin
FaladorRoad := BitmapFromString(6, 6, 'z78DA337531353536371' +
'D762400DDB12ED5');
while (C<100) do
begin
C:=C+5;
If FindBitMapToleranceIn(FaladorRoad,TX,TY,663,125,674,139,C) then
begin
RoadColor:=GetColor(TX,TY);
Players[CurrentPlayer].Loc:='Falador';
Result:=RoadColor;
break;
end
end
if Result = 0 then writeln('ERROR: RoadColor NOT Found');
FreeBitMap(FaladorRoad);
end;[/FONT]
The function
assumes you are standing at the leftmost bankcounter at Falador East with your map faced north.
It Checks for a small 6*6 RoadColor BitMap between coordinates 663,125 and ,674,139 (rather small area, but its garantueed white dots free….)
It searches 20 times whilst increasing the colortolerance between the abovementioned Bitmap and the current roadcolor. If
FindBitMapToleranceIn returns true and x&y, you sample the pixel's color using
GetColor(x,y)This is just one method of colorfinding, but there are many more. I use this one because it never fails me.