Results 1 to 6 of 6

Thread: Wait for True Result.

  1. #1
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default Wait for True Result.

    Hey, is there a function that waits a certain time for a function to result true(or anything else, that you define).

    And if it gets the wanted result in that timespawn, it returns true, or the times it returned true.

    ...

    I know, it would be easy to write such a function. But since you need it often (at least me )... Maybe theres already a function for that in SRL or scar.

    ~
    caused

  2. #2
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Maybe, tell use for what situation you use it?

    Repeat
    Wait(TimeINMSSECONDS);
    until (Boolean);
    ~Hermen

  3. #3
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  4. #4
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    in the case of a function you would do...

    function isGood: boolean;

    repeat
    wait(10);
    until isGood;

    or

    while not(isGood) do wait(10);

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  5. #5
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    Thanks. What i needed


    Maybe, tell use for what situation you use it?
    Well.. it often comes quite handy. I used it to check weather the charachter is still in the animation for crafting shoes (it switches from crafting animation to no animation all the time..) .

  6. #6
    Join Date
    Jan 2008
    Location
    Alberta
    Posts
    727
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by caused View Post
    Maybe, tell use for what situation you use it?
    Any part of the script which is vital if it succeeds or not, such as WalkToBank; WalkToX; etc. so I can try a failsafe, or switch players.

    Or if you need to see if you're doing something (which you showed in your post as what you used them for) like IsMining; InFightEx; etc.

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
  •