Results 1 to 8 of 8

Thread: DoWalk Procedure :)

  1. #1
    Join Date
    May 2007
    Location
    NSW, Australia
    Posts
    2,827
    Mentioned
    3 Post(s)
    Quoted
    25 Post(s)

    Default DoWalk Procedure :)

    This procedure is mainly for heavy walking script making things a bit neater so your walking procedure isnt a bunch of blob

    This function is a combined version of just normal walking types so theres, DDTM, RRW and RW all in one.

    First part of script is all to do with radialwalk, like all the stuff to WalkNumber.

    Walk number is for your DDTM example:

    SCAR Code:
    function LoadAllDDTMWalks(WalkNumber: Integer): Integer;var
      dtmMainPoint: TDTMPointDef;
      dtmSubPoints: array[0..4] of TDTMPointDef;
      TempTDTM: TDTM;
    begin
      case WalkNumber of
        0: begin //Walk To Yews Begins
            dtmMainPoint.x := 628;
            dtmMainPoint.y := 39;
            dtmMainPoint.AreaSize := 2;
            dtmMainPoint.AreaShape := 0;
            dtmMainPoint.Color := FindGERoadColourBH;
            dtmMainPoint.Tolerance := 0;

            dtmSubPoints[0].x := 611;
            dtmSubPoints[0].y := 32;
            dtmSubPoints[0].AreaSize := 1;
            dtmSubPoints[0].AreaShape := 0;
            dtmSubPoints[0].Color := FindGERoadColourBH;
            dtmSubPoints[0].Tolerance := 0;

            dtmSubPoints[1].x := 646;
            dtmSubPoints[1].y := 28;
            dtmSubPoints[1].AreaSize := 1;
            dtmSubPoints[1].AreaShape := 0;
            dtmSubPoints[1].Color := FindGERoadColourBH;
            dtmSubPoints[1].Tolerance := 0;

            dtmSubPoints[2].x := 605;
            dtmSubPoints[2].y := 35;
            dtmSubPoints[2].AreaSize := 1;
            dtmSubPoints[2].AreaShape := 0;
            dtmSubPoints[2].Color := FindGERoadColourBH;
            dtmSubPoints[2].Tolerance := 0;

            dtmSubPoints[3].x := 644;
            dtmSubPoints[3].y := 33;
            dtmSubPoints[3].AreaSize := 1;
            dtmSubPoints[3].AreaShape := 0;
            dtmSubPoints[3].Color := FindGERoadColourBH;
            dtmSubPoints[3].Tolerance := 0;

            dtmSubPoints[4].x := 628;
            dtmSubPoints[4].y := 50;
            dtmSubPoints[4].AreaSize := 1;
            dtmSubPoints[4].AreaShape := 0;
            dtmSubPoints[4].Color := FindGERoadColourBH;
            dtmSubPoints[4].Tolerance := 0;

            TempTDTM.MainPoint := dtmMainPoint;
            TempTDTM.SubPoints := dtmSubPoints;
            Result := AddDTM(TempTDTM);
          end;
    end;
    That walk number is 0 so yea....

    Enjoy!

    SCAR Code:
    function DoWalk(UsingRadial, RadialWalkoverRRW: boolean; roadcolour, start, endr, radius, rx, ry, walknumber, x1, y1, x2, y2: integer): boolean;
    var
      Walk: integer;
      AngleBH: extended;
    begin
      if (UsingRadial) then
      begin
        if (RadialWalkoverRRW) then
        begin
          Result := RadialWalk(RoadColour, start, endr, radius, rx, ry);
          if (Result) then
            Exit;
        end;
        if not (RadialWalkOverRRW) then
        begin
          Result := RadialRoadWalk(RoadColour, start, endr, radius, rx, ry);
          if (Result) then
            Exit;
        end;
      end else
        Walk := LoadAllDDTMWalks(WalkNumber);
      Writeln('Searching for DDTM');
      Result := FindDTMRotated(Walk, X, Y, x1, y1, x2, y2, -Pi, Pi, 0.2, AngleBH);
      if (Result) then
      begin
        Mouse(x, y, 5, 5, true);
        FFlag(2);
      end;
      FreeDTM(Walk);
    end;

    Use: (using DDTM)
    SCAR Code:
    DoWalk(False, False, 0, 0, 0, 0, 0, 0, 1, MMx1, MMy1, MMx2, MMy2)

    Use (Using rrw):
    SCAR Code:
    DoWalk(true, true,findroadcolour,324, 534, 43, 1, 1, MMx1,MMy1,MMx2,MMy2)

  2. #2
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,563
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Example? ow i get it nice work!
    ~Hermen

  3. #3
    Join Date
    May 2007
    Location
    NSW, Australia
    Posts
    2,827
    Mentioned
    3 Post(s)
    Quoted
    25 Post(s)

  4. #4
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,938
    Mentioned
    26 Post(s)
    Quoted
    236 Post(s)

    Default

    oh i like it good job BOBBOSHOBBO

    :P liek your new name hehe

  5. #5
    Join Date
    Mar 2007
    Posts
    4,814
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Nice BH. But a little complecated,no?

    +rep btw.

  6. #6
    Join Date
    May 2007
    Location
    NSW, Australia
    Posts
    2,827
    Mentioned
    3 Post(s)
    Quoted
    25 Post(s)

    Default

    Quote Originally Posted by NaumanAkhlaQ View Post
    Nice BH. But a little complecated,no?

    +rep btw.
    Not complicated in my eyes

  7. #7
    Join Date
    Apr 2007
    Posts
    3,155
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    looks pretty nifty .

    code isnt complicated but personally i'd rather do it myself
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  8. #8
    Join Date
    Apr 2007
    Location
    Michigan -.-
    Posts
    1,358
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)

    Default

    good idea dude, syntax is kinda long so i probably wouldnt use lol...pet peev of mine

    good job and keep it up dude
    METAL HEAD FOR LIFE!!!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Procedure TypeSendRandom & Procedure AutoResponder!
    By Ultra in forum Research & Development Lounge
    Replies: 12
    Last Post: 01-08-2008, 07:04 PM
  2. Help with Procedure
    By Esteban in forum OSR Help
    Replies: 8
    Last Post: 07-06-2007, 03:45 AM
  3. Replies: 8
    Last Post: 05-24-2007, 11:57 PM
  4. Procedure that calls random procedure?
    By Secet in forum OSR Help
    Replies: 2
    Last Post: 03-03-2007, 03:56 PM

Posting Permissions

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