Page 2 of 2 FirstFirst 12
Results 26 to 41 of 41

Thread: Minor TPA question

  1. #26
    Join Date
    May 2009
    Location
    Denmark! YEAH I'M A VIKING!
    Posts
    344
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I've tried running a few test runs with 2 TPAs, i made them walk to a point, and from that point, walk to the next, but after walking to the first point, it just clicked rapidly before finnishing the first walk?
    And by that it wasn't able to actually see where the next point was before it clicked, luckily those colours for the second TPA was quite common so it walked like half the path anyway. (it was at Lumbridge, I'll post some pictures tomorrow to explain deeper)
    I ... Am ... CARTMANN!

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

    Default

    Quote Originally Posted by Cartmann View Post
    I've tried running a few test runs with 2 TPAs, i made them walk to a point, and from that point, walk to the next, but after walking to the first point, it just clicked rapidly before finnishing the first walk?
    And by that it wasn't able to actually see where the next point was before it clicked, luckily those colours for the second TPA was quite common so it walked like half the path anyway. (it was at Lumbridge, I'll post some pictures tomorrow to explain deeper)
    Post pictures and I could help you with walking. TPA walking is my favorite Also you should think about writing your own function and not using someone elses. It's hard to find bugs when you don't fully understand the coding.
    “Ignorance, the root and the stem of every evil.”

  3. #28
    Join Date
    May 2009
    Location
    Denmark! YEAH I'M A VIKING!
    Posts
    344
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Blumblebee View Post
    Post pictures and I could help you with walking. TPA walking is my favorite Also you should think about writing your own function and not using someone elses. It's hard to find bugs when you don't fully understand the coding.
    I do understand it, and found it with some flaws, among was the hue and sat mod, so I've made some changes to it:

    Code:
    Function WalkFirstTPA(C1, C2, XM, YM, XR, YR : Integer; SortPoint : TPoint) : Boolean;     //thanks to 3Garrett3
    Var
     TPA: TPointArray;
     TDPA: T2DPointArray;
     I, CTS, H, X, Y: Integer;
    Begin
     If Not LoggedIn Then Exit;
     cts := GetColorToleranceSpeed;
     ColorToleranceSpeed(2);
     SetColorspeed2Modifiers(2.69, 1.54);
     FindColorsSpiralTolerance(MMCX, MMCY, TPA, C1, MMX1, MMY1, MMX2, MMY2, 4);    //  1795381
     If Length(TPA) = 0 Then
      begin
       SetColorspeed2Modifiers(2.54, 3.70);
       FindColorsSpiralTolerance(MMCX, MMCY, TPA, C2, MMX1, MMY1, MMX2, MMY2, 4);  //   1584709
      end;
     TDPA := TPAtoATPAEx(TPA, 20, 20);
     SortATPAFromFirstPoint(TDPA, SortPoint);
     H := High(TDPA);
     For i := 0 To H Do
     Begin
      MiddleTPAEx(TDPA[i], x, y);
      If rs_OnMinimap(x,y) Then
      Begin
       MouseFlag(x + XM, y + YM, XR, YR, 0);
       Result := True;
       Wait(200 + Random(80));
       ColorToleranceSpeed(cts);
       Exit;
      End;
     End;
     Result := False;
     ColorToleranceSpeed(cts);
    End;
    
    Function WalkSecondTPA(C1, C2, XM, YM, XR, YR : Integer; SortPoint : TPoint) : Boolean;     //thanks to 3Garrett3
    Var
     TPA: TPointArray;
     TDPA: T2DPointArray;
     I, CTS, H, X, Y: Integer;
    Begin
     If Not LoggedIn Then Exit;
     cts := GetColorToleranceSpeed;
     ColorToleranceSpeed(2);
     SetColorspeed2Modifiers(1.52, 0.76);
     FindColorsSpiralTolerance(MMCX, MMCY, TPA, C1, MMX1, MMY1, MMX2, MMY2, 7);  //1584709
     If Length(TPA) = 0 Then
      FindColorsSpiralTolerance(MMCX, MMCY, TPA, C2, MMX1, MMY1, MMX2, MMY2, 7);
     TDPA := TPAtoATPAEx(TPA, 20, 20);
     SortATPAFromFirstPoint(TDPA, SortPoint);
     H := High(TDPA);
     For i := 0 To H Do
     Begin
      MiddleTPAEx(TDPA[i], x, y);
      If rs_OnMinimap(x,y) Then
      Begin
       MouseFlag(x + XM, y + YM, XR, YR, 0);
       Result := True;
       Wait(200 + Random(80));
       ColorToleranceSpeed(cts);
       Exit;
      End;
     End;
     Result := False;
     ColorToleranceSpeed(cts);
    End;
    I call them like this in my script:

    Code:
    Procedure WalkLumbToGoblinhut;
    begin
     If Not LoggedIn Then Exit;
       if WalkFirstTPA(1795381, 1584709,( 10),( 0), 2, 2, Point(680, 65)) then
        Writeln('infront of the bridge');
       else
        writeln('tpa sucks')
       Wait(150+random(150));
       if WalkSecondTPA(1584709, 1584709,( 1),( 10), 2, 2, Point(635, 24)) then
       Writeln('at the spider pit');
       else
       Writeln('alot!')
       //Get some failsafes and checks
    end;
    Here's some pics of where i want to walk:
    First Walk: - i'm using the tree (top as first, back as second colour) and navigate alittle to the right after that.


    Second Walk: Using the brown bush next to the hut, and navigating a little upwards after that.


    Red is how it actually walked, blue is like how i wanted it to walk :

    Last edited by Cartmann; 01-20-2010 at 10:43 AM.
    I ... Am ... CARTMANN!

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

    Default

    give the function the ability to change the tolerance around when needed, for the walk that screws up, sort the point form MMx1, MMy1 for the best results and pick a better color, would be my opinion.

    oh and don't have TPAtoATPAEx(TPA, 20, 20). 20 and 20 are waaaay to big, make it like 10, 10 max. I would have my at like 5, 5 to give more points for a more accurate result.
    “Ignorance, the root and the stem of every evil.”

  5. #30
    Join Date
    May 2009
    Location
    Denmark! YEAH I'M A VIKING!
    Posts
    344
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Updated:
    Code:
    Function WalkTPA(C1, TOL1, C2, TOL2, XM, YM, XR, YR : Integer; HUE1, SAT1, HUE2, SAT2 : Extended; SortPoint : TPoint) : Boolean; 
    Var
     TPA: TPointArray;
     TDPA: T2DPointArray;
     I, CTS, H, X, Y : Integer;
    Begin
     If Not LoggedIn Then Exit;
      cts := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorspeed2Modifiers(HUE1, SAT1);
      FindColorsSpiralTolerance(MMCX, MMCY, TPA, C1, MMX1, MMY1, MMX2, MMY2, TOL1);    //  1795381
       If Length(TPA) = 0 Then
        begin
         SetColorspeed2Modifiers(HUE2, SAT2);
         FindColorsSpiralTolerance(MMCX, MMCY, TPA, C2, MMX1, MMY1, MMX2, MMY2, TOL2);  //   1584709
         end;
       TDPA := TPAtoATPAEx(TPA, 5, 5);
       SortATPAFromFirstPoint(TDPA, SortPoint);
       ColorToleranceSpeed(cts)
       H := High(TDPA);
       For i := 0 To H Do
        Begin
         MiddleTPAEx(TDPA[i], x, y);
          If rs_OnMinimap(x,y) Then
           Begin
            MouseFlag(x + XM, y + YM, XR, YR, 0);
            Result := True;
            Wait(200 + Random(80));
          Exit;
        End;
     End;
      Result := False;
    End;
    Here I'm calling the function:

    Code:
    Procedure WalkLumbToGoblinhut;
    a : integer;
    
    begin
     If Not LoggedIn Then Exit;
       if WalkTPA(1795381, 3, 1584709, 4,( 10),( 0), 2, 2, 2.69, 1.54, 2.54, 3.70, Point(680, 65)) then
        Writeln('infront of the bridge')
        a = 0;
         repeat
          a = a+1
          Wait(100+random(150+a));
         until (FindDTM or BMP or symbol?) or (a=100)
       if WalkTPA(1584709, 3, 1584709, 4,( 1),( 10), 2, 2, 1.52, 0.76, 1.52, 0.76, Point(635, 24)) then
        Writeln('at the spider pit')
    end;
    What should i as failsafe when i walk around with my TPA?
    I ... Am ... CARTMANN!

  6. #31
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Look for certain symbols/landmarks on the map as failsafes to make sure you are where you need to be. Not much else I can think of .

  7. #32
    Join Date
    May 2007
    Location
    Ohio
    Posts
    2,296
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I would say use tpa's to find those boundary's (white lines on the minimap).
    Make a quick function to sort the shapes, and then click off of it.

  8. #33
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    What I do when walking, is basically just look for anything on the minimap that you could use as a sort of "marker". It can be rock's, a ladder, Anything really that doesn't move.
    Then, make another tpa that you will use to locate that object on the mini map. Thing is, don't search the whole minimap for the "marker",. Create a box around it, scaled appropriately to how precise your walking is, and search only that box. If the object is found within that box, then your are where you need to be.

    That's a method that I go with usually.

  9. #34
    Join Date
    May 2007
    Location
    Ohio
    Posts
    2,296
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by NCDS View Post
    What I do when walking, is basically just look for anything on the minimap that you could use as a sort of "marker". It can be rock's, a ladder, Anything really that doesn't move.
    Then, make another tpa that you will use to locate that object on the mini map. Thing is, don't search the whole minimap for the "marker",. Create a box around it, scaled appropriately to how precise your walking is, and search only that box. If the object is found within that box, then your are where you need to be.

    That's a method that I go with usually.
    And if your minimap is at a angle? Do you have a function that accounts for the minimaps angle?

  10. #35
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by Timer View Post
    And if your minimap is at a angle? Do you have a function that accounts for the minimaps angle?
    I always keep the angle to North during my scripts, unless its doing an AntiBan. That's also why I said "Thing is, don't search the whole minimap for the "marker",. Create a box around it, scaled appropriately to how precise your walking is, and search only that box." By "scaled appropriately to how precise your walking is," I meant that you should make the box your going to search bigger/smaller depending on how randomized your walking is.

    Hopefully that makes it easier to understand. This method works for me all the time.

  11. #36
    Join Date
    May 2009
    Location
    Denmark! YEAH I'M A VIKING!
    Posts
    344
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    So, you don't want me to make DTMs? but instead like a copy of my TPA functions? (meaby with some (MMCX,MMX2) sort points?)
    I'll try it for sure.
    I ... Am ... CARTMANN!

  12. #37
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    I'm a bit lost. What the hell are we trying to figure out now?

  13. #38
    Join Date
    May 2009
    Location
    Denmark! YEAH I'M A VIKING!
    Posts
    344
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    I'm a bit lost. What the hell are we trying to figure out now?
    Failssafes* so the TPA doesn't miss click

    I just wanted to know what would be best to use (dtm, tpa ect.)

    * as failsafes I'm using this procedure:

    Code:
    begin
     If Not LoggedIn Then Exit;
       if WalkTPA(1795381, 3, 1584709, 4,( 10),( 0), 2, 2, 2.69, 1.54, 2.54, 3.70, Point(680, 65)) then
        Writeln('infront of the bridge')
        a = 0;
         repeat
          a = a+1
          Wait(100+random(150+a));
         until (FindTPA or symbol) or (a=100)
       if WalkTPA(1584709, 3, 1584709, 4,( 1),( 10), 2, 2, 1.52, 0.76, 1.52, 0.76, Point(635, 24)) then
        Writeln('at the spider pit')
    end;
    I ... Am ... CARTMANN!

  14. #39
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by Cartmann View Post
    So, you don't want me to make DTMs? but instead like a copy of my TPA functions? (meaby with some (MMCX,MMX2) sort points?)
    I'll try it for sure.
    Let me explain my self a bit more..
    Position yourself in the the same area your walk would. Then look on the mini map for a ladder or group of rocks or anything that you could search for. Then, make approximately a 50x50 box around the object. Then, for your fail safe, search inside that box for the object. If the script finds it, then your walk was successful. See what I'm saying?

    Note: If the script has trouble finding the Object, try increasing the size of the box.

  15. #40
    Join Date
    May 2009
    Location
    Denmark! YEAH I'M A VIKING!
    Posts
    344
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    so you want me to edit my findcolor function to something like this perhaps?

    FindColorsSpiralTolerance(MMCX, MMCY, TPA, C1, 650, 90, 600, 40, 4); (a 50x50 box for searching the TPA)
    I ... Am ... CARTMANN!

  16. #41
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    *cough*. Why not use RadialWalkEx? It has TPA support.

Page 2 of 2 FirstFirst 12

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
  •