Results 1 to 7 of 7

Thread: RadialTPAWalk - guess by who...

  1. #1
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default RadialTPAWalk - guess by who...

    MinPix - how many pixels a square of the color must contain

    SR, ER - StartRadial, EndRadial

    MinD, MaxD - min distance, max distance

    Color - the color to walk "at".

    This function is compass angle independent, you don't need to do anything to the angles yourself or worry about the angle shifting...

    SCAR Code:
    Function RadialTPAWalk(Color: Integer; MinPix, SR, ER, MinD, MaxD: Integer): Boolean;
    Var
      TPAA: Array of TPointArray;
      X, Y, Z, I, S, E: Integer;
      TPA: TPointArray;
    Begin
      FindColorsSpiralTolerance(MMCX, MMCY, TPA, Color, MMX1, MMY1, MMX2, MMY2, 0);
      FilterPointsPie(TPA, 0, 359, MinD, MaxD, MMCX, MMCY);
      TPAA := TPAToATPA(TPA, Round(Sqrt(MinPix)));
      S := SR + Round(Rs_GetCompassAngleDegrees);
      E := ER + Round(Rs_GetCompassAngleDegrees);
      If S > 360 Then S := S - 315;
      If E > 360 Then E := E - 315;
      Writeln(IntToStr(S));
      Writeln(IntToStr(E));
      For I := 0 To High(TPAA) Do
      Begin
        MiddleTPAEx(TPAA[i], X, Y);
        Z := Round(Degrees(ArcTan2(MMCY - Y, MMCX - X))) - 90;
        If Z < 0 Then
          Z := Z + 360;
        If Z > SR Then
          If Z < ER Then
          Begin
            MouseFindFlag(X, Y, 1, 1);
            Flag;
            Result := True;
            Exit;
          End;
      End;
    End;

  2. #2
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    Why do you filter the degrees yourself? Don't trust FilterPointsPie with it?

    SCAR Code:
    FindColorsSpiralTolerance(MMCX, MMCY, TPA, Color, MMX1, MMY1, MMX2, MMY2, 0);

    finds the points center-out.. the opposite of RadialWalk.

    Also, RadialWalk scans a distance from start to endradial.. This doesn't scan any particular direction?

    I suggest using RadialWalkEx:
    SCAR Code:
    function RadialTPAWalk(Color: Integer; MinPix, SD, ED, MaxR: Integer): Boolean;
    var
      i, d, x, y: Integer;
      tpa: TPointArray;
      atpa: TPointArrayArray;
    begin
      Result := False;
      d := Round(Rs_GetCompassAngleDegrees);
      if (d < 0) then Exit;
      if (not RadialWalkEx(tpa, MMCX, MMCY, Color, 0, SD + d, ED + d, MaxR)) then Exit;
      atpa := TPAtoATPA(tpa, Round(sqrt(MinPix)));
      for i := 0 to High(atpa) do
        if (Length(atpa[i]) > MinPix) then
        begin
          MiddleTPAEx(atpa[i], x, y);
          if MFNF(x, y, 1, 1) then
          begin
            Result := True;
            FFlag(10);
            Break;
          end;
        end;
    end;
    Hup Holland Hup!

  3. #3
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    For crying out loud, just copyright the word "TPA"!

    Everytime I see a topic in "SRL New Functions" or "Public Test Corner" with the word "TPA" in it, I go in and see it's you!! Jesus!!

    -Knives

  4. #4
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Why do you filter the degrees yourself? Don't trust FilterPointsPie with it?
    I've tried it and didn't work

    Also, the Spiral is for habit, and it makes no difference - this function does work just as designed.

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

    Default

    Quote Originally Posted by King of Knives View Post
    For crying out loud, just copyright the word "TPA"!

    Everytime I see a topic in "SRL New Functions" or "Public Test Corner" with the word "TPA" in it, I go in and see it's you!! Jesus!!

    -Knives
    Hahaha very true

  6. #6
    Join Date
    Jul 2007
    Posts
    1,431
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    He will not stop before he gets to DEV...
    Looks nice to me since I can't understand it^^

    What filterpoints Pie does?

    And where could I get list of all TPA/misc functions of scar...like exit, abs, TPAtoGasp etc...

    I mean those what arent displayed in scar help file?
    [CENTER][SIZE="4"]Inactive[/SIZE]I forgot my password[/CENTER]

  7. #7
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Gap, not Gasp!

    Gap is like a... hole

    And where could I get list of all TPA/misc functions of scar...like exit, abs, TPAtoGasp etc...
    They are in WizzyPlugin, (talking of the TPA stuff) -

    .includes\SRL\SRL\Misc\WizzyPlugin.scar

    or www.srl-forums.com/srl-repos/ -> Place inside plugins folder -> WizzyPlugin.drp since WizzyPlugin.scar doesn't show them all.

    Filter points pie "takes a slice of a pie"+(describes the circle)+"with set angles and radius"


    He will not stop before he gets to DEV...
    And not after


    EDIT: By the way, if you do want long steps, make it For I := High(TPAA) DownTo 0 Do

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Muted... You'll never guess why.
    By almost in forum Banned from RS
    Replies: 16
    Last Post: 02-17-2009, 05:13 PM
  2. Guess who's back
    By mark9510 in forum News and General
    Replies: 19
    Last Post: 06-28-2008, 03:42 PM
  3. Guess
    By Boreas in forum The Bashing Club / BBQ Pit
    Replies: 38
    Last Post: 11-03-2007, 02:32 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
  •