Page 1 of 2 12 LastLast
Results 1 to 25 of 41

Thread: Minor TPA question

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

    Default Minor TPA question

    I was going to topic this in the IRC, but couldn't get access.

    I'm working on my walker atm, and using this function i got from garrett some months ago:

    Code:
    Function WalkTPA(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(0.10, 25);
     FindColorsSpiralTolerance(MMCX, MMCY, TPA, C1, MMX1, MMY1, MMX2, MMY2, 7);
     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;
    As with this followed a guide on how to use it, with some paintings of how he divided the minimap into boxes with names (MMCX, MMY2) and so on.

    Also i can't remember what the XM and YM present? a guees would be how far into the box my function is searching?

    If anyone could help me with thiese simple questions i'll be gratefull
    /Thanks - Cartmann
    I ... Am ... CARTMANN!

  2. #2
    Join Date
    Dec 2008
    Location
    Québec
    Posts
    419
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    XM and YM are only use in
    MouseFlag(x + XM, y + YM, XR, YR, 0);
    so,if im right , Xr and Yr addition randomness to your coord and XM and YM only addition to coord wich i think is useless.
    Formerly known as FrancisHelie

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

    Default

    XM and YM only addition to coord
    What do you mean about that? please explain :P

    I've got one of the function i made for another walker back at the time he showed me how to do it:
    Code:
    WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
    I ... Am ... CARTMANN!

  4. #4
    Join Date
    Dec 2008
    Location
    Québec
    Posts
    419
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));

    so mouseflag will be like that:
    MouseFlag(x -1, y -10, 2, 2, 0);

    the -1 soustract the x, the -10 soustract the y and thos two 2 add randomness to x and y -> x +random(2) and y+random(2).
    Last edited by Phran6; 01-13-2010 at 06:24 PM.
    Formerly known as FrancisHelie

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

    Default

    bump
    I ... Am ... CARTMANN!

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

    Default

    I agree with FrancisHelie, as far as I can see, they don't seem very necessary to me? Why not try removing them from the parameters/code and see how it goes? Also since apparently 3Garrett3 made this Function, why not try to contact and ask him?!

    Edit:
    [opinion]You should remove the two ColorToleranceSpeed(cts); and just place one right after SortATPAFromFirstPoint(TDPA, SortPoint); I think that would still work just fine. Also, I think its kind of unnecessary to have two colors to search for, its not too hard to ACA something to be accurate and work almost all the time, but I guess in this case you can walk based on two different things/colors so never-mind that's kind of cool then . But If you are just walking based on 1 color (like just a road) then forget the 2nd color search.[/opinion]
    Last edited by YoHoJo; 01-17-2010 at 03:00 PM.

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

    Default

    XM stands for X Mod. In my script, I had to click above and to the left of the cactus, so when it found the cactus, I modded the click a little to the left, and a little up using XM and YM. You can make that 0 if you want to click right on the colour.
    old mesage from garrett, i want to talk to him, yeah :P but he is never on msn.

    It's more the MMCX, MMCY, MMX1 and so on i'm confused about.
    I ... Am ... CARTMANN!

  8. #8
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Cartmann View Post
    old mesage from garrett, i want to talk to him, yeah :P but he is never on msn.

    It's more the MMCX, MMCY, MMX1 and so on i'm confused about.
    They are global constants setup in Globals.scar for the various dimensions of RS. MMCX, MMCY for example is the x, y center point of the Minimap. MMX1, MMY1 is the top left corner of the box surrounding the minimap. Check Globals.scar for all the constants.
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

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

    Default

    Still seems unnecessary, you see the XR YR is the xmod and ymod. no need to + or - from the x or y. Something like
    SCAR Code:
    function MFF(X, Y, Xmod, Ymod: Integer): Boolean;
    By: EvilChicken!
    Description: If the flag is not present it will click at (ax, ay) increasing by
    (xmod, ymod) 5 times or until the flag appears.
    Clicks until the flag is present. So XM YM still seems unnecessary to me.


    SCAR Code:
    Function WalkTPA(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;  //saves current coltolspeed
     ColorToleranceSpeed(2); //sets sped to 2
     SetColorspeed2Modifiers(0.10, 25);  //sets mods
     FindColorsSpiralTolerance(MMCX, MMCY, TPA, C1, MMX1, MMY1, MMX2, MMY2, 7);  //finds all pixels of C1 with tol 7, saves them in TPA called TPA
     If Length(TPA) = 0 Then  //if C1 not found then
      FindColorsSpiralTolerance(MMCX, MMCY, TPA, C2, MMX1, MMY1, MMX2, MMY2, 7);  //does the same with C2
     TDPA := TPAtoATPAEx(TPA, 20, 20);  //splits the TPA of all of the pixels found into 20X20 boxes.
     SortATPAFromFirstPoint(TDPA, SortPoint);  //sorts the 20X20 boxes based on their distance from SortPoint
     H := High(TDPA);  //Number of 20X20 boxes made
     For i := 0 To H Do
     Begin
      MiddleTPAEx(TDPA[i], x, y);  //Makes x,y the middle of a 20X20 box
      If rs_OnMinimap(x,y) Then   //if that point is on the minimap
      Begin
       MouseFlag(x + XM, y + YM, XR, YR, 0);  //click it/flag
       Result := True;
       Wait(200 + Random(80));
       ColorToleranceSpeed(cts);
       Exit;
      End;
     End;
     Result := False;
     ColorToleranceSpeed(cts);
    End;

    Understand now? Not sure exactly what you meant by
    MMCX,MMCY,MMX1 and so on

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

    Default

    thank you yohojo, that MMCX was what narcle explained, just where on the minimap i want the colour to be looked for.

    Oki, so the Minimap is looking like this?:

    MMX1,MMY1 | MMCX,MMX2 | MMY1,MMX2
    MMX1,MMCY | MMCX,MMCY | MMCX,MMX2
    MMX1,MMY2 | MMCX,MMY2 | MMX2,MMY2
    Last edited by Cartmann; 01-17-2010 at 05:00 PM.
    I ... Am ... CARTMANN!

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

    Default

    Quote Originally Posted by Cartmann View Post

    MMX1,MMY1 | MMCX,MMX2 | MMY1,MMX2
    MMX1,MMCY | MMCX,MMCY | MMCX,MMX2
    MMX1,MMY2 | MMCX,MMY2 | MMX2,MMY2
    Not really sure about those? But anyways, you can just use cords instead of those anyways if you want to .

  12. #12
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Cartmann View Post
    thank you yohojo, that MMCX was what narcle explained, just where on the minimap i want the colour to be looked for.

    Oki, so the Minimap is looking like this?:

    MMX1,MMY1 | MMCX,MMX2 | MMY1,MMX2
    MMX1,MMCY | MMCX,MMCY | MMCX,MMX2
    MMX1,MMY2 | MMCX,MMY2 | MMX2,MMY2

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

    Default

    Nice drawing, but i don't really understand it?

    And about cords, how does that work out? will it just locate Thoese TDPA within some distance of that cord? and how do i declare that?
    I ... Am ... CARTMANN!

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

    Default

    and about cords, how does that work out? Will it just locate thoese tdpa within some distance of that cord? And how do i declare that?
    wat?!

  15. #15
    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
    Not really sure about those? But anyways, you can just use cords instead of those anyways if you want to .
    Code:
    WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(1111, 366);
    It's only searching one cord now, yes?
    I ... Am ... CARTMANN!

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

    Default

    Quote Originally Posted by Cartmann View Post
    Code:
    WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(1111, 366);
    It's only searching one cord now, yes?
    No.. It's searching the whole minimap..
    Look at this..
    SCAR Code:
    Function WalkTPA(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(0.10, 25);
     FindColorsSpiralTolerance(MMCX, MMCY, TPA, C1, MMX1, MMY1, MMX2, MMY2, 7);
     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;
    C1, and C2, as you know are Color 1, and Color 2
    XM, and YM, are X Modifier, and Y Modifier (Added/Subtracted Coords to where you are clicking)
    XR, YR, are X random, and Y random, the adding of random coords to your X, and Y (After modifiers modify it)
    SortPoint is the point which to sort the Points found by Color 1 and Color 2 by using SortATPAFromFirstPoint..
    Described by Naum:
    This procedure basically goes through each TPA and does SortTPAFrom, without changing the order.
    There's a pretty good usage of this procedure, I use it in mining coal. But more of that later . The usage of it is the same as SortATPAFrom.

    Make Sense?
    See, your searching the whole minimap:
    FindColorsSpiralTolerance(MMCX, MMCY, TPA, C1, MMX1, MMY1, MMX2, MMY2, 7);
    FindColorsSpiralTolerance(MMCX, MMCY, TPA, C2, MMX1, MMY1, MMX2, MMY2, 7);
    MMCX, MMCY are telling it to spiral out from the center of minimap, because every point must be made from 2 coordinates (MMCX, MMCY).
    MMX1, MMY1, MMX2, MMY2 is creating the box, or boundary of which to search in.
    First 2, and Second 2 are the Top Left point, and Bottom Right point. In all cases the first 2 are Top Left, second 2 are Bottom Right.
    So MMX1, MMY1 is telling it to start at the point (MMX1, MMY1) and search until the point MMX2, MMY2.
    MMX1, MMY1 is the top left of the minimap.
    MMX2, MMY2 is the bottom right of it.

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

    Default

    Ill wait to see if you understand his explanation, if not, ill explain in my words =D

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

    Default

    I know what it doese :P read a ton of tuts on it, cohens was really nice, but i don't know how to make it look where i want it to look. Like in the first i want it to look at the top right corner of the minimap:



    and perhaps later i want it to look else where as i move towards the GE and around.
    I ... Am ... CARTMANN!

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

    Default

    Make ( SortPoint : TPoint) the the cords of where you want to click.

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

    Default

    Quote Originally Posted by YoHoJo View Post
    Make ( SortPoint : TPoint) the the cords of where you want to click.
    yeah
    Cartmann, change the SortPoint to where you would like it to click. Then when it begins to click, it will click the closest point it found to the point you wanted.

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

    Default

    So:

    Code:
    WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(1111, 366);
    Would make it click closest to that point? where it found the colour?
    I ... Am ... CARTMANN!

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

    Default

    Quote Originally Posted by Cartmann View Post
    So:

    Code:
    WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(1111, 366);
    Would make it click closest to that point? where it found the colour?
    Target a runescape client (Browser client), then get the point. 1111, i don't think that is on the runescape screen.

    I don't think you understand TPAs. It finds colours, and works with them. Not just one point of one color.
    But yes, by changing SortPoint : TPoint, would make it click closest to that point.

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

    Default

    i know it makes some boxes, and then click in the middle of the best box, in this case they are some 20x20. (would it be more precise if I made them smaller?)
    I ... Am ... CARTMANN!

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

    Default

    Quote Originally Posted by Cartmann View Post
    i know it makes some boxes, and then click in the middle of the best box, in this case they are some 20x20. (would it be more precise if I made them smaller?)
    Not really.. All the points are close.. So they would be grouped anyway.. TPA walk isn't made for roads. (If that's what you're using)

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

    Default

    Quote Originally Posted by Timer View Post
    Not really.. All the points are close.. So they would be grouped anyway.. TPA walk isn't made for roads. (If that's what you're using)
    take that back. TPA walking is for everything haha.
    “Ignorance, the root and the stem of every evil.”

Page 1 of 2 12 LastLast

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
  •