NiCbaZ
2008-11-17 02:03:43
TPoints, TPA's - The Basics.
Contents
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
or
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
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.
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.
Now Lets Break this Down
This is Defing how many TPoints there are and it will serch Through Each TPoint for the UpText.
Making the TPoint out off all the TPA's
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 ;).
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
TPoint:= Point(X,Y);or
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
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.
*** 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.
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
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.
TP:= MiddleTPA(TPA[i]); Making the TPoint out off all the TPA's
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 ;).