SRL Archive - OSR Help

Map Walking Help?


rya

2010-03-02 11:48:37

Edit: Ive tryed Radial Walking and DTMs but cant seem to get them to work could some give me pointers where to go because ive read tuts on them but never get them to work :(

NCDS

2010-03-02 11:56:02


Function TpaFind(No,look: integer; text: string):Integer;
Var i,a: Integer;
TPA: TPointArray;
MyPoint: TPoint;
Begin
If Not LoggedIn Then Exit;

x := MSCx;
y := MSCy;
A := 0;
SetColours(No);

FindColorsSpiralTolerance(x, y, TPA, Colour, MSx1, MSy1, MSx2, MSy2, 10);
If Length(TPA) = 0 Then
Begin
Result := 0;
Exit;
End;
SetColorSpeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(1);

If (Text = 'None') Then
Begin
Result := True; // not really sure what you want to do with this but you can't set an Integer to True obviously so you will need to change it.
Exit;
End;

For i := 0 To High(TPA) Do
Begin
MyPoint := TPA[i]
Inc(a);
MMouse (MyPoint.x, MyPoint.y, 3, 3);

If IsUpText(Text) Then
Begin
Result := GetColor(MyPoint.x, MyPoint.y);
Exit;
End Else
Result := 0;

If (A >= look) Then
Begin
Result := 0;
Exit;
End;

End;
End;

I believe that's what you want. It should return the color at the spot where it finds the UpText.

Cazax

2010-03-02 12:01:49

That's called autocoloring, there are plenty of tutorials on that. You can also use RadialWalkTolerance to avoid autocoloring.

rya

2010-03-02 12:03:31

From: NCDS

Function TpaFind(No,look: integer; text: string):Integer;
Var i,a: Integer;
TPA: TPointArray;
MyPoint: TPoint;
Begin
If Not LoggedIn Then Exit;

x := MSCx;
y := MSCy;
A := 0;
SetColours(No);

FindColorsSpiralTolerance(x, y, TPA, Colour, MSx1, MSy1, MSx2, MSy2, 10);
If Length(TPA) = 0 Then
Begin
Result := 0;
Exit;
End;
SetColorSpeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(1);

If (Text = 'None') Then
Begin
Result := True; // not really sure what you want to do with this but you can't set an Integer to True obviously so you will need to change it.
Exit;
End;

For i := 0 To High(TPA) Do
Begin
MyPoint := TPA[i]
Inc(a);
MMouse (MyPoint.x, MyPoint.y, 3, 3);

If IsUpText(Text) Then
Begin
Result := GetColor(MyPoint.x, MyPoint.y);
Exit;
End Else
Result := 0;

If (A >= look) Then
Begin
Result := 0;
Exit;
End;

End;
End;

I believe that's what you want. It should return the color at the spot where it finds the UpText.


Umm thanks but i kind of still need it to be a boolean but i thing i know how to do now so thanks

Also the no uptext is to check if something is there E.x grass on the minimap

NCDS

2010-03-02 12:05:54

Ok, if you still need help with it later you can MSN me if you'd like.