Так не работает(Поиск по скученности цветов, вывод сообщений и изменение положения):
код (Отобразить)
CODE:
int color_KIB_6[4], sum_color_KIB_6[4];
color_KIB_6[0]=14260496; color_KIB_6[1]=12419845; color_KIB_6[2]=16446694; color_KIB_6[3]=13274378;
sum_color_KIB_6[0]=10; sum_color_KIB_6[1]=10; sum_color_KIB_6[2]=10; sum_color_KIB_6[3]=10;
win w=window ("Hearthstone", "UnityWndClass", -1);
int col_KIB, ex_KIB, ey_KIB, sum_KIB, x_KIB, y_KIB;
start_();
m_KIB2: if (findheapcolor_(20, 20, 50, 50, 3000, 0, 0, 1, 0, 0, 0, 10, 1, 0, 0, ex_KIB, ey_KIB, 4, 4, #sum_KIB, #x_KIB, #y_KIB, #color_KIB_6[0], #sum_color_KIB_6[0])>0) goto m_KIB4;
else goto m_KIB5;
m_KIB4: textout(0, 100, 50, " Нашел", 0);
pause(7000);
w.leftclient = 0;
w.topclient = 0;
activate(w);
moveclient(w);
activate(w);
goto m_KIB1;
m_KIB5: textout(0, 100, 50, "Не нашел", 0);
pause(1000);
goto m_KIB2;
m_KIB1: textout(0, 100, 50, "Подвинул", 0);
function start_()
{
getdisplay(col_KIB, ex_KIB, ey_KIB);
pause(1000);
}
function findheapcolor_(int onx, int ony, int oox, int ooy, int t, int p1, int p2, int m, int xm, int ym, int p3, int r, int k, int xs, int ys, int xf, int yf, int all_col, int min_col, int#sum, int#x, int#y, int#color, int#sum_color)
{
int timKIB, sumKIB, xKIB, yKIB;
pause(p1);
sumKIB=0;
if (t!=1) timKIB=gettime();
a: sum=findheapcolor(k, #color[0], #sum_color[0], all_col, min_col, #x[0], #y[0], onx, ony, oox, ooy, xs, ys, xf, yf, r, r, r, r, r, r, -1);
if (sum>0) goto e;
if (t==0) return 0;
if (gettime()-timKIB<t){sleep(20); goto a;}
return 0;
e: sumKIB=sum; xKIB=x[0]; yKIB=y[0];
pause(p2);
if (m==1){mouse(LEFT, xs+xKIB+xm, ys+yKIB+ym); pause(p3);}
if (m==2){mouse(MIDDLE, xs+xKIB+xm, ys+yKIB+ym); pause(p3);}
if (m==3){mouse(RIGHT, xs+xKIB+xm, ys+yKIB+ym); pause(p3);}
if (m==4){mousedown(LEFT, xs+xKIB+xm, ys+yKIB+ym); pause(p3);}
if (m==5){mousedown(MIDDLE, xs+xKIB+xm, ys+yKIB+ym); pause(p3);}
if (m==6){mousedown(RIGHT, xs+xKIB+xm, ys+yKIB+ym); pause(p3);}
if (m==7){mouseup(LEFT, xs+xKIB+xm, ys+yKIB+ym); pause(p3);}
if (m==8){mouseup(MIDDLE, xs+xKIB+xm, ys+yKIB+ym); pause(p3);}
if (m==9){mouseup(RIGHT, xs+xKIB+xm, ys+yKIB+ym); pause(p3);}
if (m==10){mousemove(xs+xKIB+xm, ys+yKIB+ym); pause(p3);}
return sumKIB;
}
color_KIB_6[0]=14260496; color_KIB_6[1]=12419845; color_KIB_6[2]=16446694; color_KIB_6[3]=13274378;
sum_color_KIB_6[0]=10; sum_color_KIB_6[1]=10; sum_color_KIB_6[2]=10; sum_color_KIB_6[3]=10;
win w=window ("Hearthstone", "UnityWndClass", -1);
int col_KIB, ex_KIB, ey_KIB, sum_KIB, x_KIB, y_KIB;
start_();
m_KIB2: if (findheapcolor_(20, 20, 50, 50, 3000, 0, 0, 1, 0, 0, 0, 10, 1, 0, 0, ex_KIB, ey_KIB, 4, 4, #sum_KIB, #x_KIB, #y_KIB, #color_KIB_6[0], #sum_color_KIB_6[0])>0) goto m_KIB4;
else goto m_KIB5;
m_KIB4: textout(0, 100, 50, " Нашел", 0);
pause(7000);
w.leftclient = 0;
w.topclient = 0;
activate(w);
moveclient(w);
activate(w);
goto m_KIB1;
m_KIB5: textout(0, 100, 50, "Не нашел", 0);
pause(1000);
goto m_KIB2;
m_KIB1: textout(0, 100, 50, "Подвинул", 0);
function start_()
{
getdisplay(col_KIB, ex_KIB, ey_KIB);
pause(1000);
}
function findheapcolor_(int onx, int ony, int oox, int ooy, int t, int p1, int p2, int m, int xm, int ym, int p3, int r, int k, int xs, int ys, int xf, int yf, int all_col, int min_col, int#sum, int#x, int#y, int#color, int#sum_color)
{
int timKIB, sumKIB, xKIB, yKIB;
pause(p1);
sumKIB=0;
if (t!=1) timKIB=gettime();
a: sum=findheapcolor(k, #color[0], #sum_color[0], all_col, min_col, #x[0], #y[0], onx, ony, oox, ooy, xs, ys, xf, yf, r, r, r, r, r, r, -1);
if (sum>0) goto e;
if (t==0) return 0;
if (gettime()-timKIB<t){sleep(20); goto a;}
return 0;
e: sumKIB=sum; xKIB=x[0]; yKIB=y[0];
pause(p2);
if (m==1){mouse(LEFT, xs+xKIB+xm, ys+yKIB+ym); pause(p3);}
if (m==2){mouse(MIDDLE, xs+xKIB+xm, ys+yKIB+ym); pause(p3);}
if (m==3){mouse(RIGHT, xs+xKIB+xm, ys+yKIB+ym); pause(p3);}
if (m==4){mousedown(LEFT, xs+xKIB+xm, ys+yKIB+ym); pause(p3);}
if (m==5){mousedown(MIDDLE, xs+xKIB+xm, ys+yKIB+ym); pause(p3);}
if (m==6){mousedown(RIGHT, xs+xKIB+xm, ys+yKIB+ym); pause(p3);}
if (m==7){mouseup(LEFT, xs+xKIB+xm, ys+yKIB+ym); pause(p3);}
if (m==8){mouseup(MIDDLE, xs+xKIB+xm, ys+yKIB+ym); pause(p3);}
if (m==9){mouseup(RIGHT, xs+xKIB+xm, ys+yKIB+ym); pause(p3);}
if (m==10){mousemove(xs+xKIB+xm, ys+yKIB+ym); pause(p3);}
return sumKIB;
}
А так работает(вывод сообщений и изменение положения окна).
код (Отобразить)
CODE:
win w=window ("Hearthstone", "UnityWndClass", -1);
textout(0, 100, 50, " Нашел", 0);
pause(7000);
w.leftclient = 0;
w.topclient = 0;
activate(w);
moveclient(w);
activate(w);
textout(0, 100, 50, "Подвинул", 0);
textout(0, 100, 50, " Нашел", 0);
pause(7000);
w.leftclient = 0;
w.topclient = 0;
activate(w);
moveclient(w);
activate(w);
textout(0, 100, 50, "Подвинул", 0);
Как можно решить подобную проблему?