Results 1 to 13 of 13

Thread: "Player already logged" in Login.scar

  1. #1
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default "Player already logged" in Login.scar

    Hi

    Shouldn't in Login.scar
    SCAR Code:
    'already'  : begin //Account already logged in
                               Actions := ['Your account is already logged in',0];
                               LastPlayer := CurrentPlayer;
                               repeat
                                 CurrentPlayer := (CurrentPlayer + 1) mod HowManyPlayers;
                                 Wait(200);
                               until (Players[CurrentPlayer].Active) and (CurrentPlayer <> LastPlayer);
    be replaced with something so if you use a 1 player script it won't have an infinate loop in the repeat? Because on a 1 player script the player is probably active but it has until (CurrentPlayer <> LastPlayer) so INFINATE LOOP!

    So whatcha gonna do about it SRL?
    ~ Harry


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  2. #2
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Actually, we have always made that infinity loop on purpose.
    This might allow you to use PHP-> Remote Control, so you can 'restart' your scripts' users. I don't see a problem with this infinite loop.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  3. #3
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Me and other users do For one player scripts...

    Quote Originally Posted by bink830 View Post
    haha, lol
    is there anyway you can add something to make it try to login at least once after a minute if it says you are already logged in?
    Fix please


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

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

    Default

    I'm sorry Wizzup?, but I agree with Hy. I've made a script that is unable to use a certain fuction because of this endless loop. Lets say, all players are false and I need the script to do something AFTER that the payers are false. Won't work because of endless loop. But I've made my own solution to this.

    Maybe made an seectable option..?

  5. #5
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Yeah,... please fix?


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  6. #6
    Join Date
    Feb 2006
    Location
    London, England
    Posts
    2,045
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    Post your fixes then, and we'll check them out...
    SRL Wiki | SRL Rules | SRL Stats
    Ultimate SCAR Scripting Tutorial | Starblaster100's Auth System | Join the official SRL IRC now!


    Help Keep SRL Alive! Please disable Advert Blockers on SRL! Help Keep SRL Alive!


  7. #7
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Replace

    SCAR Code:
    repeat
                                 CurrentPlayer := (CurrentPlayer + 1) mod HowManyPlayers;
                                 Wait(200);
                               until (Players[CurrentPlayer].Active) and (CurrentPlayer <> LastPlayer);

    with

    SCAR Code:
    NextPlayer(True);


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

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

    Default

    Hy, your fix wil still end up in a endless loop. Just look at the procs. EVERY endless loop needs to be taken out.

  9. #9
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    No it should not. NextPlayer does not contain endless loops (UNLESS all players are false )


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

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

    Default

    THATS what I need being fixed. What if I want the script to do someting AFTER that all the players are false?

  11. #11
    Join Date
    Aug 2008
    Location
    Finland
    Posts
    2,851
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Endless loop also prevents ScriptTerminate to proc..

  12. #12
    Join Date
    Mar 2007
    Location
    Alberta, Canada
    Posts
    1,780
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    Quote Originally Posted by marpis View Post
    Endless loop also prevents ScriptTerminate to proc..
    Dude, look at the dates...

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

    Default

    Solution:

    SCAR Code:
    procedure InEndlessLoop;
    begin
      if (AllPlayersInactive) then TerminateScript;
    end;

    then in SetupScript:

    SCAR Code:
    SRL_Procs[srl_InNextPlayerLoop] := @InEndlessLoop;

    or just check the number of inactive players before you call NextPlayer;

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 12-07-2008, 06:48 AM
  2. action="www.site.com" method="post"
    By Jason2gs in forum General
    Replies: 4
    Last Post: 05-17-2007, 11:50 PM
  3. Strange Error in my "BreakOut" player
    By R0b0t1 in forum OSR Help
    Replies: 1
    Last Post: 04-22-2007, 08:01 PM
  4. Replies: 3
    Last Post: 04-19-2007, 03:44 AM
  5. Replies: 5
    Last Post: 10-26-2006, 11:30 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
  •