SRL Archive - Help and Support

no color setup help


phantombmx

2006-04-04 14:30:10

ok with my work-in-progress lumbridge cowhide getter i want it to be no color setup.. how would i make it get the roadcolor next to the al kharid toll gate (the road on the lumbridge side)? i have tried lots of things but with no luck.. any help?

Pwnd

2006-04-04 14:40:44

if(FindBitmap(AlKharidRoad, ax, ay))then
RoadColor:= GetColor(Ax, Ay);

It might be better to use FindBitmapToleranceIn, but I didn't feel like getting the coords for the minimap.

phantombmx

2006-04-04 15:52:39

ah ok i guess ill try that then :D

WT-Fakawi

2006-04-04 16:33:43

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.

phantombmx

2006-04-04 17:12:00

thanks fakawi, i think that did it.. not sure yet.. havent tested it more than a few times.. :)