Results 1 to 12 of 12

Thread: Identifier Expected, help please -

  1. #1
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Identifier Expected, help please -

    So I was practicing some scripting and I kept getting this error.
    Line 29: [Error] (21120:1): Identifier expected in script

    Any help, please?

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}

    var X, Y: Integer;

    procedure Antiban;
     begin
      if not(LoggedIn) then
       Exit;
       
      case Random(166) of
       0, 2, 4, 6, 8, 10: MMouse(285, 323, 25, 25);
       1, 3, 5, 7, 9, 11: HoverSkill('Woodcutting',false);
       12, 14, 16, 18, 20: Mouse(509, 282, 20, 20, false);
       21:
          begin
           MakeCompass('N');
           Wait(233+Random(66));
           MakeCompass('W');
           Wait(32+Random(644));
           MakeCompass('S');
          end;
       22, 24, 26, 28, 30: MakeCompass('N');
       23, 25, 27, 29, 31: MakeCompass('S');
       32, 34, 36, 38, 40: MakeCompass('W');
       33, 35, 37, 39, 41: MakeCompass('E');
     end;

    procedure ChopTree;
     begin
      if FindObj(X, Y, 'illow', 9418400, 35) then
       begin
        Mouse(X, Y, 5, 5, false);
         ChooseOption('hop');
          WriteLn('We are now cutting a willow tree!');
           WriteLn('Checking for randoms..');
            FindNormalRandoms;
             repeat
              Wait(3222+Random(1421));
               AntiBan;
             until(InvFull) or not IsUpText('illow');
       end;

      end else

     end;

    begin
    end.

    Thanks in advance.

  2. #2
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}

    var X, Y: Integer;

    procedure Antiban;
     begin
      if not(LoggedIn) then
       Exit;

      case Random(166) of
       0, 2, 4, 6, 8, 10: MMouse(285, 323, 25, 25);
       1, 3, 5, 7, 9, 11: HoverSkill('Woodcutting',false);
       12, 14, 16, 18, 20: Mouse(509, 282, 20, 20, false);
       21:
          begin
           MakeCompass('N');
           Wait(233+Random(66));
           MakeCompass('W');
           Wait(32+Random(644));
           MakeCompass('S');
          end;
       22, 24, 26, 28, 30: MakeCompass('N');
       23, 25, 27, 29, 31: MakeCompass('S');
       32, 34, 36, 38, 40: MakeCompass('W');
       33, 35, 37, 39, 41: MakeCompass('E');
     end;
    end;

    procedure ChopTree;
     begin
      if FindObj(X, Y, 'illow', 9418400, 35) then
       begin
        Mouse(X, Y, 5, 5, false);
         ChooseOption('hop');
          WriteLn('We are now cutting a willow tree!');
           WriteLn('Checking for randoms..');
            FindNormalRandoms;
             repeat
              Wait(3222+Random(1421));
               AntiBan;
             until(InvFull) or not IsUpText('illow');
       end;

      end;

    begin
    end.

    You needed an extra end, line 28.
    then you had end else, then nothing, so I just got rid of that.

    Successfully compiled (2996 ms)

  3. #3
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Oh, thanks, The Man. The 'end else' line was for the rest of my chopping procedure. Thanks again. Appreciate the help.

  4. #4
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    No problem

  5. #5
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    So I have a new error, I was making my DropLogs procedure and here is the error:
    Line 24: [Error] (21115:5): Semicolon (';') expected in script

    Can you help me with this one, please? Or anyone, lol. I double checked the stuff and I can't figure out what's wrong. Even though it's probably a simple fix.

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}

    var X, Y, I: Integer;

    procedure DeclarePlayers;
     begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
     
      Players[0].Name := '';
      Players[0].Pass := '';
      Players[0].Nick := '';
      Players[0].Active:=True;
     end;

    procedure DropLogs;
    var I : Integer;

     begin
      if (not(InvFull)) or (not(LoggedIn)) then
       Exit;
      end else
       for I := 2 to 28 do
        DropItem(I)

     end;

    procedure Antiban;
     begin
      if not(LoggedIn) then
       Exit;

      case Random(166) of
       0, 2, 4, 6, 8, 10: MMouse(285, 323, 25, 25);
       1, 3, 5, 7, 9, 11: HoverSkill('Woodcutting',false);
       12, 14, 16, 18, 20: Mouse(509, 282, 20, 20, false);
       21:
          begin
           MakeCompass('N');
           Wait(233+Random(66));
           MakeCompass('W');
           Wait(32+Random(644));
           MakeCompass('S');
          end;
       22, 24, 26, 28, 30: MakeCompass('N');
       23, 25, 27, 29, 31: MakeCompass('S');
       32, 34, 36, 38, 40: MakeCompass('W');
       33, 35, 37, 39, 41: MakeCompass('E');
     end;
    end;

    procedure ChopTree;
     begin
      if FindObj(X, Y, 'illow', 9418400, 35) then
       begin
        Mouse(X, Y, 5, 5, false);
         ChooseOption('hop');
          WriteLn('We are now cutting a willow tree!');
           WriteLn('Checking for randoms..');
            FindNormalRandoms;
             repeat
              Wait(3222+Random(1421));
               AntiBan;
                DropLogs;
             until(InvFull) or not IsUpText('illow');
      end else
       case  Random(3) of
        0:
          begin
           MakeCompass('N');
            ChopTree;
          end;
        1:
          begin
           MakeCompass('S');
            ChopTree;
          end;
        2:
          begin
           MakeCompass('W');
            ChopTree;
          end;
        3:
          begin
           MakeCompass('E');
            ChopTree;
          end;
       end;

      end;

    begin
    SetupSRL;
    ActivateClient;
    DeclarePlayers;
    ClearDebug;
    ChopTree;
    end.

  6. #6
    Join Date
    Aug 2009
    Location
    Inside the Matrix...yes it has me, and it has you too.
    Posts
    1,896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    procedure DropLogs;
    var I : Integer;

     begin
      if (not(InvFull)) or (not(LoggedIn)) then
       Exit;
      end else
       for I := 2 to 28 do
        DropItem(I); //forgot the semi colon here

     end;

    there you go
    NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN

  7. #7
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    That did fix one possible future problem, but I'm still getting the error. Any help, please?

    SCAR Code:
    procedure DropLogs;
    var I : Integer;

     begin
      if (not(InvFull)) or (not(LoggedIn)) then
       Exit;
      end else
       for I := 2 to 28 do
        DropItem(I);

     end;

  8. #8
    Join Date
    May 2007
    Location
    Ohio
    Posts
    2,296
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Risk View Post
    That did fix one possible future problem, but I'm still getting the error. Any help, please?

    SCAR Code:
    procedure DropLogs;
    var I : Integer;

     begin
      if (not(InvFull)) or (not(LoggedIn)) then
       Exit;
      end else
       for I := 2 to 28 do
        DropItem(I);

     end;
    Restart scar.

  9. #9
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    SCAR Code:
    {.include SRL/SRL.scar}

    var X, Y, I: Integer;

    procedure DeclarePlayers;
     begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name := '';
      Players[0].Pass := '';
      Players[0].Nick := '';
      Players[0].Active:=True;
     end;

    procedure DropLogs;
    var I : Integer;
     begin
      if (not(InvFull)) or (not(LoggedIn)) then
      begin
       Exit;
      end else
       begin
       for I := 2 to 28 do
        DropItem(I);
       end;
     end;

    procedure Antiban;
     begin
      if not(LoggedIn) then
       Exit;

      case Random(166) of
       0, 2, 4, 6, 8, 10: MMouse(285, 323, 25, 25);
       1, 3, 5, 7, 9, 11: HoverSkill('Woodcutting',false);
       12, 14, 16, 18, 20: Mouse(509, 282, 20, 20, false);
       21:
          begin
           MakeCompass('N');
           Wait(233+Random(66));
           MakeCompass('W');
           Wait(32+Random(644));
           MakeCompass('S');
          end;
       22, 24, 26, 28, 30: MakeCompass('N');
       23, 25, 27, 29, 31: MakeCompass('S');
       32, 34, 36, 38, 40: MakeCompass('W');
       33, 35, 37, 39, 41: MakeCompass('E');
     end;
    end;

    procedure ChopTree;
     begin
      if FindObj(X, Y, 'illow', 9418400, 35) then
       begin
        Mouse(X, Y, 5, 5, false);
         ChooseOption('hop');
          WriteLn('We are now cutting a willow tree!');
           WriteLn('Checking for randoms..');
            FindNormalRandoms;
             repeat
              Wait(3222+Random(1421));
               AntiBan;
                DropLogs;
             until(InvFull) or not IsUpText('illow');
      end else
       case  Random(3) of
        0:
          begin
           MakeCompass('N');
            ChopTree;
          end;
        1:
          begin
           MakeCompass('S');
            ChopTree;
          end;
        2:
          begin
           MakeCompass('W');
            ChopTree;
          end;
        3:
          begin
           MakeCompass('E');
            ChopTree;
          end;
       end;

      end;

    begin
    SetupSRL;
    ActivateClient;
    DeclarePlayers;
    ClearDebug;
    ChopTree;
    end.

    You guys suck :P
    He just needed a begin, and the ";"

    Successfully compiled (3485 ms)

  10. #10
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    @ Timer: Nah, that didn't work. Thanks though.
    @ The Man: What exactly did you do? That worked. All you did was add a new 'begin' and 'end', right?

    Thanks btw @ Everyone who attempted to help. Appreciate it.

  11. #11
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Yep

  12. #12
    Join Date
    Aug 2009
    Location
    Inside the Matrix...yes it has me, and it has you too.
    Posts
    1,896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by The Man View Post
    You guys suck :P
    He just needed a begin, and the ";"

    Successfully compiled (3485 ms)
    NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN

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
  •