Results 1 to 10 of 10

Thread: Identifier Expected

  1. #1
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default Identifier Expected

    So for the last few weeks I've been working on a complete re-vamp of my old powerchopper and decided to make it banking too, but its getting very annoying with the old errors. I've fixed a few but this one refuses to budge..

    SCAR Code:
    function WalkTo(InBank: boolean): boolean;
    var
      x, y, WaterColor: integer;
    begin
      case lowercase(Players[CurrentPlayer].Loc) of
        'draynor':
        begin
          if InBank then
          begin
            if (not (FindSymbol(x, y, 'fish'))) then
            begin
              MakeCompass('W');
              WaterColor := FindWaterColor;
              RadialWalk(WaterColor, 225, 351, 64, 2, 2);
              Flag;
            end else
              if (FindSymbol(x, y, 'fish')) then
              begin
                Mouse(x, y, 2, 2, true);
                Flag;
                Writeln('Got to Willows');
              end;
            end;
          end else
          begin
            if (not (FindSymbol(x, y, 'bank'))) then
            begin
              MakeCompass('N');
              RadialWalk(6318184, 20, 50, 34, 2, 2);
              Flag;
            end;
            if (FindSymbol(x, y, 'bank')) then
            begin
              Mouse(x, y, 2, 2, true);
              Flag;
            end;
          end;
        end;
        'seers':
        begin
          if InBank then
            Wait(1000+Random(500));
            RadialWalk(1611268, 5, 30, 75, 5, 5);
            FFlag(2);
          else
            if (not(FindSymbol(x, y, 'bank'))) then
            begin
              if RadialWalk(6318184, 210, 240, 30, 5, 5) then
              Mouse(x, y, 2, 2, true);
              FFlag(1);
            end else
              if (FindSymbol(x, y, 'bank')) then
              begin
                Mouse(x, y, 2, 2, true);
                FFlag(2);
              end;
            end;
          end;
        end;
      end;
    end;

    The error is on the 'seers': line.

    Any help is greatly appreciated!
    Jus' Lurkin'

  2. #2
    Join Date
    Oct 2007
    Location
    http://ushort.us/oqmd65
    Posts
    2,605
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Try

    SCAR Code:
    function WalkTo(InBank: boolean): boolean;
    var
      x, y, WaterColor: integer;
    begin
      case lowercase(Players[CurrentPlayer].Loc) of
        'draynor': begin
          if InBank then
          begin
            if (not (FindSymbol(x, y, 'fish'))) then
            begin
              MakeCompass('W');
              WaterColor := FindWaterColor;
              RadialWalk(WaterColor, 225, 351, 64, 2, 2);
              Flag;
            end else
              if (FindSymbol(x, y, 'fish')) then
              begin
                Mouse(x, y, 2, 2, true);
                Flag;
                Writeln('Got to Willows');
              end;
            end;
          end else
            begin
              if (not (FindSymbol(x, y, 'bank'))) then
              begin
                MakeCompass('N');
                RadialWalk(6318184, 20, 50, 34, 2, 2);
                Flag;
              end;
              if (FindSymbol(x, y, 'bank')) then
              begin
                Mouse(x, y, 2, 2, true);
                Flag;
              end;
            end;
          end;
        end;
        'seers':
        begin
          if InBank then
            Wait(1000+Random(500));
            RadialWalk(1611268, 5, 30, 75, 5, 5);
            FFlag(2);
          else
            if (not(FindSymbol(x, y, 'bank'))) then
            begin
              if RadialWalk(6318184, 210, 240, 30, 5, 5) then
              Mouse(x, y, 2, 2, true);
              FFlag(1);
            end else
              if (FindSymbol(x, y, 'bank')) then
              begin
                Mouse(x, y, 2, 2, true);
                FFlag(2);
              end;
            end;
          end;
        end;
      end;
    end;
    I do visit every 2-6 months

  3. #3
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    ZaSz, [Error] (20324:1): 'BEGIN' expected in script

    :<
    Jus' Lurkin'

  4. #4
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    would changing:

    SCAR Code:
    'seers':
        begin
          if InBank then
            Wait(1000+Random(500));
            RadialWalk(1611268, 5, 30, 75, 5, 5);
            FFlag(2);
          else

    to:

    SCAR Code:
    'seers':
        begin
          if InBank then
          begin
            Wait(1000+Random(500));
            RadialWalk(1611268, 5, 30, 75, 5, 5);
            FFlag(2);
          end else

    do anything?

  5. #5
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    It does not Warrior
    Jus' Lurkin'

  6. #6
    Join Date
    Oct 2007
    Location
    http://ushort.us/oqmd65
    Posts
    2,605
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Well, Identifier Expected usually means that an end; is missing, so plug in a end or 2 at places
    I do visit every 2-6 months

  7. #7
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    I just counted, and there's about 4 too many ends. That's why it's saying "BEGIN expected".

    Richard.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  8. #8
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    If your stanards were correct then the problem would be simply to solve..

    Fixed standards on your broken procedure
    SCAR Code:
    Function WalkTo(InBank: Boolean): Boolean;
     Var
      x, y, WaterColor: Integer;
    Begin
      Case LowerCase(Players[CurrentPlayer].Loc) Of
       'draynor':
        Begin
          If InBank Then
          Begin
            If (Not (FindSymbol(x, y, 'fish'))) Then
            Begin
              MakeCompass('W');
              WaterColor := FindWaterColor;
              RadialWalk(WaterColor, 225, 351, 64, 2, 2);
              Flag;
            End Else If (FindSymbol(x, y, 'fish')) Then
            Begin
              Mouse(x, y, 2, 2, True);
              Flag;
              Writeln('Got to Willows');
            End;
          End;
        End Else
          Begin
            If (Not (FindSymbol(x, y, 'bank'))) Then
            Begin
              MakeCompass('N');
              RadialWalk(6318184, 20, 50, 34, 2, 2);
              Flag;
            End;
            If (FindSymbol(x, y, 'bank')) Then
            Begin
              Mouse(x, y, 2, 2, True);
              Flag;
            End;
          End;
      End;
    End;

        'seers': Begin
          If InBank Then Wait(1000 + Random(500));
            RadialWalk(1611268, 5, 30, 75, 5, 5);
            FFlag(2);
          Else If (Not (FindSymbol(x, y, 'bank'))) Then
            Begin
              If RadialWalk(6318184, 210, 240, 30, 5, 5) Then
     Mouse(x, y, 2, 2, True);
              FFlag(1);
            End Else If (FindSymbol(x, y, 'bank')) Then
              Begin
                Mouse(x, y, 2, 2, True);
                FFlag(2);
              End;
            End;

          End;

        End;

      End;

    End;

    Fixed script with standards
    SCAR Code:
    Function WalkTo(InBank: Boolean): Boolean;
     Var
      x, y, WaterColor: Integer;
    Begin
      Case LowerCase(Players[CurrentPlayer].Loc) Of
       'draynor':
        Begin
          If InBank Then
          Begin
            If (Not (FindSymbol(x, y, 'fish'))) Then
            Begin
              MakeCompass('W');
              WaterColor := FindWaterColor;
              RadialWalk(WaterColor, 225, 351, 64, 2, 2);
              Flag;
            End Else If (FindSymbol(x, y, 'fish')) Then
            Begin
              Mouse(x, y, 2, 2, True);
              Flag;
              Writeln('Got to Willows');
            End;
          End Else
          Begin
            If (Not (FindSymbol(x, y, 'bank'))) Then
            Begin
              MakeCompass('N');
              RadialWalk(6318184, 20, 50, 34, 2, 2);
              Flag;
            End;
            If (FindSymbol(x, y, 'bank')) Then
            Begin
              Mouse(x, y, 2, 2, True);
              Flag;
            End;
          End;
        End;
       'seers':
        Begin
          If InBank Then
          Begin
            Wait(1000 + Random(500));
            RadialWalk(1611268, 5, 30, 75, 5, 5);
            FFlag(2);
          End;
          If (Not (FindSymbol(x, y, 'bank'))) Then
          Begin
            If RadialWalk(6318184, 210, 240, 30, 5, 5) Then
              Mouse(x, y, 2, 2, True);
            FFlag(1);
          End Else If (FindSymbol(x, y, 'bank')) Then
          Begin
            Mouse(x, y, 2, 2, True);
            FFlag(2);
          End;
        End;
      End;
    End;

    Yes i capitalise keywords .

    Your End Else was placed incorrect it was Ending else on the draynor: case which isnt any good. It needs to end else on your Begin of draynor case.

    SCAR Code:
    If InBank Then
          Begin
            If (Not (FindSymbol(x, y, 'fish'))) Then
            Begin
              MakeCompass('W');
              WaterColor := FindWaterColor;
              RadialWalk(WaterColor, 225, 351, 64, 2, 2);
              Flag;
            End Else If (FindSymbol(x, y, 'fish')) Then
            Begin
              Mouse(x, y, 2, 2, True);
              Flag;
              Writeln('Got to Willows');
            End;
          End Else

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  9. #9
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    rogeruk, thank you so much! You are awesome! XD
    Jus' Lurkin'

  10. #10
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Not a problem. Anything to help a fellow member.

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

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
  •