Results 1 to 7 of 7

Thread: Infite loop problem

  1. #1
    Join Date
    Dec 2006
    Posts
    249
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Infite loop problem

    HTML Code:
    begin
      SetupClient;
      repeat;
        SetupPlayer;
        GetPlayerStats;
        Wait(500+Random(1000));
        PlayerStatus := LoggedIn;
        ProgressReport;
        logout;
        Players[CurrentPlayer].Active :=False;
        repeat;
        until not(LoggedIn);
        NextPlayer(PlayerStatus);
      until not(Players[CurrentPlayer].Active);
    end.
    Every time the script loops through the players and logs them out and sets their Active status to false.

    When there are no more players left I want the script to stop, but the status bar in scar shows that the script is still running. I have tired entering 'Stop;' just before the final 'end.' command, but this did not work.

    Any Ideas??

    Thanks

    ScarPreRelease 3.23 rev 80, Includes - Dev Rev 457

  2. #2
    Join Date
    Jan 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    try with the terminate script command:
    terminatescript;
    meybe it will work...
    end.

  3. #3
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Do you know what the boolean in NextPlayer does? Because if you do, you're not using it right. If you want to go to the next player, and make the player that's logging out false, you put false in the boolean. Too lazy to explain the rest.

  4. #4
    Join Date
    Mar 2006
    Posts
    3,051
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Yep, Bullzeye95 put his finger on it. You make players.active FALSE, then you do NextPlayer(True), which re-sets your players.active back to TRUE.

  5. #5
    Join Date
    Sep 2006
    Posts
    916
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    begin
    SetupClient;
    repeat;
    SetupPlayer;
    GetPlayerStats;
    Wait(500+Random(1000));
    ProgressReport;
    logout;
    repeat;
    until not(LoggedIn);
    NextPlayer(false);
    until (false);
    end.


    Try that .

  6. #6
    Join Date
    Dec 2006
    Posts
    249
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for your responses.
    I tried the terminate script, but this did not do anything.
    SCAR Code:
    until not(Players[CurrentPlayer].Active);
    terminatescript;
    end.

    I am pretty sure I know about booleans.
    Tarajunky - the code posted has the player.active = false. Did not want the script to them set it back to true.

    Hey321- tried your code and it does exactly the same as the original.

    I should have given a different title to thread. The script works fine, as after the last player is logged out, nothin happens, apart from in the status bar of scar it say's 'Running script...'

    I have noticed that this happens on other scripts (such as Sumillions powerminer).


    So the question is, after all the players have logged out and their active status is set to false, How do you get scar to say script terminated in the status bar?

    ScarPreRelease 3.23 rev 80, Includes - Dev Rev 457

  7. #7
    Join Date
    Mar 2006
    Posts
    3,051
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Try it this way...

    Code:
    begin
      SetupClient;
      repeat;
        SetupPlayer;
        GetPlayerStats;
        Wait(500+Random(1000));
        PlayerStatus := LoggedIn;
        ProgressReport;
        logout;
        Players[CurrentPlayer].Active :=False;
        repeat;
        until not(LoggedIn);
        NextPlayer(Players[CurrentPlayer].Active);
      until not(Players[CurrentPlayer].Active);
    end.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Loop
    By Ethan1221 in forum OSR Help
    Replies: 16
    Last Post: 12-22-2008, 05:31 PM
  2. Nooby Loop Problem :(
    By pianoman933 in forum OSR Help
    Replies: 2
    Last Post: 05-18-2008, 04:01 PM
  3. Problem with if-condition and while loop
    By Repentinus in forum OSR Help
    Replies: 6
    Last Post: 03-27-2008, 10:01 PM
  4. loop problem
    By drizzt in forum OSR Help
    Replies: 5
    Last Post: 02-16-2008, 12:30 AM
  5. Main Loop Problem
    By kryptonite in forum OSR Help
    Replies: 9
    Last Post: 07-25-2007, 02:22 PM

Posting Permissions

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