SRL Archive - OSR Help

Repeat until this many times?


jcunit

2012-08-29 04:40:04

Is there a way to make simba repeat a function more than 1 time but less than infinity? There must be a way to do this, I don't want to make 5 - 6 different procedure's for clicking the same thing.

EX:
repeat
function;
until ....

riwu

2012-08-29 04:41:48

for i:=1 to 5 do //change the 5 if you want to repeat more times
begin
function1;
function2;
end;

Home

2012-08-29 04:42:30

Most basic is.

var
I :Integer;
begin
Repeat
WriteLn('Looped ' + IntToStr(I) + ' Times.');
Inc(I);
Until(I = 6);
end.

Then there is for to do loop and while loop.

Check those in tutorial Island.

~Home

jcunit

2012-08-29 06:01:44

Thanks! I'm still confused…

var i:Integer

begin
for i:= 0 to 2 do
setupSRL;
ClickOnRock;
MageBook;
end.

How can I make ClickRock; repeat 25 times, then move onto MageBook; and other functions? THEN repeat the entire thing AGAIN.

riwu

2012-08-29 06:06:21

then use 2 loops, and why are you trying to repeat setupsrl?
Var 
i: Integer; //semicolon

begin
setupSRL;
for i:=1 to 2 do
begin //need a begin if you are performing >1 action
for i:= 1 to 25 do
ClickOnRock;
MageBook;
end;
end.