For Line 144 Error People!
I THINK if you go to C:\Simba\Includes\SRL\SRL\core\overwrite.scar
and find the function called rs_getCompassAngleRadians and replace it with this
Simba Code:
function rs_GetCompassAngleRadians: Extended;
var
tpa: TPointArray;
atpa: T2DPointArray;
i, h, l: Integer;
VectorArray: Array of TVector;
RefPoint: TPoint;
angles: TExtendedArray;
math_2pi: Extended;
begin
math_2pi := 2*pi;
{ Colour of 3 E/S/W dots }
FindColorsTolerance(tpa, 2370604, 529, 9, 558, 39, 0);
atpa := SplitTPA(tpa, 1);
h := High(atpa);
setLength(tpa, h+1);
l := 0;
for i := 0 to h do
{ Gets rid of dots under length of 3 and get the MiddleTPA }
if high(atpa[i]) > 4 then
begin
tpa[l] := MiddleTPA(atpa[i]);
inc(l);
end;
if l <> 3 then
Exit;
setLength(tpa, l);
FilterPointsDist(tpa, 9, 20, 543, 24);
SetLength(VectorArray, 3);
for i := 0 to 2 do
VectorArray[i] := CreateVector(Point(543, 24), tpa[i], True);
angles := [AngleBetween(VectorArray[0], VectorArray[1]),
AngleBetween(VectorArray[1], VectorArray[2]),
AngleBetween(VectorArray[2], VectorArray[0])];
for i := 0 to 2 do
begin
if angles[i] > pi then
angles[i] := math_2pi - angles[i];
{ compare angle between, > 100 then it's the south dot }
if angles[i] > radians(100) then
begin
case i of
0: RefPoint := tpa[2];
1: RefPoint := tpa[0];
2: RefPoint := tpa[1];
end;
{ break the loop, we have reference pt. }
break;
end;
end;
{ Using the south dot to measure compass angle.. }
Result := ArcTan2(-(RefPoint.Y - 24), RefPoint.X - 543) - Radians(80);
Result := fixRad(Result - Pi - 0.05*Pi);
end;
it MIGHT solve the problem.