Results 1 to 5 of 5

Thread: Repeat until this many times?

  1. #1
    Join Date
    May 2012
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Repeat until this many times?

    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:
    Simba Code:
    repeat
    function;
    until ....

  2. #2
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

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

  3. #3
    Join Date
    Feb 2006
    Posts
    3,044
    Mentioned
    4 Post(s)
    Quoted
    21 Post(s)

    Default

    Most basic is.

    Simba Code:
    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

  4. #4
    Join Date
    May 2012
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks! I'm still confused...

    Simba Code:
    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.

  5. #5
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    then use 2 loops, and why are you trying to repeat setupsrl?
    Simba Code:
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •