Results 1 to 7 of 7

Thread: Help repeat error

  1. #1
    Join Date
    Jul 2008
    Posts
    49
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Help repeat error

    Hey i want my script to repeat the main procedure until (LoadsNum = LoadsPerPlayer) or (not LoggedIn) or (StartTime = 21600000) and if that happens go to the nextplayer here is the code i get the error

    Line 229: [Error] (18591:1): Identifier expected in script C:\Program Files\SCAR 3.20\Scripts\WoodCutting Members.scar

    SCAR Code:
    begin
      SetupSRL;
      DeclarePlayers;
      LoginPlayer;
      SetupScript;
      repeat
        MainProc;
      until(LoadsNum = LoadsPerPlayer) or (not LoggedIn) or (StartTime = 21600000);
      NextPlayer(false);
      until(False);
    end.

  2. #2
    Join Date
    Feb 2007
    Posts
    143
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    what line is number 229?

    and to make that repeat until thing more readable you could make a new function
    Code:
    function stop:boolean;
    begin
       if((LoadsNum = LoadsPerPlayer) or (not(LoggedIn)) or (StartTime >= 21600000)) then
          result := true;
       else result := false;
    end;
    then instead just put

    Code:
    until(stop);
    make sure that starttime >= or else you will more than likely not end the loop
    Last edited by rogue poser; 06-13-2009 at 08:15 AM.

  3. #3
    Join Date
    Nov 2008
    Location
    Melbourne, Australia
    Posts
    2,240
    Mentioned
    3 Post(s)
    Quoted
    11 Post(s)

    Default

    You have 1 repeat and 2 Until();
    Click here to find out how to get full screen without members! | Click here to check out my Ultimate Bitmap Tutorial! Edited to work with Simba! |

  4. #4
    Join Date
    Mar 2007
    Posts
    3,116
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Your missing a repeat

    Edit: I've been ninja'd...

  5. #5
    Join Date
    Jul 2008
    Posts
    49
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ive put this in should work:
    SCAR Code:
    begin
      SetupSRL;
      DeclarePlayers;
      lblPlayers:
      LoginPlayer;
      SetupScript;
      repeat
        MainProc;
        if ( not LoggedIn) then
        NextPlayer(false);
      until(LoadsNum = LoadsPerPlayer) or (StartTime = 21600000);
      NextPlayer(true);
      goto lblPlayers;
    end.

  6. #6
    Join Date
    Feb 2007
    Posts
    143
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    im not sure how your start time updates, but once again you should make it >= or else it probably wont work

    if start time = 21600001 then it will not end the loop

  7. #7
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You can not use goto in a loop. Also, that won't work .

    Edit: Crap, I'm off my game today. I am just soo tired . That would work but labels are not advised because they can be replaced with other loops. And you can just as easily use another repeat instead of labels.
    Last edited by Da 0wner; 06-13-2009 at 08:33 AM.

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
  •