rj
02-09-2014, 06:19 PM
How does this function work?
function GetMiniMapDotsIn(WhatDot: String; x1, y1, x2, y2: Integer): TPointArray;
var
I, Dif, Radius, Hi, C: Integer;
TPA: TPointArray;
begin
case LowerCase(WhatDot) of
'npc', 'n', 'yellow', 'y': Dif := 4369;
'item', 'i', 'red', 'r': Dif := 23;
'player', 'p', 'white', 'w': Dif := 1907997;
'friend', 'f', 'green', 'g': Dif := 5376;
'team', 't', 'blue', 'b', 'cape': Dif := 2171941;
{'clan', 'c', 'orange', 'o': Dif := -1;}
else
srl_Warn('GetMiniMapDotsIn', '"' + WhatDot + '" is not a valid dot type', warn_AllVersions);
end;
Freeze;
Radius := Max((x2-x1)div 2, (y2-y1)div 2);
FindColorsPie(TPA, 65536, 0, 0, 360, 0, radius, x1, y1, x2, y2, (x1+x2)div 2, (y1+y2)div 2);
Hi := High(TPA);
SetLength(Result, Hi + 1);
if (Hi < 0) then
begin
UnFreeze;
Exit;
end;
C := 0;
for I := 0 to Hi do
begin
if (GetColor(TPA[I].X-1, TPA[I].Y-1) - GetColor(TPA[I].X, TPA[I].Y-1) = Dif) then
begin
Result[C] := Point(TPA[I].x, TPA[i].y - 2);
Inc(C);
end;
end;
Unfreeze;
SetLength(Result, C);
end;
More specifically, what is the significance of the variable 'dif'
I am trying to get all the reds dots on a 317 server, and I have tried putting all numbers from 0 to 40,000 for dif (literally added an extra parameter to the function and did a 0 to 40,000 for loop with no results) and none of them find the red dots on the minimap
Doubt these people are active but they are the Authors:
Nava;
@Rasta Magician;
function GetMiniMapDotsIn(WhatDot: String; x1, y1, x2, y2: Integer): TPointArray;
var
I, Dif, Radius, Hi, C: Integer;
TPA: TPointArray;
begin
case LowerCase(WhatDot) of
'npc', 'n', 'yellow', 'y': Dif := 4369;
'item', 'i', 'red', 'r': Dif := 23;
'player', 'p', 'white', 'w': Dif := 1907997;
'friend', 'f', 'green', 'g': Dif := 5376;
'team', 't', 'blue', 'b', 'cape': Dif := 2171941;
{'clan', 'c', 'orange', 'o': Dif := -1;}
else
srl_Warn('GetMiniMapDotsIn', '"' + WhatDot + '" is not a valid dot type', warn_AllVersions);
end;
Freeze;
Radius := Max((x2-x1)div 2, (y2-y1)div 2);
FindColorsPie(TPA, 65536, 0, 0, 360, 0, radius, x1, y1, x2, y2, (x1+x2)div 2, (y1+y2)div 2);
Hi := High(TPA);
SetLength(Result, Hi + 1);
if (Hi < 0) then
begin
UnFreeze;
Exit;
end;
C := 0;
for I := 0 to Hi do
begin
if (GetColor(TPA[I].X-1, TPA[I].Y-1) - GetColor(TPA[I].X, TPA[I].Y-1) = Dif) then
begin
Result[C] := Point(TPA[I].x, TPA[i].y - 2);
Inc(C);
end;
end;
Unfreeze;
SetLength(Result, C);
end;
More specifically, what is the significance of the variable 'dif'
I am trying to get all the reds dots on a 317 server, and I have tried putting all numbers from 0 to 40,000 for dif (literally added an extra parameter to the function and did a 0 to 40,000 for loop with no results) and none of them find the red dots on the minimap
Doubt these people are active but they are the Authors:
Nava;
@Rasta Magician;