Results 1 to 5 of 5

Thread: TPoint - TPA's - The Basic's

  1. #1
    Join Date
    Sep 2006
    Location
    include srl/srl.scar ( aussie)
    Posts
    2,875
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default TPoint - TPA's - The Basic's

    TPoints, TPA's - The Basics.


    Contents
    • Intro.
    • TPoints.
    • TPA's.
    • How to use them.
    • conclusion.




    Intro


    What Is this Tut? In this Tutorial i will be going around the basics of TPoints and Array of TPoints , ( TPA's), I hope you will learn from it and will iron out all that stuff about them being hard , and that they are really , just easy.



    TPoints


    What is a TPoint? a TPoint is 2 varables in 1 , Like an X-coord and a Y-coord

    SCAR Code:
    TPoint:= Point(X,Y);

    or

    SCAR Code:
    TPoint:= Point(234,234);

    So a TPoint Is just 2 varables in 1, making a Point on the Screen.



    TPointArray

    What is a TPA? A TPA is basicly an array of TPoints, if you dont what an array is keep read this section
    An array of a Tpoint is just lots of Tpoints Like

    SCAR Code:
    TPA := [Point(232,234), Point(342,234), Point(123,123)];

    TPA's are very usefull in object finding as you can find all the Tpoints ( Point(x,y); on the MainScreen.

    il give you a little example, if you finding a tree and you found a Tpoint on each of the tree's branch you could Make the middle of all thoose TPoints (TPA) and make that the place you are going to Click.



    SCAR Code:
    *** Waring This Code is not Correct Just an example ***
    Procedure FindTPA;
    Var
       I : Integer;
       tpoint :  TPoint;
       TPA    : TPointArray;

    begin
       TPA := [Point(343,343),Point(354,378),Point(333,654)];  // The TPA

       for i:= 0 to length(TPA)-1 do             // Defing How Many TPoints we have

         Tp:= MiddleTPA(TPA[i]);             // Finding the Middle of all the TPoints
    end;


    So thats basicly how a TPA works.



    How To Use Them


    How do you use them in your script? Scar has a few ways of using it your script we will use this way...

    FindColorsSpiralTolerance(x,y,TPA,Color,MSX1,MSY1, MSX2,MSY2,Tol);


    The TPA is what you define your TPA as, the Color is the color you want to find the MSX1, MSX2 ect are the cords of the MainScreen MSX1 = MainSceen X point 1.

    Tol is how much tolerance you want.

    So the TPA part will Create a TPA of all the Tpoints of Colors It finds.

    SCAR Code:
    procedure FindTPA;
    var
      I : Integer;
      TP: Tpoint // our TPoint
      TPA: TPointArray // our TPA

    begin
      FindColorsSpiralTolerance(x,y,TPA,343423,MSX1,MSY1,MSX2,MSY2,8);
      for i:= 0 to length(TPA)-1 do  
      begin  
        TP:= MiddleTPA(TPA[i]);  
        MMouse( TP.x, TP.y, 2, 2,1);
        if IsUpText('TPA') then
        begin
          Writeln('Found TPA');
          Exit;
        end;
      end;
    end;

    Now Lets Break this Down

    SCAR Code:
    for i:= 0 to length(TPA)-1 do  
      begin

    This is Defing how many TPoints there are and it will serch Through Each TPoint for the UpText.

    SCAR Code:
    TP:= MiddleTPA(TPA[i]);

    Making the TPoint out off all the TPA's


    SCAR Code:
    MMouse( TP.x, TP.y, 2, 2,1);
        if IsUpText('TPA') then
        begin
          Writeln('Found TPA');
          Exit;

    Moves the Mouse to the location of the Tpoint , and if it Find the UpText it Exits the procedure if it doesnt it moves onto the Next TPoint.



    Conclusion


    Do you understand? I hope you understaned everything i have typed out , and please if there's an error in there correct me, if you dont understand anything Just post and i will answer you, Look out for my next Tut on Advanced TPA's with the Wizzy Plugin .

  2. #2
    Join Date
    Apr 2007
    Location
    Laguna Beach, California
    Posts
    231
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Since its a one dimensional array wouldnt this be pointless

    SCAR Code:
    procedure FindTPA;
    var
      I : Integer;
      TP: Tpoint // our TPoint
      TPA: TPoint Array // our TPA
     
    begin
      FindColorsSpiralTolerance(x,y,TPA,343423,MSX1,MSY1,MSX2,MSY2,8);
      for i:= 0 to length(TPA)-1 do  
      begin  
        TP:= MiddleTPA(TPA[i]);  
        MMouse( TP.x, TP.y, 2, 2,1);
        if IsUpText('TPA') then
        begin
          Writeln('Found TPA');
          Exit;
        end;
      end;
    end;

    shouldnt it just be (and i fixed some small errors too like in definining your vars):

    SCAR Code:
    procedure FindTPA;
    var
      I : Integer;
      TP: Tpoint; // our TPoint
      TPA: TPointArray; // our TPA
     
    begin
      FindColorsSpiralTolerance(x,y,TPA,343423,MSX1,MSY1,MSX2,MSY2,8);
      if (Length(TPA) > 0) then  
      begin  
        TP:= MiddleTPA(TPA);  
        MMouse( TP.x, TP.y, 2, 2,1);
        if IsUpText('Whatever object you want to click on') then
        begin
          Writeln('Found TPA');
          Exit;
        end;
      end;
    end;

    Wouldnt what youre doing be for ATPA's where you have multiple tree's... in which you would need to divide the TPA's using SplitTPA () or TPAtoATPA ()?
    Or am i just confused

    Edit: you also have some spelling errors in the tut itself... contents... conclusion
    Check out my SVC - here - It got me a scipters cup

  3. #3
    Join Date
    Sep 2006
    Location
    include srl/srl.scar ( aussie)
    Posts
    2,875
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by markuska815 View Post
    Since its a one dimensional array wouldnt this be pointless

    SCAR Code:
    procedure FindTPA;
    var
      I : Integer;
      TP: Tpoint // our TPoint
      TPA: TPoint Array // our TPA
     
    begin
      FindColorsSpiralTolerance(x,y,TPA,343423,MSX1,MSY1,MSX2,MSY2,8);
      for i:= 0 to length(TPA)-1 do  
      begin  
        TP:= MiddleTPA(TPA[i]);  
        MMouse( TP.x, TP.y, 2, 2,1);
        if IsUpText('TPA') then
        begin
          Writeln('Found TPA');
          Exit;
        end;
      end;
    end;

    shouldnt it just be (and i fixed some small errors too like in definining your vars):

    SCAR Code:
    procedure FindTPA;
    var
      I : Integer;
      TP: Tpoint; // our TPoint
      TPA: TPointArray; // our TPA
     
    begin
      FindColorsSpiralTolerance(x,y,TPA,343423,MSX1,MSY1,MSX2,MSY2,8);
      if (Length(TPA) > 0) then  
      begin  
        TP:= MiddleTPA(TPA);  
        MMouse( TP.x, TP.y, 2, 2,1);
        if IsUpText('Whatever object you want to click on') then
        begin
          Writeln('Found TPA');
          Exit;
        end;
      end;
    end;

    Wouldnt what youre doing be for ATPA's where you have multiple tree's... in which you would need to divide the TPA's using SplitTPA () or TPAtoATPA ()?
    Or am i just confused

    Edit: you also have some spelling errors in the tut itself... contents... conclusion

    Thanks yeah it would be pointless, this tut was mostlty to exsplain What a Tpoint , and TPA is , Not really for a script Thanks for your imput.

  4. #4
    Join Date
    Apr 2007
    Location
    Laguna Beach, California
    Posts
    231
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yea no problem... but if people are going to try to learn tpoints from this theyll prolly naturally look at that too so itd be good to fix that... but other than that good tut
    Check out my SVC - here - It got me a scipters cup

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

    Default

    SCAR Code:
    procedure FindTPA;
    var
      I : Integer;
      TP: Tpoint;
      TPA: TPointArray;
      ATPA: T2DPointArray;//array of array of TPoint
    begin
      FindColorsSpiralTolerance(x,y,TPA,343423,MSX1,MSY1,MSX2,MSY2,8);
      ATPA := TPAtoATPAEx(TPA, 15, 15);//added for ATPA
      for i:= 0 to length(TPA)-1 do  
      begin  
        TP:= MiddleTPA(ATPA[i]);  
        MMouse( TP.x, TP.y, 2, 2,1);
        if IsUpText('TPA') then
        begin
          Writeln('Found TPA');
          Exit;
        end;
      end;
    end;

    ATPA would be more beneficial since its used more and more versatile. You should add ATPA since it is very important and used just as much as a TPA. Up to you tho, nice Tut other then false code (which imo you should fix).
    (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.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. TPA's...
    By Floor66 in forum OSR Help
    Replies: 4
    Last Post: 03-01-2009, 06:47 PM
  2. Grouping TPA's
    By nielsie95 in forum OSR Advanced Scripting Tutorials
    Replies: 9
    Last Post: 12-10-2008, 05:56 AM
  3. Tpa's
    By lVlaverick in forum OSR Help
    Replies: 3
    Last Post: 09-13-2008, 06:14 PM
  4. TPoint
    By Shuttleu in forum OSR Help
    Replies: 6
    Last Post: 08-07-2008, 05:38 PM
  5. Tpoint help.
    By Wade007 in forum OSR Help
    Replies: 3
    Last Post: 02-22-2008, 06:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •