Results 1 to 3 of 3

Thread: Need a private walking function made.

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

    Default Need a private walking function made.

    Dont have time to do it and everything i have tried has failed.


    Simba Code:
    function WalkPath(Path: TPointArray): boolean;
    var
      I, H, T, D: integer;
      P, MM, A, B: TPoint;
    begin
      H := High(Path);
      T := GetSystemTime + 20000 + Random(5000);

      while (not Result) and (GetSystemTime < T) do
      begin
        RunEnergy(20);

        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, 5, 5, mouse_Left);

              FFlag(Integer(I <> H) * 15);
              if IsMoving then
              begin
                          repeat
                Wait(50);
                until Not isMoving;
                end;

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


              T := getSystemTime + 20000 + Random(1000);
                Break;
            end;
        end;

        Result := (I = H);
      end;
    end;

    Ripped straight off of the sps to add what i needed, this is what i needed added to a function that will run through points and walk it but check
    Simba Code:
    if (Distance(A.X, A.Y, B.X, B.Y) < 6) then Exit;
                     If UInFight or BlueDead then Exit;

    inbeetween each point, and points a and b are described in the upper code.

  2. #2
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Put your check inbetwen the "If is moving then Repeat... Your check here... Until..."

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

    Default

    Ya, but as of rite now it doesnt walk, even just someone making a function that loops through a sps path and does points or something idk.

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
  •