SRL Archive - OSR Help

For To Do and TPAs Help


rya

2010-02-26 18:14:20

Well im trying to make some TPAs work and well i cant get them to compile so help would be nice

Function FindSpot:Boolean;
Var x,y,i,MyPoint: Integer;
TPA: TPointArray;
Begin
If Not LoggedIn Then Exit;

x := MSCx;
y := MSCy;

FindColorsSpiralTolerance(x, y, TPA, Colour, MSx1, MSy1, MSx2, MSy2, 10);
If Length(TPA) = 0 Then
If FindColorsSpiralTolerance(x, y, TPA, Colour1, MSX1, MSY1, MSX2, MSY2, 10) Then
If Length(TPA) = 0 Then
Result := False;

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

If IsUpText(Cow) Then
GetMousePos(x,y);

If Random(8)=5 Then
Begin
Mouse(x,y,0,0,False);
Wait(500+Random(750);
ChooseOption(ill);
End Else
Mouse(x,y,0,0);
End;

End;
Also in the For To Do bit would it spam click every point or just one point with uptext?

NCDS

2010-02-26 18:17:48

MyPoint needs to be a TPoint;


Function FindSpot:Boolean;
Var x,y,i: Integer;
TPA: TPointArray;
MyPoint: TPoint;
Begin
If Not LoggedIn Then Exit;

x := MSCx;
y := MSCy;

FindColorsSpiralTolerance(x, y, TPA, Colour, MSx1, MSy1, MSx2, MSy2, 10);
If Length(TPA) = 0 Then
If FindColorsSpiralTolerance(x, y, TPA, Colour1, MSX1, MSY1, MSX2, MSY2, 10) Then
If Length(TPA) = 0 Then
Exit;

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

If IsUpText('ow') Then
begin
GetMousePos(x,y);

If Random(8)=5 Then
Mouse(x,y,0,0,False)
else
Mouse(x, y, 0, 0, True);
Wait(500+Random(750);
WaitOption('ill', 2000);
Break;
end;
End;
End;
There, I believe that's what you want.

ChooseOption checks to see if the option is available first so it wont execute it you didn't right click ;)

Frement

2010-02-26 18:19:56

After you have found the one you want, remember to break the loop.

EDIT:
Function FindSpot:Boolean;
Var x,y,i,MyPoint: Integer;
TPA: TPointArray;
Begin
If Not LoggedIn Then Exit;

x := MSCx;
y := MSCy;

FindColorsSpiralTolerance(x, y, TPA, Colour, MSx1, MSy1, MSx2, MSy2, 10);
If Length(TPA) = 0 Then
If FindColorsSpiralTolerance(x, y, TPA, Colour1, MSX1, MSY1, MSX2, MSY2, 10) Then
If Length(TPA) = 0 Then
Result := False;

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

If IsUpText(Cow) Then
GetMousePos(x,y);

If Random(8)=5 Then
Begin
Mouse(x,y,0,0,False);
Wait(500+Random(750);
ChooseOption(ill);
End Else begin
Mouse(x,y,0,0);
end;
Break;
End;

End;

rya

2010-02-26 18:23:09

Thanks it me mixing tuts and stuff out but Thanks