SRL Archive - Jr. Member General Help and Discussion

Walk to closest "dot."


Ross

2014-09-12 14:51:09

Since there is no findDot or findClosestDot or anything of the sort, how would I go about using "minimap.getDots" to click on the closest dot on the minimap? I'm using this for when an NPC can't be found in my fighting script.


Thank you in advance!

TylerT

2014-09-12 15:55:18

Use getDots and then put them into an ATPA and use sortFromMidPoint?

Ross

2014-09-12 16:10:08

From: TylerT
Use getDots and then put them into an ATPA and use sortFromMidPoint?


ATPA.sortFromMidPoint(minimap.playerPoint);

Unknown declaration "playerPoint"


It doesn't like minimap! If I use mainscreen (to test) it finds the ATPAs and draws them on the minimap so the ATPA logic is sound, I just don't know how to sort from the player point on the minimap.

e: wait nevermind. It did it :X


/thread thanks @TylerT

The Mayor

2014-09-12 17:17:34

From: therossity
ATPA.sortFromMidPoint(minimap.playerPoint);

Unknown declaration "playerPoint"


It doesn't like minimap! If I use mainscreen (to test) it finds the ATPAs and draws them on the minimap so the ATPA logic is sound, I just don't know how to sort from the player point on the minimap.

e: wait nevermind. It did it :X


/thread thanks @TylerT


there is no playerPoint on the MM, only the MS.


dots := minimap.getDots(MM_DOT_NPC, minimap.getBounds());

if length(dots) > 0 then
begin
sortTPAFrom(dots, minimap.getBounds().getMiddle());
mouse(dots[0].x, dots[0].y, 5, 5, MOUSE_LEFT);
end;

bonsai

2014-09-12 17:31:03

From: The Mayor
there is no playerPoint on the MM, only the MS.


dots := minimap.getDots(MM_DOT_NPC, minimap.getBounds());

if length(dots) > 0 then
begin
sortTPAFrom(dots, minimap.getBounds().getMiddle());
mouse(dots[0].x, dots[0].y, 5, 5, MOUSE_LEFT);
end;


There's also a tpa function for the sort:

dots.sortFromPoint(minimap.getBounds().getMiddle());

Ross

2014-09-12 17:37:11

From: The Mayor
there is no playerPoint on the MM, only the MS.


dots := minimap.getDots(MM_DOT_NPC, minimap.getBounds());

if length(dots) > 0 then
begin
sortTPAFrom(dots, minimap.getBounds().getMiddle());
mouse(dots[0].x, dots[0].y, 5, 5, MOUSE_LEFT);
end;


From: bonsai
There's also a tpa function for the sort:

dots.sortFromPoint(minimap.getBounds().getMiddle());




Much cleaner than what I had, thanks!

The Mayor

2014-09-12 22:30:16

From: bonsai
There's also a tpa function for the sort:

dots.sortFromPoint(minimap.getBounds().getMiddle());


Ahhh yea ;) That was from a pre-srl6 script I had, with a few mods.