SRL Archive - OSR Help

Sorting TPA's on the minimap


Troll

2011-01-03 11:49:38

Ok so im trying to map walk with tpa's, i have a greenish color which is on the ground a lot there. So I want to know how to sort it so it will click the color the first time it finds it but as far to the bottom left of mm it can be while still being on the mini map.

I know i have sortTPAFrom but im not sure if im doing it right.
Here my code its not much


Function MapPoint(I:Integer):TPointArray;
Begin
Case I Of

1: MapWalkingTPA(3706752,6,0.38,1.36);


End;
End;
Function MapWalkingTPA(Colour,Tol:Integer; Hue,Sat:Extended):TPointArray;
Var MyTPA:TPointArray;
X,Y :Integer;
Begin
If Not LoggedIn Then Exit;

SetColorToleranceSpeed(2);
SetColorspeed2Modifiers(Hue,Sat);
FindColorsSpiralTolerance(x,y,MyTPA,Colour,MMX1,MMY1,MMX2,MMY2,Tol);

If ( Length(MyTPA) =< 1 ) Then
Begin
writeln('Walking has not worked :( the colour and stuff was -Color '+ IntToStr(Color) +' -Tol '+ IntToStr(Tol));
Result := False
End;



End;

Function WalkToGuy:Boolean;
Begin
If Not LoggedIn Then Exit;

SortTPAFrom(MapPoint(1),Point(MMX1,MMY1));
RadialWalkEx(

Thanks guys :)

Edit: Also how do i check if x,y are in a Tbox (i thinks a tbox which is formed when you use IntToBox)

Thanks

Boreas

2011-01-03 13:00:55

Sort from MMX1 MMY2. Then do a for loop through the array and click and break at the first one that is RSOnMinimap or something.

Also:
SomeTPA := FunctionThatReturnsTPA();
FunctionThatSortsTPA(SomeTPA);

And I think you want PointInBox for the edit question.

Troll

2011-01-03 13:08:20

Ok thanks that is great boreas :)