Results 1 to 5 of 5

Thread: Identifier Expected Error

  1. #1
    Join Date
    May 2012
    Posts
    27
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Identifier Expected Error

    This part of my script keeps giving me an identifier expected error, but my number of begins and ends match up. What's wrong?

    Simba Code:
    function FindRock(var x, y, : Integer) : Boolean; // var x, y, : Integer parameter -  Pass in two variables, they get returned if the tree is found  
    var
      a : Integer; // a is a type of Integer
      TPA : TPointArray; // each TPoint has an x/y Integer variable that can be set
      ATPA : T2DPointArray; // The "2D" means it's a two dimentional array
      MP : TPoint; // variable that is set to the TPoint type, named MP for Middle Point
      tmpCTS : Integer; // variable that will hold what the current CTS (Color Tolerance Speed) value is before we alter it
      Box : TBox; // each TBox has an X1, Y1, X2, Y2 variable that can be set
    begin
      if(not(LoggedIn))then Exit;
      tmpCTS := GetColorToleranceSpeed; // set the tmpCTS variable to the current CTS
      ColorToleranceSpeed(2); // We used a CTS of 2 in ACA to find the correct colors
      SetColorSpeed2Modifiers(0.01, 1.49); // These were found in ACA

      FindColorsSpiralTolerance(MSCX, MSCY, TPA, 2383809, MSX1, MSY1, MSX2, MSY2, 20); // search for a color in the area you tell it to, spiraling in an outer motion and returning all the points where it was found and add them to the TPA variable we pass in
      SortTPAFrom(TPA, Point(MSCX, MSCY)); // will sort the TPA from a given point, and here we are telling it to sort it by the center of the screen (MSCX, MSCY) which is where the player is
      ATPA := TPAtoATPAEx(TPA, 15, 15); // split the TPA into boxes with the h/w specified. This helps manage all the points that were found

      for a := 0 to High(ATPA) do
      begin
        MP := MiddleTPA(ATPA[a]);
        Box := IntToBox((MP.X - 20), (MP.Y - 20), (MP.X + 20), (MP.Y + 20));
        {$IFDEF SMART}
        SMART_DrawBoxEx(True, Box, clYellow); // check to see if the user is using SMART, and if so, draw a yellow line around the Box that I set earlier
        {$ENDIF}
        MMouse(MP.X, MP.Y, 4, 4); // move the mouse to the MP with a randomization of 4 for both points
        if(WaitUpText('copper ore', 750))then // wait for 750 miliseconds and to check if the UpText contains "Tree". If it does, then I set the X/Y variables that are passed in to the MP.X/Y coordinates
        begin
          x := MP.X;
          y := MP.Y;
          Result := True; // if the tree is found, the result is true. functions are automatically set to false
          {$IFDEF SMART}
          SMART_ClearCanvas; // clears the SMART canvas if SMART is being used
          {$ENDIF}
          Break; // ends the loop
        end;
      end;

      ColorToleranceSpeed(tmpCTS); // resets variable
      SetColorSpeed2Modifiers(0.2, 0.2); // sets to default
    end;

  2. #2
    Join Date
    Dec 2011
    Location
    Ontario, Canada
    Posts
    1,735
    Mentioned
    5 Post(s)
    Quoted
    89 Post(s)

    Default

    What line is highlighted? Check to make sure the #of ends in the procedure/function before also matches.
    FEEL FREE TO PM ME ABOUT ANYTHING! Will help over Teamviewer...just ask!! "WITH A NEW QUESTION COMES A NEW CHALLENGE"
    Silentcore's AIO Service team !!! Pm me if you want questing done or service done or post on thread ofc

  3. #3
    Join Date
    May 2012
    Posts
    27
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It's the 1st line highlighted.

    this is the first procedure as well. everything before it is fine.

  4. #4
    Join Date
    Dec 2009
    Location
    R_GetPlayerLoc;
    Posts
    2,235
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    You have a coma after parameter y
    "Logic never changes, just the syntax" - Kyle Undefined?

    Remember, The Edit Button Is There For A Reason!!!

  5. #5
    Join Date
    May 2012
    Posts
    27
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Yago View Post
    You have a coma after parameter y
    Thank you very much!

    Such a simple error... >_>

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
  •