SRL Archive - OSR Help

Repeat


surreal

2013-02-03 03:19:26

How would I make this script repeat itself 10,000 times?
This is not mine.
Program FlaxPicker;
{$i srl/srl.simba}
Procedure FindFlaxTPA;
var
tmpCTS, l, r:Integer;
FlaxTPA:TPointArray;
begin
MouseSpeed:=15;
tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.02, 0.89);
if FindColorsTolerance(FlaxTPA, 13946995, 8, 7, 509, 335, 11) then
begin
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
L := Low(FlaxTPA)
wait(randomrange(60, 100));
mmouse((FlaxTPA[r].x), (FlaxTPA[r].y), 2, 2);
clickmouse2(mouse_left);
wait(randomrange(600, 800));
while (IsMoving) do
wait(randomrange(100, 250));
end;
end;
begin
FindFlaxTPA;
end.
Begin
end.

riwu

2013-02-03 03:35:11

You only need 1 'begin … end.'

var
i: Integer;
begin
for i:= 1 to 10000 do
FindFlaxTPA;
end;

rj

2013-02-03 13:06:36

I highly advise that you use the Project2006 Inlcude which can be found here:http://villavu.com/forum/showthread.php?t=95916

And to make this repeat, you could do something like:

Function ClickTree: Boolean;
Var
tmpCTS,i, L,Counter: Integer;
ObjTPA: TPointArray;
ObjATPA: T2DPointArray;
X,Y,DMCount,Moves: Integer;
Begin
Moves:=0;
DMCount:=0;

tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);

SetToleranceSpeed2Modifiers(0.02, 0.89);
FindColorsTolerance(ObjTPA, 13946995, MSX1, MSY1, MSX2, MSY2, 5);
SplitTPAWrap(ObjTPA, 10, ObjATPA);

SortATPASize(ObjATPA,True);
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);

DMCount:=RandomRange(3,5);
L := High(ObjATPA)
MarkTime(Counter);
For i := 0 To L Do
Begin
MiddleTPAEx(ObjATPA[i], X, Y);

Repeat Begin
Moves:=Moves+1;
mmouse(x, y, 1, 1);
Wait(RandomRange(140, 200));
If (P06_IsUpTextMultiCustom(['Flax','ick', 'Pick'])) Then
Begin
clickmouse2(mouse_Left);
Wait(700);
while (IsMoving) do
wait(100);
Exit;
End;
End; Until (Moves > DMCount)
If (TimeFromMark(Counter) > 5000) Then
Begin
Break;
End;
End;
Result:=False;
End;
Procedure CheckStuff;
Begin
If (P06_InvFull) Then
Begin
BankFlax;
End;
End;
Begin
CheckStuff;
End.