Results 1 to 7 of 7

Thread: MiddleTPA

  1. #1
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default MiddleTPA

    It works if I type it like this

    Simba Code:
    TheThing := FindTPointCluster([1721945,1258561,1026,1580059,531240], 10, Point(647, 147), -1, -1, 10, MMX1, MMY1, MMX2, MMY2);
      ATPA := TPAtoATPAEx(TheThing, 3,3);
      writeln('Walking to log');
      for i := 0 to High(ATPA) do
      begin
        MP := MiddleTPA(ATPA[i]); //I would only want i=0
        SMART_DrawCircle(true, MP, 15, false, clRed);
        Mouse(MP.x, MP.y, 5, 5, mouse_Left);
        repeat
          wait(10);
        until InsideArea(0, ['9_2','9_1'], 3843, 839, 3847, 847);
        Break;
      end;

    But since I only want the first result, why can't I do this? It returns an error:Out of range

    Simba Code:
    TheThing := FindTPointCluster([1721945,1258561,1026,1580059,531240], 10, Point(MMCX, MMCY), -1, -1, 10, MMX1, MMY1, MMX2, MMY2);
      ATPA := TPAtoATPAEx(TheThing, 3,3);
      writeln('Loging');
      MP := MiddleTPA(ATPA[0]); //Error here
      SMART_DrawCircle(true, MP, 15, false, clRed);
      ThePoint := MMtoMS(MP);
      Mouse(ThePoint.x+30, ThePoint.y+10, 3, 3, mouse_Right);
      if WaitOption('ross', 2000) then
      begin
        repeat
          wait(10);
        until MyPos(Point(3815, 847));
        Result := True;
      end;

  2. #2
    Join Date
    Mar 2008
    Location
    ::1
    Posts
    915
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Hmm that's odd. Try printing out the length of ATPA before the line to make sure thats its actually getting filled in that version.

    Records and Types Save Code (and make you look better)
    Quote Originally Posted by Wizzup? View Post
    Is it possible to make Runescape a 2D game with this?... That would greatly simplify... Just about anything.

  3. #3
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You mean something like this?

    Simba Code:
    if Length(ATPA) > 0 then
    MP := MiddleTPA(ATPA[0]);

  4. #4
    Join Date
    Mar 2008
    Location
    ::1
    Posts
    915
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Well I'm just debugging it. I just want you to print out the length before the error so we can narrow down where the error is. Just something like this:
    Simba Code:
    Writeln('Length: ' + intToStr(length(ATPA)));
    MP := MiddleTPA(ATPA[0]);

    EDIT: Please tell me what it says once you've done this if you would be so kind.
    Last edited by Tniffoc; 06-25-2012 at 10:48 PM.

    Records and Types Save Code (and make you look better)
    Quote Originally Posted by Wizzup? View Post
    Is it possible to make Runescape a 2D game with this?... That would greatly simplify... Just about anything.

  5. #5
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Returns length of 2. And now it works again. But when it gives me the error some time later, it would give me the error forever until I restart Simba.

  6. #6
    Join Date
    Mar 2008
    Location
    ::1
    Posts
    915
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Well the reason for that is that nothing is actually being found when you search the colors (most likely). This probably means that your client go unset or SMART crashed depending on whether or not you are using SMART.

    Records and Types Save Code (and make you look better)
    Quote Originally Posted by Wizzup? View Post
    Is it possible to make Runescape a 2D game with this?... That would greatly simplify... Just about anything.

  7. #7
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You're right, it returns 0 for me sometimes. Guess I need to do a little fix on the function. Thanks!

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
  •