The video demonstrates the work of this function in the game. Watch the video search for the mobs in the game .
This shows the search for the animated characterin real time on the video.
It is used to search for objects by specifying several different colors that are in this object and the expected size of the object (there should be all the pixels in this area). You can specify both the RGB color difference and the minimum quantity (it can be less) than the specified number of colors that should be in the object. It also indicates the area where you no longer search. This area is located below the first pixel found by Y and in the middle by X.
For example, one side is identified by 5 colors
23432 6864554 99888 25588989
and the other on
23432 6864554 998887664588989
Therefore, in the minimum required number, you must specify 4
To find the optimal colors and their number, taking into account the color difference, you can use this toolSelecting Colors Kibor.
Syntax without leakage in color:
findheapcolor(how many_search, #color[0], #kol[0], how_colors, how_colors, minimum, #x[0], #y[0], X_size, Y size, Size_of_here not X , Area_Size_here do not search Y, start_X_ search, start_Y_ search, finish_X_ search, finish_X_ search, pointer to the window);
Syntax with color difference:
findheapcolor(how many_search, #color[0], #kol[0], how_colors, how_colors, minimum, #x[0], #y[0], X_size, Y size, Size_of_here not X , Area_area_here not to look for Y, Start_X_Search, Start_Y_Search, Finish_X_Search, Finish_X_Search,Red_less_a, Red_bolshe__,Green_small, Green_Larger,[color=indigo]Blue_Message, Blue_bolshe__na, pointer to the window);
If the first parameter is -1, everything is searchable.
#color[0]pointer to array int in which the sought colors of pixels
#kol[0]a pointer to an array int in which there are how many each color should be pixels in order for the color to be considered to be considered. For example, in kol[0]there is an amount for color[0]. in kol[1]there is an amount for color[1].
#x[0], #y[0]-int array in which the coordinatesof the firstfound pixel in the heap.
Returns the number of found objects.
Errors
-1 -array of receiver X is less than the found crowding
-2 -array of receiver X is less than the found crowding
-3 -the size of the expected object in X is less than the search area
-4 -the size of the expected object by Y is less than the search area
-5 -an array of colors less than the number indicated in the parameter 4
-6 -the quantity array for each color is less than the number specified in the parameter 4
Explanation:
An example of a search in the picture below. select 2 or 3 colors:
CODE:
int min_col=3;//Find if all three colors
//int min_col=2;//Only any 2
int r=10;
int color[3];
color[0]=2366701; color[1]=5026082; color[2]=13387839;//Here colors
int kol[3];
kol[0]=55; kol[1]=55; kol[2]=55;
int x[50], y[50];
sleep (500);
int colors, xw, yw;
getdisplay (colors, xw, yw);
int k=findheapcolor (20, #color[0], #kol[0], 3, min_col, #x[0], #y[0], 15, 15, 50, 50, 0, 0, xw, yw , r, r, r, r, r, r, -1);
textbkcolor (8454143,255);
int n=0;
s: if (n<k)
{
textout(n, x[n], y[n], format(n), 0);
mousemove(x[n], y[n]);
sleep(1000);
n++;
goto s;
}
messagebox (format(k)+" objects");
//int min_col=2;//Only any 2
int r=10;
int color[3];
color[0]=2366701; color[1]=5026082; color[2]=13387839;//Here colors
int kol[3];
kol[0]=55; kol[1]=55; kol[2]=55;
int x[50], y[50];
sleep (500);
int colors, xw, yw;
getdisplay (colors, xw, yw);
int k=findheapcolor (20, #color[0], #kol[0], 3, min_col, #x[0], #y[0], 15, 15, 50, 50, 0, 0, xw, yw , r, r, r, r, r, r, -1);
textbkcolor (8454143,255);
int n=0;
s: if (n<k)
{
textout(n, x[n], y[n], format(n), 0);
mousemove(x[n], y[n]);
sleep(1000);
n++;
goto s;
}
messagebox (format(k)+" objects");
An example of finding the mobs in the picture below:
CODE:
int color[3];
int r=5;
color[0]=2899273; color[1]=2899273; color[2]=791579;//Here colors
int kol[3];
kol[0]=25; kol[1]=25; kol[2]=25;
int x[50], y[50];
sleep (500);
int colors, xw, yw;
getdisplay (colors, xw, yw);
int k=findheapcolor (20, #color[0], #kol[0], 3, 3, #x[0], #y[0], 30, 30, 70, 80, 0, 0, xw, yw , r, r, r, r, r, r, -1);
textbkcolor (8454143,255);
int n=0;
s: if (n <k)
{
textout (n, x[n], y[n], format (n), 0);
mousemove (x[n], y[n]);
sleep (1000);
n++;
goto s;
}
messagebox (format (k) + " objects");
int r=5;
color[0]=2899273; color[1]=2899273; color[2]=791579;//Here colors
int kol[3];
kol[0]=25; kol[1]=25; kol[2]=25;
int x[50], y[50];
sleep (500);
int colors, xw, yw;
getdisplay (colors, xw, yw);
int k=findheapcolor (20, #color[0], #kol[0], 3, 3, #x[0], #y[0], 30, 30, 70, 80, 0, 0, xw, yw , r, r, r, r, r, r, -1);
textbkcolor (8454143,255);
int n=0;
s: if (n <k)
{
textout (n, x[n], y[n], format (n), 0);
mousemove (x[n], y[n]);
sleep (1000);
n++;
goto s;
}
messagebox (format (k) + " objects");
yet..
CODE:
int r=10;
int color[3], kol[3];
int x[20], y[20];
int colors, xw, yw;
color[0]=15990775; color[1]=8847032; color[2]=4192909;
kol[0]=1; kol[1]=1; kol[2]=1;
sleep (500);
getdisplay (colors, xw, yw);
int k=findheapcolor (20, #color[0], #kol[0], 3, 3, #x[0], #y[0], 30, 30, 50, 50, 0, 0, xw, yw , r, r, r, r, r, r, -1);
textbkcolor (8454143,255);
for (int n=0; n <k; n ++)
{
textout (n, x[n], y[n], format (n), 0);
mousemove (x[n], y[n]);
sleep (1000);
}
messagebox (format (k) + " objects");
int color[3], kol[3];
int x[20], y[20];
int colors, xw, yw;
color[0]=15990775; color[1]=8847032; color[2]=4192909;
kol[0]=1; kol[1]=1; kol[2]=1;
sleep (500);
getdisplay (colors, xw, yw);
int k=findheapcolor (20, #color[0], #kol[0], 3, 3, #x[0], #y[0], 30, 30, 50, 50, 0, 0, xw, yw , r, r, r, r, r, r, -1);
textbkcolor (8454143,255);
for (int n=0; n <k; n ++)
{
textout (n, x[n], y[n], format (n), 0);
mousemove (x[n], y[n]);
sleep (1000);
}
messagebox (format (k) + " objects");