Results 1 to 5 of 5

Thread: Identifier expected

  1. #1
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Identifier expected

    I'm trying to compile and well i can't
    SCAR Code:
    {.include srl/srl.scar}

    Function FalseAndWrite(Text:String):Boolean;
    Begin
      Result := False;
      WriteLn(Text);
    End;

    Function SetOre(Ore,What:Integer):Integer;
    Begin

      Case What Of
      0:Begin //Colour
          Case Ore Of
            0: Result := 1;//Bronze Colour
            1: Result := 1;//tin colour
            2: Result := 2634057;//Iron colour
          End;
        End;
      1:Begin
          Case Ore Of   //Toll
            0: Result :=1;
            1: Result :=1;
            2: Result :=22;
          End;
        End;
      End;
    End;
     
    Function FindOre(Ore:Integer)  :Boolean;
    Var Time,Colour,Toll,i,a,x,y:Integer;//Time = for failsafe latter
        MyTpa                        :TPointArray;
        ClickPoint                   :TPoint;
    Begin
     
      X      := MSCX
      Y      := MSCY
      Colour := SetOre(Ore,0);
      Toll   := SetOre(Ore,1);
     
      If Not FindColorsSpiralTolerance(x,y,MyTpa,Colour,Msx1,msy1,msx2,msy2,Toll) Then
      Exit;

      For i:= 0 To High(MyTpa) Do
      Begin
        ClickPoint := MyTpa[i]
        Inc(a);
        MMouse(ClickPoint.x,ClickPoint.y,4,4);
      If IsUpText('ine') Then
      Begin
        GetMousePos(x,y);
        Result := True
        If Random(20)=5 Then
        Begin
          Mouse(x,y,0,0,False);
          ChooseOption('ine');
        End Else Mouse(x,y,0,0,True);
        If A>=25 Then
        Begin
          Result := FalseAndWrite('UpText not found after moving mouse 25 time!!!');
          Exit;
        End;
      End;
    End;

     

     






    Begin
    SetupSRL;
    End.
    Code:
    Failed when compiling
    [Error] (22094:4): Identifier expected
    Thanks
    ~Rya
    I see Now, says the blind man

  2. #2
    Join Date
    Jan 2008
    Location
    10° north of Hell
    Posts
    2,035
    Mentioned
    65 Post(s)
    Quoted
    164 Post(s)

    Default

    You're missing a end;

    SCAR Code:
    program test;
    {.include srl/srl.scar}

    function FalseAndWrite(Text: string): Boolean;
    begin
      Result := False;
      WriteLn(Text);
    end;

    function SetOre(Ore, What: Integer): Integer;
    begin
      case What Of
        0: begin //Colour
            case Ore of
              0: Result := 1;//Bronze Colour
              1: Result := 1;//tin colour
              2: Result := 2634057;//Iron colour
            end;
          end;
        1: begin
          case Ore of   //Toll
            0: Result :=1;
            1: Result :=1;
            2: Result :=22;
          end;
        end;
      end;
    end;

    function FindOre(Ore: Integer): Boolean;
    var
      Time, Colour, Toll, i, a, x, y: Integer; //Time = for failsafe latter
      MyTpa: TPointArray;
      ClickPoint: TPoint;
    begin
      X      := MSCX
      Y      := MSCY
      Colour := SetOre(Ore,0);
      Toll   := SetOre(Ore,1);

      if not FindColorsSpiralTolerance(x, y, MyTpa, Colour, MSX1, MSY1, MSX2, MSY2, Toll) then
        Exit;

      for i := 0 to High(MyTpa) do
      begin
        ClickPoint := MyTpa[i]
        Inc(a);
        MMouse(ClickPoint.x, ClickPoint.y, 4, 4);
        if IsUpText('ine') then
        begin
          GetMousePos(x, y);
          Result := True
          if (Random(20) = 5) then
          begin
            Mouse(x, y, 0, 0, False);
            ChooseOption('ine');
          end else
            Mouse(x, y, 0, 0, True);
          if A>=25 then
          begin
            Result := FalseAndWrite('UpText not found after moving mouse 25 time!!!');
            Exit;
          end;
        end;
      end;//<--  Here
    end;

    begin
      SetupSRL;
    end.

    Dg's Small Procedures | IRC Quotes
    Thank Wishlah for my nice new avatar!
    Quote Originally Posted by IRC
    [22:12:05] <Dgby714> Im agnostic
    [22:12:36] <Blumblebee> :O ...you can read minds

  3. #3
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    At the end of the FindOre function, you need an extra end; - you don't indent (actually un-indent) on the "If IsUpText('ine') Then" line, which made it not line up properly - fix this and you see you have a missing end;

    Edit: Dgby cheated!
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  4. #4
    Join Date
    Jan 2008
    Location
    10° north of Hell
    Posts
    2,035
    Mentioned
    65 Post(s)
    Quoted
    164 Post(s)

    Default

    Quote Originally Posted by mixster View Post
    At the end of the FindOre function, you need an extra end; - you don't indent (actually un-indent) on the "If IsUpText('ine') Then" line, which made it not line up properly - fix this and you see you have a missing end;

    Edit: Dgby cheated!
    How did I cheat? LOL

    Dg's Small Procedures | IRC Quotes
    Thank Wishlah for my nice new avatar!
    Quote Originally Posted by IRC
    [22:12:05] <Dgby714> Im agnostic
    [22:12:36] <Blumblebee> :O ...you can read minds

  5. #5
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Dgby714 View Post
    How did I cheat? LOL
    Yea he helped
    I see Now, says the blind man

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
  •