SRL Archive - OSR Help

MMtoMS help


CephaXz

2012-05-22 09:07:45

Would like to know more on how to use this function. I want to learn on how to detect items or NPC on the mainscreen with the use of the dots from the minimap.

I tried searching for guides, but couldn't find it. Help is appreciated :)

weequ

2012-05-22 09:41:17

Dots := GetMiniMapDotsIn('npc', MMX1, MMY1, MMX2, MMY2);
SortTPAFrom(Dots, IntToPoint(MMCX, MMCY));//This might be unneccessary if GetMinimapDots already returns the points sorted from the center.
for I := 0 to Length(Dots) -1 do
begin
MSDot := MMtoMS(Dots[I]);
//Here you do whatever you want with each mainscreen point of the NPC dots.
//Remember that the point isn't 100% accurate so you might want to perform an object(color) search function
//to area like MSDot.X-20, MSDot.Y-20, MSDot.X+20, MSDot.Y+20
end;

Edit:
here is what you set as variables:
var
I: Integer;
Dots: TPointArray;
MSDot: TPoint;

CephaXz

2012-05-22 09:52:54

Thanks! I'll try that out now.