Results 1 to 4 of 4

Thread: Indentifier Expected

  1. #1
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Indentifier Expected

    I know what it means and how to fix it, but i cannot see how i would fix it here. I've been looking through my script for almost an hour and cannot find the cause! Can somebody look through.
    The Identifier Expected is on line 314:
    SCAR Code:
    if (EnterWaitingRoom) then (WalkInRoom);

    Here's the whole script:
    SCAR Code:
    program New;
    {.include SRL\SRL\Misc\Smart.scar}
    {.include srl/srl.scar}
    var
    x, y, i: integer;

    const
      LoadsToDo = 50;
      SmartWorld= 44;  //Smart World?
      SignedC= False;  //Use signed client?
      Team= 'blue';

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

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

    procedure FindNormalRandom;
    begin
      LampSkill := 'strength';
      if FindNormalRandoms then UseRewardBox;
      solvesrlrandoms:=true;
    end;

    procedure AntiBan;
    begin
      case random(80) of
      0: MouseBox(MSX1, MSY1, MSX2, MSY2,3);
      1: RandomMovement;
      2: RandomRClick;
      3: BoredHuman;
      4: PickUpMouse;
      5: SleepAndMoveMouse(50);
      6: HoverSkill('random', false);
      7: Exit;
      end;
    end;

    function OpenBankChest: boolean;
    var
    tpa : TPointArray;
    begin
      MakeCompass('S');
      SetAngle(True);
      Findcolorstolerance(TPA, 4676201, msx1, msy2, msx2, msy2, 10);
      if Length(tpa) = 0 then FindColorsTolerance(tpa, 8750479, MSX1, MSY1, MSX2, MSY2, 10);
      for i:= 0 to high(tpa) do
      begin
        MMouse(tpa[i].x, tpa[i].y,0,0);
        if IsUpTextMultiCustom(['ank','hest']) then
        begin
          Result := True;
          GetMousePos(x,y);
          Mouse(x, y, 0, 0, True);
          Exit;
        end;
      end;
    end;

    function EnterWaitingRoom: boolean;
    var
    tpa : TPointArray;
    begin
      case (Team) of
      'blue':
      begin
        Findcolorstolerance(TPA, 8215375, msx1, msy2, msx2, msy2, 10);
        if Length(tpa) = 0 then FindColorsTolerance(tpa, 14647666, MSX1, MSY1, MSX2, MSY2, 10);
        for i:= 0 to high(tpa) do
        begin
          MMouse(tpa[i].x, tpa[i].y,0,0);
          if IsUpTextMultiCustom(['lue','arrier']) then
          begin
            Result := True;
            GetMousePos(x,y);
            Mouse(x, y, 0, 0, True);
            Flag;
            Exit;
          end;
        end;
      end;
      'red':
        begin
          Findcolorstolerance(TPA, 4739780, msx1, msy2, msx2, msy2, 10);
          if Length(tpa) = 0 then FindColorsTolerance(tpa, 14803711, MSX1, MSY1, MSX2, MSY2, 10);
          for i:= 0 to high(tpa) do
          begin
            MMouse(tpa[i].x, tpa[i].y,0,0);
            if IsUpTextMultiCustom(['ed','arrier']) then
            begin
              Result := True;
              GetMousePos(x,y);
              Mouse(x, y, 0, 0, True);
              Flag;
              Exit;
            end;
          end;
        end;
      end;
    end;

    procedure WalkToChest;
    begin
      if FindSymbol(x, y, 'bank') then Mouse(x, y, 5, 5, True) else
      if FindSymbol(x, y, 'minigame') then
      begin
        MakeCompass('W');
        Fflag(random(10));
      end;
    end;

    function DetectedCape: boolean;
    begin
      if WearingItem(2) then
      begin
        TakeOff(2);
        Result := True;
      end;
    end;

    function SWRoadColor: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
      R, G, B: Integer;
      X, Y, Z: Extended;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.53, 0.17);

      FindColorsSpiralTolerance(MMCX, MMCY, arP, 6122868, MMX1, MMY1, MMX2, MMY2, 5);
      if (Length(arP) = 0) then
      begin
        Writeln('Failed to find the road color, no result.');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      for i := 0 to arL do
      begin
        ColorToRGB(arC[i], R, G, B);

        if (R >= 102) and (R <= 131) and (G >= 96) and (G <= 123) and (B >= 81) and (B <= 104) then
        begin
          ColorToXYZ(arC[i], X, Y, Z);

          if (X >= 11.37) and (X <= 18.39) and (Y >= 12.02) and (Y <= 19.41) and (Z >= 9.68) and (Z <= 15.58) then
          begin
            Result := arC[i];
            Writeln('RoadColor = ' + IntToStr(arC[i]));
            Break;
          end;
        end;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      if (i = arL + 1) then
        Writeln('Failed in finding the color.');
    end;

    function FindLavaColor: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
      R, G, B: Integer;
      X, Y, Z: Extended;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.59, 0.38);

      FindColorsSpiralTolerance(MMCX, MMCY, arP, 1749715, MMX1, MMY1, MMX2, MMY2, 3);
      if (Length(arP) = 0) then
      begin
        Writeln('Failed to find the lava color, no result.');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      for i := 0 to arL do
      begin
        ColorToRGB(arC[i], R, G, B);

        if (R >= 199) and (R <= 223) and (G >= 150) and (G <= 205) and (B >= 23) and (B <= 29) then
        begin
          ColorToXYZ(arC[i], X, Y, Z);

          if (X >= 35.04) and (X <= 50.73) and (Y >= 34.47) and (Y <= 58.19) and (Z >= 5.71) and (Z <= 9.61) then
          begin
            Result := arC[i];
            Writeln('Lava Color = ' + IntToStr(arC[i]));
            Break;
          end;
        end;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      if (i = arL + 1) then
        Writeln('Failed in finding the lava color.');
    end;

    function ChestWalk: boolean;
    begin
      case (Team) of
      'red': begin RadialWalk(FindLavaColor, 180, 0, 65, -1, -1); MakeCompass('E'); FFlag(random(20)); Result:= True; end;

      'blue': begin RadialWalk(FindWaterColor, 180, 270, 65, -1, -1); MakeCompass('W'); FFlag(random(20)); Result:= True; end;
      end;
    end;

    procedure BankItems;
    begin
      WalkToChest;
      FFlag(random(10));
      Writeln('We have arrived at the banking chest.');
      if OpenBankChest then
      begin
        Writeln('We found the bank chest!');
        wait(5000+random(5000));
        if BankScreen then
        begin
          Writeln('I think we just found the banking screen.');
          DepositAll;
          CloseWindow;
          wait(1000+random(1000));
          MakeCompass('N');
         if (ChestWalk) then Writeln('We have clicked near the portal region.') else
         begin
            Writeln('We couldn''t walk back to the portal area, so we are terminating.');
            Wait(1000+random(500));
            LogOut;
            TerminateScript;
          end;
        end else
        begin
          Writeln('Something went Wrong! We couldn''t find the bankscreen!');
          TerminateScript;
        end;
      end else
      begin
        Writeln('We couldn''t open the bank chest.');
        TerminateScript;
      end;
    end;

    function InRoom: Boolean;
    var
    TPA: TPointArray;
    begin
      case (Team) of
      'blue':
            if not Findcolorstolerance(TPA, FindLavaColor, msx1, msy2, msx2, msy2, 10) then Result := True;
      'red':
            if not Findcolorstolerance(TPA, FindWaterColor, msx1, msy2, msx2, msy2, 10) then Result := True;
      end;
    end;

    procedure WalkInRoom;
    begin
      Writeln('We are walking inside the Waiting room');
      case (Team) of
      'red': RadialWalk(FindLavaColor, 270, 280, 65, -1, -1);
      'blue': RadialWalk(FindWaterColor, 270, 280, 65, -1, -1);
      end;
    end;

    begin
      Smart_Server:= (SmartWorld);
      Smart_Members:= True;
      Smart_Signed:= (SignedC);
      Smart_SuperDetail:= false;
      SetupSRL;
      ActivateClient;
      DeclarePlayers;
      LogInPlayer;
      Wait(10000+random(25000));
      SetRun(True);
      repeat
        if (DetectedCape) then BankItems else
        begin
          SetAngle(False);
          case (Team) of
          'red': MakeCompass('E');
          'blue': MakeCompass('W');
          end;
        end;
        if (not(InRoom)) then
        begin
          Writeln('We are entering the '+ (Team) +' team.');
          if (EnterWaitingRoom) then (WalkInRoom);
        end;
      until (True);
    end.

  2. #2
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Take out the brackets.

    SCAR Code:
    if (EnterWaitingRoom) then WalkInRoom;

  3. #3
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Wow, i can't believe I made that mistake..

  4. #4
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by DeSnob View Post
    Wow, i can't believe I made that mistake..
    Haha don't worry, I've made little mistakes like that thousands of times.

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
  •