Results 1 to 10 of 10

Thread: NextPlayer

  1. #1
    Join Date
    Nov 2008
    Posts
    27
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default NextPlayer

    Ok, so its really starting to piss me off, ho do i break the infinate loop that happens because of NextPlayer!? i cant for the life of me do it, and it makes me rather angry as im impatient.

  2. #2
    Join Date
    Oct 2006
    Location
    United States
    Posts
    672
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Viral View Post
    Ok, so its really starting to piss me off, ho do i break the infinate loop that happens because of NextPlayer!? i cant for the life of me do it, and it makes me rather angry as im impatient.
    so you want to know how to repeat until a certain time?

  3. #3
    Join Date
    Nov 2008
    Posts
    27
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    no haha, when using NextPlayer(false); it brings the script into an infinate loop, and its a piss off haha, so i was wondering if there was a way around that

  4. #4
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    Actually, it's meant to be like that.
    Me and a vast amount of other people have tried to do something, but the devs ands admins do not want to change it for some bizarre reason.


    So, yeah, I understand how you feel.

  5. #5
    Join Date
    Nov 2008
    Posts
    27
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    haha ok thanks for clarifying, I was just wondering if i was doing something wrong maybe

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

    Default

    Explain??


  7. #7
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by tarajunky View Post
    Explain??
    SCAR Code:
    procedure NextPlayer(Active: Boolean);
    begin
      if RandomPlayer then
        RandomNextPlayer(Active)
      else
      begin
        WriteLn('NextPlayer(Active: ' + BoolToStr(Active)+ ');');
        Players[CurrentPlayer].Active := Active;
        Logout;
        PlayerCurTime := (GetSystemTime div 1000);
        Players[CurrentPlayer].Worked := Players[CurrentPlayer].Worked +
          ((PlayerCurTime - PlayerStartTime) / 60);
        CurrentPlayer := (CurrentPlayer + 1) mod Length(Players);
        while Players[CurrentPlayer].Active = False do
        begin
          CurrentPlayer := (CurrentPlayer + 1) mod Length(Players);
          if (AllPlayersInactive) then Wait(60000); // Everybody False. Endless Loop.
        end;
        SRL_Logs := SRL_Logs + 1;
        LoginPlayer;
      end;
    end;

    SCAR Code:
    while Players[CurrentPlayer].Active = False do
        begin
          CurrentPlayer := (CurrentPlayer + 1) mod Length(Players);
          if (AllPlayersInactive) then Wait(60000); // Everybody False. Endless Loop.
        end;

    What is there to explain?
    Endless loop.


    Edit: Can't we replace that endless loop with TerminateScript, so ScriptTerminate can get an even more significant role in scripts?

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

    Default

    The one downside to changing that would be if you had an active playerform, where you could reset your players and keep the script running, the current loop would allow you to do that.

    That infinite loop should never be a problem, though. If all your players are inactive, why would you want to do anything else?


  9. #9
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by tarajunky View Post
    The one downside to changing that would be if you had an active playerform, where you could reset your players and keep the script running, the current loop would allow you to do that.

    That infinite loop should never be a problem, though. If all your players are inactive, why would you want to do anything else?
    Shut down the computer!

    I think that should be prioritized over an active playerform, no?


    Edit: Thanksalot, Zeph! ^^!

  10. #10
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Oh well next revision you should be able to bypass the need to break the loop anyway.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. NextPlayer help
    By king vash in forum OSR Help
    Replies: 4
    Last Post: 03-28-2007, 12:54 AM
  2. randoms and nextplayer
    By macromacro123 in forum OSR Help
    Replies: 1
    Last Post: 03-12-2007, 03:01 AM
  3. false and nextplayer
    By macromacro123 in forum OSR Help
    Replies: 1
    Last Post: 03-05-2007, 04:21 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
  •