1: What are T-point?
A tpoint is a single point, with in the targeted client, with x and y coordinates.
First, before you do anything in simba always target the client, by dragging the green cross-hairs
to the correct client.
Now back to getting a tpoint. Simply click the color picker in simba and move the mouse to the desired location.
Then the tpoint will be down in the debug box.
Now to use the tpoint in a simple mouse procedure, using srl-6.
mouse(point(89,94),MOUSE_LEFT,MOUSE_ACCURATE);
The parameters for the mouse procedure are:
- The point you want to more the mouse to.
- Which mouse button.
- How you want to move the mouse.
Check out Srl-6 mouse documentation for a full list of mouse related function.
2: What are T-point arrays
Tpoint arrays are as the name states, a group of tpoints, that hold the value of different colors. Which are generally used in color finding procedures.
Basic usage of T-point arrays.
We start by using Auto color aid. To find the color we are looking for.
So lets start with this image.
As you can see, we have a couple of blue boxes.
Now open open up ACA and click inside of one of those boxes, and hit markbest color. That will be the color we will store in the tpa.
Now to use that in a basic color finding function. We will use the etl include to debug our tpa.
A full list of tools with dl links can be found on the home page.
The Script will look something like this.
program findTpointArray;
{$i Srl-6/srl.simba}
{$i ETl_Lape.simba}
procedure findtpa();
var
bluebox: TPointArray;
begin //start of function
if FindColorsTolerance(bluebox, 13387839, getClientBounds(), 0, colorSetting(2,0, 0)) then
begin
writeln('found tpa');
ETL_DebugTPA(bluebox,Clred);
end;
end;//end of function
begin
etl_start();
Findtpa()
end.
program findTpointArray;
{$i Srl-6/srl.simba}
{$i ETl_Lape.simba}
The first part of the script, we setup the program name and any includes we will be using.
procedure findtpa();
var
bluebox: TPointArray;
begin
if FindColorsTolerance(bluebox, 13387839, getClientBounds(), 0, colorSetting(2,0, 0)) then
In the second part of the code, we set up a procedure called findtpa().
Then with in that procedure we set up a couple of vars, bluebox as a TPA and setup the FindColorsTolerance function.
The FindcolorsTolerance parameters are:
- TPA to store the color
- The color to find
- The area you want to find it in
- The tolerance of the color
- and the color settings: cts, hue, and saturation, which can be found in ACA.
begin
writeln('found tpa');
ETL_DebugTPA(bluebox,Clred);
end;
In the third part of the code, we say if the TPA is found then write the line found TPA in the debug box.
Then have the etl include to debug our TPA in the color red.
begin
etl_start();
Findtpa()
end.
In the last part of the code, we start the etl include and add the findtpa procedure down in the main loop.
Results:
3: What are T2DPointArrays?
A T2DPointArray is basically a way to split up T-point arrays.
program findTpointArray;
{$i Srl-6/srl.simba}
{$i ETl_Lape.simba}
procedure findtpa();
var
bluebox: TPointArray;
blueboxes: T2DPointArray;
begin
if FindColorsTolerance(bluebox, 13387839, getClientBounds(), 0, colorSetting(2,0, 0)) then
begin
blueboxes := ClusterTPA(bluebox, 15);
writeln('found tpa');
ETL_DebugATPA(blueboxes);
end
end;
begin
etl_start();
Findtpa()
end.
Changes made from the previous example:
- We declare our T2DPointArray as blueboxes
- Then we use ClusterTPA to seperate our blueboxTpa,
ClusterTPA(tpa,15)
The parameters are:
- The tpa you want to cluster and the distance apart from each other.
Result:
Then if we want to sort the atpa by the largest first ,we have to add one line of code to our script
blueboxes.sortBySize(true);
The codes parameters are:
- The atpa you want to sort and if you want to sort by largest first.
The complete code should look like this.
program findTpointArray;
{$i Srl-6/srl.simba}
{$i ETl_Lape.simba}
procedure findtpa();
var
bluebox: TPointArray;
blueboxes: T2DPointArray;
begin
if FindColorsTolerance(bluebox, 13387839, getClientBounds(), 0, colorSetting(2,0, 0)) then
begin
blueboxes := ClusterTPA(bluebox, 15);
blueboxes.sortBySize(true);
writeln('found tpa');
ETL_DebugATPA(blueboxes);
end
end;
begin
etl_start();
Findtpa()
end.
When we run the code notice the numbers, AKA the Tpa, have changed from the previous results.
before:
After:
4: Selecting Arrays
Now that we know which tpa is which, after debugging with the etl include , we can use a mouse procedure to move the mouse to the correct one.
mouse(middletpa(blueboxes[0]),MOUSE_MOVE,MOUSE_ACCURATE);
In the above code we use the mouse procedure, from section 1 ,but this time use the function middletpa.
The middletpa requires one parameter, the tpa you want to get the center point of.
In this case blueboxes with the index of 0, we get this number from the previous example.
Full code:
program findTpointArray;
{$i Srl-6/srl.simba}
{$i ETl_Lape.simba}
procedure findtpa();
var
bluebox: TPointArray;
blueboxes: T2DPointArray;
begin
if FindColorsTolerance(bluebox, 13387839, getClientBounds(), 0, colorSetting(2,0, 0)) then
begin
blueboxes := ClusterTPA(bluebox, 15);
blueboxes.sortBySize(true);
writeln('found tpa');
mouse(middletpa(blueboxes[0]),MOUSE_MOVE,MOUSE_ACCURATE);
end
end;
begin
Findtpa()
end.
Results: