
Originally Posted by
WT-Fakawi
Distance 70 should be within tolerance, however it is near the border of the minimap. Whenever the client loads, there sometimes is a large black rectangle at the outer border of the Minimap. With distance 70, you will prolly have clicked on the blackstuff, thus resulting in color 0 (black).
Workaround: Try taking smaller steps. I hardly ever walk in steps larger then 60, sometimes even 20 to come near to an object I have spotted.
Hope this helps.
Same thing happened to me, but i've lowered it to 30+random(7)ish and it would still find that same black color. So i threw this thing together, it works well for me.... And It's what I'm going to continue useing and updating until someone finds a better way, or explains how im doing the radialwalk wrong.
SCAR Code:
//Declare these in your whole program, whether useing or not. Unless you want to edit the functions
ABadColor: Array of Integer;
IBadColor, Road:integer;
Function InArray(One:Integer; Arrays:Array of Integer):Boolean;//Self Explainitory?
var c:integer;
Begin
For c:=0 to (GetArrayLength(Arrays) - 1) Do
If(One = Arrays[c])Then
Result:= true;
End;
Function RoadMaskBitMap:integer;
var
a, q, z, stuff:integer;
Begin
a := BitmapFromString(4, 3, 'z78DA7373A30E0000CEFE13B1');//bitmap of 4x3 area with same color
FindBitMapMaskTolerance(a, q, z, 648 - 70, 83 - 70, 648 + 70, 83 + 70, 1, 1)//searches for bitmap in minimap
stuff:= GetColor(q, z);//stuff gets the color from where the bitmap was found
If(q > 0)and(stuff > 0)Then//if the coords aren't crap (ill clean this up later) then it returns the color
Begin
Writeln('Coord: ('+IntToStr(q)+', '+IntToStr(z)+') - '+IntToStr(stuff));
result:=stuff;//stuff = color found at bitmap
End;
FreeBitMap(a);//frees bitmap so memory not sucked (atleast i hope)
End;
Function GetRoadColor:integer;
var c, w:integer;
compassangle:extended;
Begin
//ActivateClient; Might want this added in, ill test later
c:=0;
KeyDown(VK_Right);//should start camera turning
repeat
repeat
w:=RoadMaskBitMap;//w returns as the color from the search
Wait(1);//make this biggier for slower computers
c:=c+1;//counter to break loop
until(((w > 4000000) and (w < 8000000) and (Not (InArray(w, ABadColor)))) or (c > 15000));
If((C > 15000) and (Not (InArray(w, ABadColor))))Then Writeln('Road Color Might be Off');
until((w > 0) and (Not (InArray(w, ABadColor))));
KeyUp(VK_Right);
result:=w;
End;
When it attempts to rotate the camera, the client MUST be activated. When you're useing the radial road walk i suggest you add a counter, if the radialroadwalk returns false over so many times then have it add that road color to the ABadColor array.
If your useing radialroadwalk in a loop (repeat until, while do) then you'll want to add this in incase it finds bad colors.
SCAR Code:
//RadialRoadWalk crap
BadColorCount:= BadColorCount + 1;
If(BadColorCount > 100)Then //100 being it cannot find the road color
Begin
Writeln('Adding color to bad colors list');//tells you a bad color found, debugging
ABadColor[IBadColor]:= Road;//IBadColor is how many bad colors have been found ABadColor is an array storing all of the bad colors
IBadColor:= IBadColor + 1;//
Road:= GetRoadColor; //Gets a new color
PerfectNorth; //Makes map north again
End;
Seems to work for me so far, I'm going to see if i can make it better for slower computers. Add biggier waits in for slower computers for now though... It might bug, but i like it better than the getcolor stuff they already have.
Edit: If you start to see "Coord: x, y - color" and the camera isn't moving then the client isn't activated properly. Just click the RS screen and move the camera for it.