Naum
2008-10-12 13:11:41
PlayersOnMap only worked for one thing, so I thought why not extend it? To find NPC's, BlueDots, RedDots, Players and Friends.
Function :
Usage :
Enjoy!
Function :
{*******************************************************************************
function DotsOnMap(xx1, yy1, xx2, yy2 : integer) : integer;
By: Idea By footballjds Extended by NaumanAkhlaQ
Description: Counts the specified dot on the minimap,
not including your own player.
Usage : 'npc', 'yellow' : Yellow Dot;
'cape', 'blue' : Blue Dot;
'item', 'red' : Red Dot;
'player', 'white' : White Dot;
'friend', 'green' : Green Dot;
*******************************************************************************}
function DotsOnMap(WhatDot : String; xx1, yy1, xx2, yy2 : integer) : integer;
var
Dotz : TPointArray;
Col0r : Integer;
begin
Case LowerCase(WhatDot) Of
'npc', 'yellow' : Col0r := 60909;
'cape', 'blue' : Col0r := 12742980;
'item', 'red' : Col0r := 789758;
'player', 'white' : Col0r := 16711422;
'friend', 'green' : Col0r := 61440;
end;
FindColorsTolerance(Dotz, Col0r, xx1, yy1, xx2, yy2, 19);
RAaSTPA(Dotz, 4);
Case LowerCase(WhatDot) Of
'player', 'white' : Result := GetArrayLength(Dotz) - 1;
Else
Result := GetArrayLength(Dotz);
end;
If Result = 0 Then
WriteLn('No '+IntToStr(WhatDot)+' Dots FOUND On Map');
end;Usage :
WriteLn(DotsOnMap('npc', MMX1, MMY1, MMX2, MMY2));
Enjoy!