Results 1 to 9 of 9

Thread: Tpa

  1. #1
    Join Date
    Aug 2008
    Location
    !!LOL!!
    Posts
    247
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Tpa

    this is my understanding tpa's:
    suppose Your in mining guild or w/e, you know how rocks have stripes on them
    ok each point is a t point, so if u store all these t points in an array (TPA), that means the whole stripe is an array of t points? And if so how do i access the elements of the array? any functions?

  2. #2
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Okay, the points are stored, you may have to split them into boxes, to reduce the amount of points. So you would have to make an ATPA (TPAToATPAEx(TPA, 3, 3)). You them loop through this, finding the middle and checking for text. If the text is there, you break and click or result w/e. Otherwise you carry on looping.

    Did this explain it clearly enough? Or do you need a practical demonstration?

  3. #3
    Join Date
    Aug 2008
    Location
    !!LOL!!
    Posts
    247
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    could u do a practical demonstration plz?

  4. #4
    Join Date
    Nov 2008
    Location
    Melbourne, Australia
    Posts
    2,240
    Mentioned
    3 Post(s)
    Quoted
    11 Post(s)

    Default

    You don't have to use TPAToATPAEx or TPAToATPA, you're best off to split the TPA . But that generally depends on what you are finding. If you are finding a rock then you would be better off to use TPAtoATPAEX but if you are finding an NPC/Tree you should Split the TPA
    Click here to find out how to get full screen without members! | Click here to check out my Ultimate Bitmap Tutorial! Edited to work with Simba! |

  5. #5
    Join Date
    Aug 2008
    Location
    !!LOL!!
    Posts
    247
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    could u tell em why? and thank you
    EDIT --> for practical lesson i understood it but new question ::
    After splitting the TPA in ATPA how do i acces for example ATPA 1 ATPA 2 etc
    Last edited by hackncrack1; 07-23-2009 at 05:59 PM.

  6. #6
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    TPAToATPA splits the points in circles of 'Radius'. Whilst TPAToATPAEx makes a box of 'w' and 'h'. Since Runescape's rocks are on tiles of 17*14, it would be wise to make a box of 17 width (w) and 14 height ( h), and find the middle.

    Practical:

    SCAR Code:
    Var TPA : TPointArray;
      ATPA : Array Of TPoint;
      I, x, y : Integer;
    Begin
      FindColorsSpiralTolerance(MSCX, MSCY,TPA, CoalColor, MSX1, MSY1, MSX2, MSY2, 10); //Getting points from the coal rock nearest to you (MSCX, MSCY)
      ATPA := TPAToATPAEx(TPA, 17, 14); // Splits the points into boxes of 17 and 14
      For I := 0 to High(ATPA) Do //For all the split boxes
      If MiddleTPAEx(ATPA[I], x, y) Then //looping through, finding the middle
      Begin  
        MMouse(x, y, 6, 6); //Moving the mouse to the middle of the box (rock) with randomness
        GetMousePos(x, y); //Gets the position of the random move and stores it to x and y.
        If WaitUpText('oal', 1000) Then //Waits for the UpText. See Timing.scar
          Mouse(x, y, 0, 0, True) //Clicks it
        Else //otherwise if not the uptext then
          Continue; //Carry on looping through the points
      End;
    End;

    Hope that helps you, feel free to add my MSN for more queries
    Last edited by Naum; 09-19-2012 at 11:34 AM.

  7. #7
    Join Date
    Aug 2008
    Location
    !!LOL!!
    Posts
    247
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thx a lot rep++

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

    Default

    Quote Originally Posted by NaumanAkhlaQ View Post
    TPAToATPA splits the points in circles of 'Radius'. Whilst TPAToATPAEx makes a box of 'w' and 'h'. Since Runescape's rocks are on tiles of 17*14, it would be wise to make a box of 17 width (w) and 14 height ( h), and find the middle.
    When you enter 17,14 it doesn't have to split in boxes from 17x14. In the worst case it splits in 34x28.

    When you have a point in the center at (17,14) which is first in a box and you have a point at (34,28); the second point will be included with the first point (which will result in a 17x14 box). But when there's another point at (0, 0), it will also be included with the first point, resulting in a 34x28 box.

    This doesn't happen when (0, 0) comes before (17,14) in the array, though. If that's the case, (0,0) will get its own box and (17,14) will get included, but (34,28) should get it's own box too.

    You get this more if you use FindColorsSpiral, because the points are sorted on distance from the center, so that means it's more likely you'll get a point like (17,14) first in the array.

  9. #9
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by nielsie95 View Post
    When you enter 17,14 it doesn't have to split in boxes from 17x14. In the worst case it splits in 34x28.

    When you have a point in the center at (17,14) which is first in a box and you have a point at (34,28); the second point will be included with the first point (which will result in a 17x14 box). But when there's another point at (0, 0), it will also be included with the first point, resulting in a 34x28 box.

    This doesn't happen when (0, 0) comes before (17,14) in the array, though. If that's the case, (0,0) will get its own box and (17,14) will get included, but (34,28) should get it's own box too.

    You get this more if you use FindColorsSpiral, because the points are sorted on distance from the center, so that means it's more likely you'll get a point like (17,14) first in the array.
    It could do that, It has happened to me, but I was going as theory and tutorials would suggest. But I shall bear that in mind.

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
  •