Gala
2012-02-24 14:12:59
Hey all.
I just made my own function that counts the players on the minimap. I know there is already one that comes with SRL, but this one works badly for me especially if there is a symbol next to some players.
It works for me, but it seems to click on the compass symbol, so the angle is on 'north'. I tried everything, but I think there is someone who can tell me very quickly what's wrong with the function:
The number of players (Result := Length(PlayerATPA)) is correct, but it seems to click on the compass and I can't figure out why.
Could someone help me please? :)
I just made my own function that counts the players on the minimap. I know there is already one that comes with SRL, but this one works badly for me especially if there is a symbol next to some players.
It works for me, but it seems to click on the compass symbol, so the angle is on 'north'. I tried everything, but I think there is someone who can tell me very quickly what's wrong with the function:
function GetTotalPlayers: Integer;
var
MiddlePosSPS, MiddlePos: TPoint;
PlayersTPA: TPointArray;
PlayerATPA: Array of TPointArray;
begin
if not LoggedIn then Exit;
MiddlePosSPS := Point(4183, 2748);
MiddlePos := SPS_PosToMM(MiddlePosSPS);
if not AtYewsVar then
begin
Result := -1;
end else
begin
CTS := GetColorToleranceSpeed;
if not CTS = 2 then ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.14, 3.32);
if not FindColorsSpiralTolerance(MMCX, MMCY, PlayersTPA, 14927604, MMX1, MMY1, MMX2, MMY2, 20) then
begin
SetColorSpeed2Modifiers(0.01, 2.17);
if not FindColorsSpiralTolerance(MMCX, MMCY, PlayersTPA, 13033957, MMX1, MMY1, MMX2, MMY2, 20) then
begin
SetColorSpeed2Modifiers(0.34, 1.05);
if not FindColorsSpiralTolerance(MMCX, MMCY, PlayersTPA, 14801359, MMX1, MMY1, MMX2, MMY2, 20) then
begin
end;
end;
end;
ColorToleranceSpeed(CTS);
if SPS_PosOnMM(MiddlePosSPS) then
begin
PlayersTPA := RemoveDistTPointArray(MiddlePos.x, MiddlePos.y, 35, PlayersTPA, True);
end;
PlayerATPA := TPAToATPAEx(PlayersTPA, 3, 3);
Result := Length(PlayerATPA);
end;
end; The number of players (Result := Length(PlayerATPA)) is correct, but it seems to click on the compass and I can't figure out why.
Could someone help me please? :)