Results 1 to 5 of 5

Thread: Help with Timed Loops

  1. #1
    Join Date
    Aug 2006
    Posts
    408
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Help with Timed Loops

    How can I use until() to run the script until a certain number of seconds is passed. I don't want to post my whole script here, so I'll summarize what I did that didn't work. This is my main loop:

    SCAR Code:
    var FlagMark: Integer;

    -insert script here with procedures and functions-

    begin
    SetupSRL;
    SetupPlayers;
    MarkTime(FlagMark);
    repeat
    LoginPlayer;
    repeat
    wait(10)
    Until(Findfunction);
    Until(Findfunction2);
    Until(FindFunction3);
    *****procedure;
    ***** procedure;
    until(TimeFromMark(FlagMark) > (Timetobuy*60000) );
    end.

  2. #2
    Join Date
    Jun 2006
    Posts
    1,492
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    have a lot of MarkTimes and TimeFromMark. I see you already know how to use these procedures. But why do you have 3 untils? That wont work. Use until(function or function2 or function3)

  3. #3
    Join Date
    Jul 2006
    Posts
    152
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    4 untils... with 2 repeats?

    Code:
    begin
    marktime(somevariable)
    repeat
    dostuffhere
    until(somevariable >= timelimit)
    end.

  4. #4
    Join Date
    Jun 2006
    Posts
    1,492
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yea the code you got is right, just do it for every loop you want to be timed.

    And you cant have 4 untils with 2 repeats. It will give a compiling error, because you need an until with every repeat, and vice versa

  5. #5
    Join Date
    Jun 2006
    Location
    USA
    Posts
    1,828
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    alach11, you probably wanted to do it like this:
    SCAR Code:
    Until(Findfunction);
    Or(Findfunction2);
    or(FindFunction3);

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Loops.
    By skilld u in forum Outdated Tutorials
    Replies: 7
    Last Post: 07-03-2008, 08:40 PM
  2. All about loops.
    By Negaal in forum Outdated Tutorials
    Replies: 5
    Last Post: 03-31-2008, 09:43 PM
  3. for loops
    By tylanbo in forum OSR Help
    Replies: 9
    Last Post: 12-16-2007, 10:49 AM

Posting Permissions

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