Results 1 to 4 of 4

Thread: Compiling Issue

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

    Default Compiling Issue

    I want to make one function which handles the walking with radialwalktolerance (failsafes will be added when the following gets sorted out) So I created a function which depending on what whichway:string, will walk to the trees, the shop, or simply state it couldn't find the starting location.

    SCAR Code:
    function WalkDetails(whichway: string): Array of integer;
    var
      Trees: Array[0..1] of Integer;
    begin
      case lowercase(whichway) of
      'Trees' : Trees := Result := [1,1];//testing again, put anything in there to test
      'Shop' : Trees := Result := [140, 220];
      'NoWhere' : WaitR('Location cannot be found! ', 100, 150, 1, True, True, True, True);//custom function
      end;
    end;

    function WalkToWhere: boolean;
    var
      MapTPA: TPointArray;
      Tries: integer;
    begin
      if WalkDetails('Shop') then Writeln('loaded shop details');//TEMP- only to test (I'll use player loc to determine where to go later)
      FindColorsSpiralTolerance(MMCX, MMCY, MapTPA, LumbyRoad, MMX1, MMY1, MMX2, MMY2, 20);

      if (Length(MapTPA) = 0) then Result := False;
      if (not (rs_OnMiniMap(MapTPA[i].x, MapTPA[i].y))) then Exit;
      repeat
          RadialWalkTolerance(LumbyRoad, Trees[0], Trees[1], 70, 2, 1, 10);


          if (FlagPresent) then
          begin
            Flag;
            Result := True;
            if (Result) then exit;
          end else
          begin
           Inc(Tries);
           Continue;
          end;
      until(Tries = 5 or (not(LoggedIn)));
    end;

    [What i wanted to do]:
    I wanted to make a function which saved StartRadial and EndRadial and kept it for later use. I added it in WalkToWhere:boolean and then tried
    SCAR Code:
    RadialWalkTolerance(LumbyRoad, Trees[0], Trees[1], 70, 2, 1, 10);
    So that it would search depending where the character is.
    __________________________________________________ _______________

    [My Error]
    Well, I've tried everything xD and i still get
    SCAR Code:
    Line 231: [Error] (22850:27): Semicolon (';') expected in script C:\Users\-\Desktop\scarprerelease\Scripts\ScriptDirectory\MyChopper\D's Lumby Chop n Sell.scar
    whenever i run/compile the script.

    Would someone mind looking through the script? I'm really confused of what's happening.

  2. #2
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Maybe like this:
    SCAR Code:
    function WalkDetails(whichway: string): Array of integer;
    var
      Trees: Array[0..1] of Integer;
    begin
      case lowercase(whichway) of
      'Trees' : Trees := [1,1];//testing again, put anything in there to test
      'Shop' : Trees := [140, 220];
      'NoWhere' : WaitR('Location cannot be found! ', 100, 150, 1, True, True, True, True);//custom function
      end;
      Result := Trees;
    end;

    Put whole script next time so its easy to just compile the whole thing.
    There used to be something meaningful here.

  3. #3
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    The array 'Trees' is used in both function but only declared in WalkDetails.

    Not sure if that's whats causing the problem but it should result in a compiling error either way.

  4. #4
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by NCDS View Post
    The array 'Trees' is used in both function but only declared in WalkDetails.

    Not sure if that's whats causing the problem but it should result in a compiling error either way.
    First error wasnt caused by that thought.
    There used to be something meaningful here.

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
  •