Results 1 to 2 of 2

Thread: nextplayer

  1. #1
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default nextplayer

    Granted this suggestion isn't a priority, perhaps not even necessary, yet I thought I'd suggest adding in a timeout fail safe in the nextplayer proc. Perhaps I'm misunderstanding the login.simba file too, so if that's the case, ignore / close this suggestion; just trying to offer help ^.^

    Simba Code:
    procedure NextPlayer(Active: Boolean);
    var
      srl_PlayerIndexFunc: function: Integer;
      cP: Integer;
    begin
      if (RandomPlayer) then
        srl_PlayerIndexFunc := @RandomPlayerIndex
      else
        srl_PlayerIndexFunc := @NextPlayerIndex;

      WriteLn('NextPlayer(' + BoolToStr(Active) + ')');
      LogOut;
      cP := srl_PlayerIndexFunc();
      while (cP = -1) do
      begin
        cP := srl_PlayerIndexFunc();
        if (SRL_Procs[srl_InNextPlayerLoop] <> nil) then
          SRL_Procs[srl_InNextPlayerLoop]();
        Wait(5000);//Endless loop
      end;

      SwitchToPlayer(cP, Active);
    end;
    to include a failsafe?
    Simba Code:
    procedure NextPlayer(Active: Boolean);
    var
      srl_PlayerIndexFunc: function: Integer;
      cP, t: Integer;
    begin
      if (RandomPlayer) then
        srl_PlayerIndexFunc := @RandomPlayerIndex
      else
        srl_PlayerIndexFunc := @NextPlayerIndex;

      WriteLn('NextPlayer(' + BoolToStr(Active) + ')');
      LogOut;
      cP := srl_PlayerIndexFunc();
      while (cP = -1) do
      begin
        cP := srl_PlayerIndexFunc();
        if (SRL_Procs[srl_InNextPlayerLoop] <> nil) then
          SRL_Procs[srl_InNextPlayerLoop]();
        Wait(5000);
        if (timefrommark(t)>120000) then
          srl_Warn('NextPlayer', 'Failure in switching to the next player', warn_AllVersions);
      end;

      SwitchToPlayer(cP, Active);
    end;

    cheers,
    Lj

  2. #2
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    There's a post on how to control this in your script, I'll try and find it for you when I get home
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


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
  •