Results 1 to 4 of 4

Thread: need help with walking

  1. #1
    Join Date
    Aug 2008
    Location
    !!LOL!!
    Posts
    247
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default need help with walking

    i keep getting identifier expected in line 9 please help

    SCAR Code:
    program BucketBuyer;
    {.include SRL/SRL.scar}

    var
    x,y:integer;

    procedure WalkingToStore;
    begin
    function LoadAllDTMWalks(WalkNumber: Integer): Integer;
    var
      dtmMainPoint: TDTMPointDef;
      dtmSubPoints: array[0..7] of TDTMPointDef;
      TempTDTM: TDTM;
    begin
      case WalkNumber of
        1: begin
      dtmMainPoint.x := 839;
      dtmMainPoint.y := 271;
      dtmMainPoint.AreaSize := 0;
      dtmMainPoint.AreaShape := 0;
      dtmMainPoint.Color := FindRoadColor;
      dtmMainPoint.Tolerance := 0;

      dtmSubPoints[0].x := 839;
      dtmSubPoints[0].y := 271;
      dtmSubPoints[0].AreaSize := 0;
      dtmSubPoints[0].AreaShape := 0;
      dtmSubPoints[0].Color := FindRoadColor;
      dtmSubPoints[0].Tolerance := 0;

      dtmSubPoints[1].x := 837;
      dtmSubPoints[1].y := 257;
      dtmSubPoints[1].AreaSize := 0;
      dtmSubPoints[1].AreaShape := 0;
      dtmSubPoints[1].Color := FindRoadColor;
      dtmSubPoints[1].Tolerance := 0;

      dtmSubPoints[2].x := 839;
      dtmSubPoints[2].y := 291;
      dtmSubPoints[2].AreaSize := 0;
      dtmSubPoints[2].AreaShape := 0;
      dtmSubPoints[2].Color := FindRoadColor;
      dtmSubPoints[2].Tolerance := 0;

      dtmSubPoints[3].x := 843;
      dtmSubPoints[3].y := 287;
      dtmSubPoints[3].AreaSize := 0;
      dtmSubPoints[3].AreaShape := 0;
      dtmSubPoints[3].Color := FindRoadColor;
      dtmSubPoints[3].Tolerance := 0;

      dtmSubPoints[4].x := 835;
      dtmSubPoints[4].y := 275;
      dtmSubPoints[4].AreaSize := 0;
      dtmSubPoints[4].AreaShape := 0;
      dtmSubPoints[4].Color := FindRoadColor;
      dtmSubPoints[4].Tolerance := 0;

      dtmSubPoints[5].x := 828;
      dtmSubPoints[5].y := 258;
      dtmSubPoints[5].AreaSize := 0;
      dtmSubPoints[5].AreaShape := 0;
      dtmSubPoints[5].Color := FindRoadColor;
      dtmSubPoints[5].Tolerance := 0;

      dtmSubPoints[6].x := 834;
      dtmSubPoints[6].y := 259;
      dtmSubPoints[6].AreaSize := 0;
      dtmSubPoints[6].AreaShape := 0;
      dtmSubPoints[6].Color := FindRoadColor;
      dtmSubPoints[6].Tolerance := 0;

      dtmSubPoints[7].x := 837;
      dtmSubPoints[7].y := 277;
      dtmSubPoints[7].AreaSize := 0;
      dtmSubPoints[7].AreaShape := 0;
      dtmSubPoints[7].Color := FindRoadColor;
      dtmSubPoints[7].Tolerance := 0;

      TempTDTM.MainPoint := dtmMainPoint;
      TempTDTM.SubPoints := dtmSubPoints;
      Result := AddDTM(TempTDTM);
     end;
    end;

    function WalkToSpot: Boolean;
      var
       WalkDTM: integer; // Calls the WalkDTM making walking simpler.
     begin
       WalkDTM := LoadAllDTMWalks(1); //Load which DDTM you want to find.
       if FindDTM(WalkDTM, X, Y, MMx1,MMy1,MMx2,MMy2) then // Find the DDTM using Find DTM
      begin
        Mouse(X, Y, 5, 5, True);
        WriteLn('Walk Succesfull.');
        FFlag(0);
        Result := True; // If succesfully finds it will click it and wait to flag is gone.
       end;
      end;
    end;

    begin
    SetupSRL;
    Activateclient;
    WalkingToStore;
    end.

  2. #2
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    well this doesn't have to do with your problem, but this will be a problem for you once you get that fixed, you have no tolerance on your DDTM points, and no size, and don't you think that 8 subpoints is a little too much? And maybe if your finding the DDTM on the minimap you should use FindDTMRotated instead of just FindDTM (Scar can find the DTM easier), and as for the line 9 thing,

    SCAR Code:
    procedure WalkingToStore;
    begin
    function LoadAllDTMWalks(WalkNumber: Integer): Integer;

    Thats your problem, you call on a procedure, and you don't end it, and you start a new function, You can't have another function/procedure inside a function/procedure, thats your error, your script should look something like this,

    SCAR Code:
    program BucketBuyer;
    {.include SRL/SRL.scar}

    var
    x,y:integer;

    function LoadAllDTMWalks(WalkNumber: Integer): Integer;
    var
      dtmMainPoint: TDTMPointDef;
      dtmSubPoints: array[0..7] of TDTMPointDef;
      TempTDTM: TDTM;
    begin
      case WalkNumber of
        1: begin
        dtmMainPoint.x := 839;
        dtmMainPoint.y := 271;
        dtmMainPoint.AreaSize := 0;
        dtmMainPoint.AreaShape := 0;
        dtmMainPoint.Color := FindRoadColor;
        dtmMainPoint.Tolerance := 0;

        dtmSubPoints[0].x := 839;
        dtmSubPoints[0].y := 271;
        dtmSubPoints[0].AreaSize := 0;
        dtmSubPoints[0].AreaShape := 0;
        dtmSubPoints[0].Color := FindRoadColor;
        dtmSubPoints[0].Tolerance := 0;

        dtmSubPoints[1].x := 837;
        dtmSubPoints[1].y := 257;
        dtmSubPoints[1].AreaSize := 0;
        dtmSubPoints[1].AreaShape := 0;
        dtmSubPoints[1].Color := FindRoadColor;
        dtmSubPoints[1].Tolerance := 0;

        dtmSubPoints[2].x := 839;
        dtmSubPoints[2].y := 291;
        dtmSubPoints[2].AreaSize := 0;
        dtmSubPoints[2].AreaShape := 0;
        dtmSubPoints[2].Color := FindRoadColor;
        dtmSubPoints[2].Tolerance := 0;

        dtmSubPoints[3].x := 843;
        dtmSubPoints[3].y := 287;
        dtmSubPoints[3].AreaSize := 0;
        dtmSubPoints[3].AreaShape := 0;
        dtmSubPoints[3].Color := FindRoadColor;
        dtmSubPoints[3].Tolerance := 0;

        dtmSubPoints[4].x := 835;
        dtmSubPoints[4].y := 275;
        dtmSubPoints[4].AreaSize := 0;
        dtmSubPoints[4].AreaShape := 0;
        dtmSubPoints[4].Color := FindRoadColor;
        dtmSubPoints[4].Tolerance := 0;

        dtmSubPoints[5].x := 828;
        dtmSubPoints[5].y := 258;
        dtmSubPoints[5].AreaSize := 0;
        dtmSubPoints[5].AreaShape := 0;
        dtmSubPoints[5].Color := FindRoadColor;
        dtmSubPoints[5].Tolerance := 0;

        dtmSubPoints[6].x := 834;
        dtmSubPoints[6].y := 259;
        dtmSubPoints[6].AreaSize := 0;
        dtmSubPoints[6].AreaShape := 0;
        dtmSubPoints[6].Color := FindRoadColor;
        dtmSubPoints[6].Tolerance := 0;

        dtmSubPoints[7].x := 837;
        dtmSubPoints[7].y := 277;
        dtmSubPoints[7].AreaSize := 0;
        dtmSubPoints[7].AreaShape := 0;
        dtmSubPoints[7].Color := FindRoadColor;
        dtmSubPoints[7].Tolerance := 0;

        TempTDTM.MainPoint := dtmMainPoint;
        TempTDTM.SubPoints := dtmSubPoints;
        Result := AddDTM(TempTDTM);
       end;
      end;
    end;

    function WalkingToStore: Boolean;
      var
       WalkDTM: integer; // Calls the WalkDTM making walking simpler.
     begin
       WalkDTM := LoadAllDTMWalks(1); //Load which DDTM you want to find.
       if FindDTM(WalkDTM, X, Y, MMx1,MMy1,MMx2,MMy2) then // Find the DDTM using Find DTM
      begin
        Mouse(X, Y, 5, 5, True);
        WriteLn('Walk Succesfull.');
        FFlag(0);
        Result := True; // If succesfully finds it will click it and wait to flag is gone.
       end;
      end;

    begin
    SetupSRL;
    Activateclient;
    WalkingToStore;
    end.

    I Fixed it up a bit, added standards, hope that helped and you can understand all that (I'm not the best at helping),

    -Blumblebee

  3. #3
    Join Date
    Mar 2008
    Posts
    1,492
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    darn you bumblebee! But yeah, he is right 100% do what he says! lawl

  4. #4
    Join Date
    Aug 2008
    Location
    !!LOL!!
    Posts
    247
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks a lot

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. walking help?
    By Rubix in forum OSR Help
    Replies: 0
    Last Post: 07-15-2008, 02:35 AM
  2. Walking
    By imskate182 in forum OSR Help
    Replies: 4
    Last Post: 12-20-2007, 05:18 AM
  3. Map walking
    By boberman in forum OSR Help
    Replies: 1
    Last Post: 12-06-2007, 12:48 AM
  4. help with walking
    By Jake_453 in forum OSR Help
    Replies: 7
    Last Post: 05-15-2007, 12:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •