SRL Archive - SRL Archives

PlayersOnMap Extension


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 :

{*******************************************************************************
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!

Shuttleu

2008-10-12 13:16:39

well done but if its only going to be for the MM then why have the 4 co-ordinates?

plus you could make it search in a circle instead of a box

~shut

noidea

2008-10-12 13:18:14

In this,

{*******************************************************************************
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;
*******************************************************************************}

You forgot to add the String in the function thing.

Shuttleu

2008-10-12 13:23:52

fixed it up a bit
{*******************************************************************************
function DotsOnMap(WhatDot : string) : 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) : integer;
var
Dotz : TIntegerArray;
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;
Dotz:= rs_FindMMColors(Col0r);
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;
:)

~shut

Naum

2008-10-12 14:07:15

@ Shut that will find every color of that ;). You need to specify the pixels :p

Shuttleu

2008-10-12 14:18:09

{*******************************************************************************
function DotsOnMap(WhatDot : string) : 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) : integer;
var
Dotz : TIntegerArray;
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;
Dotz:= rs_FindMMColors(Col0r);
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;
how about that then?

~shut

Naum

2008-10-12 14:29:31

Much better :)

Claymore

2008-10-16 19:07:45


RAaSTPA

What does that do? Thanks and i will need this ;p

Naum

2008-10-18 05:44:41

Leaves one point per box with the side length Dist.

n3ss3s

2008-10-18 06:36:32

That can't be accurate if there is loads of the dot color on MM in some other use…

Naum

2008-10-18 07:08:50

well why not try it :p

Nava2

2008-10-18 09:44:59

{*******************************************************************************
function DotsOnMap(WhatDot : String) : 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) : 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, MMx1, MMy1, MMx2, MMy2, 19);
RAaSTPA(Dotz, 4);
Result := GetArrayLength(Dotz);
if (LowerCase(WhatDot) = 'player' or 'white') then Dec(Result);
If Result = 0 Then
WriteLn('No '+IntToStr(WhatDot)+' Dots FOUND On Map');
end;

Naum

2008-10-18 09:59:02

Nice, Cut it quite small.

Nava2

2008-10-18 12:15:41

:) Its what I do.