SRL Archive - OSR Help

GetMiniMapDotsIn


YoHoJo

2011-11-15 19:26:38

{*******************************************************************************
function GetMiniMapDotsIn(WhatDot: String; x1, y1, x2, y2: Integer): TPointArray;
By: footballjds, NaumanAkhlaQ, Nava2 & Cazax
Description: Results the dots specified by WhatDot in x1, y1, x2, y2.
Usage : 'npc', 'yellow' : Yellow Dot;
'cape', 'blue' : Blue Dot;
'item', 'red' : Red Dot;
'player', 'white' : White Dot;
'friend', 'green' : Green Dot;
*******************************************************************************}
function GetMiniMapDotsIn(WhatDot: string; x1, y1, x2, y2: Integer): TPointArray;
var
Color: Integer;
begin
WhatDot := LowerCase(WhatDot);
case WhatDot Of
'npc', 'yellow': Color := 61937; //60909
'cape', 'blue': Color := 12742980;
'item', 'red': Color := 592381; //789758
'player', 'white': Color := 16711422;
'friend', 'green': Color := 61440;
else
srl_Warn('GetMiniMapDotsIn', '"' + WhatDot + '" is not a valid dot type', warn_AllVersions);
end;
FindColorsSpiralTolerance(MMCX, MMCY, Result, Color, x1, y1, x2, y2, 0);
RAaSTPA(Result, 4);
if (Length(Result) < 1) then Exit;
if (WhatDot = 'player') or (WhatDot = 'white') then
begin
InvertTPA(Result);
SetLength(Result, Length(Result) - 1);
InvertTPA(Result);
end;
end;

Can we make it so it can output 0 as a result? (It currently doesn't right?)
if (Length(Result) < 1) then Exit;
Can we make it just accept 0 as an answer and output that? Yeah?

mormonman

2011-11-15 19:34:41

Its an array..just check the length.

YoHoJo

2011-11-15 19:39:39

Wat?
I want to use this function to see if it DOESN'T find one npc dot on the screen.
Oh so I can do like

If Length(GetMiniMapDotsIn('npc')) = 0 Then
bla

?

mormonman

2011-11-15 19:44:37

From: YoHoJo
Wat?
I want to use this function to see if it DOESN'T find one npc dot on the screen.
Oh so I can do like

If Length(GetMiniMapDotsIn('npc')) = 0 Then
bla

?


if (Length(GetMiniMapDotsIn('npc', box, box, box, box)) < 1) then
begin
end;

YoHoJo

2011-11-15 19:45:34

Got it all sorted out, thanks MOMOMOMOMOMOMOMO, thanks mom.

Nava2

2011-11-15 19:53:28

Help -> Scripting help

YoHoJo

2011-11-15 19:58:03

SRL Moderator & Developer -> Permanently BannedAwesome