Results 1 to 3 of 3

Thread: Personal Walking Procedure Help.

  1. #1
    Join Date
    Dec 2011
    Posts
    1,162
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Personal Walking Procedure Help.

    Simba Code:
    procedure Walker(Path: TPointArray);
    var
      I, H, T, D: integer;
      P, MM, A, B: TPoint;
    begin
      H := High(Path);
      begin

        P := SPS_GetMyPos;
        for I := H downto 0 do
        begin
        A := Sps_GetMyPos;
            MM.X := MMCX + Path[I].X - P.X;
              MM.Y := MMCY + Path[I].Y - P.Y;

          D := Distance(MM.X, MM.Y, MMCX, MMCY);

          if (D < 10) then
            break
          else
            if (D < 70) then
            begin
              if (SPS_MultiMouse) then
                MultiMouse(MM.X, MM.Y, 25, 3, false)
              else
                Mouse(MM.X, MM.Y, 1, 1, mouse_Left);

              FFlag(Integer(I <> H) * 15);
                repeat
                Wait(50);
                until Not isMoving;

                B := Sps_GetMyPos;
                    if (Distance(A.X, A.Y, B.X, B.Y) < 6) then Exit;
                     If InFight or BlueDead then Exit;

                Break;
            end;
        end;


      end;
    end;

    Wont move or do anything.

  2. #2
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    There are a few logical flaws in it.

    Simba Code:
    P := SPS_GetMyPos;
        for I := H downto 0 do
        begin
        A := Sps_GetMyPos;
            MM.X := MMCX + Path[I].X - P.X;
              MM.Y := MMCY + Path[I].Y - P.Y;

    probably should be something like:

    Simba Code:
    for I := H downto 0 do
        begin
        P := Sps_GetMyPos;
        MM.X := MMCX + Path[I].X - P.X;
        MM.Y := MMCY + Path[I].Y - P.Y;

    Just use some debugging to get more information. Does it find your position? Are the required maps loaded? Maybe P is always 0,0 and that's why distance will always be > 70. I need more information.

    edit:
    I've never used SPS before, but shouldn't D be; D := Distance(parth[i].X, parth[i].Y, P.X, P.Y);
    Last edited by masterBB; 04-14-2012 at 05:18 PM.
    Working on: Tithe Farmer

  3. #3
    Join Date
    Dec 2011
    Posts
    1,162
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

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
  •