Вроде как всё хорошо должно работать но нет.!
как сделаю новые выделеные скрины всё норм.
в след бою работает только одна- две кнопки
win w_KIB;
int ex_KIB, ey_KIB, sum_KIB, x_KIB, y_KIB;
int Image_0_KIB[24][17];
int Image_1_KIB[30][16];
int Image_2_KIB[31][22];
int Image_3_KIB[17][20];
int Image_4_KIB[65][25];
int Image_5_KIB[27][23];
int Image_6_KIB[22][21];
start_();
findimage_(#Image_0_KIB[0][0], 100, 100, 0, 1, 0, 0, -1, 0, 0, 100, -1, -1, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB);
if (findimage_(#Image_1_KIB[0][0], 500, 500, 0, 1, 0, 0, -1, 0, 0, 1500, -1, -1, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB)>0) goto m_KIB3;
else goto m_KIB5;
m_KIB3: findimage_(#Image_2_KIB[0][0], 500, 500, 0, 1, 0, 0, -1, 0, 0, 3000, -1, -1, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB);
if (findimage_(#Image_3_KIB[0][0], 500, 1000, 0, 1, 0, 0, -1, 0, 0, 1500, -1, -1, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB)>0) goto m_KIB6;
else goto m_KIB8;
m_KIB6: findimage_(#Image_4_KIB[0][0], 200, 200, 0, 1, 0, 0, -1, 0, 0, 500, -1, -1, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB);
m_KIB8: findimage_(#Image_2_KIB[0][0], 500, 500, 0, 1, 0, 0, -1, 0, 0, 500, -1, -1, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB);
m_KIB7: findimage_(#Image_5_KIB[0][0], 500, 500, 0, 1, 0, 0, -1, 0, 0, 1500, -1, -1, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB);
findimage_(#Image_4_KIB[0][0], 1000, 1000, 0, 1, 0, 0, -1, 0, 0, 1500, -1, -1, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB);
if (findimage_(#Image_2_KIB[0][0], 1000, 1000, 0, 1, 0, 0, -1, 0, 0, 500, -1, -1, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB)>0) goto m_KIB11;
else goto m_KIB7;
m_KIB5: findimage_(#Image_4_KIB[0][0], 100, 532, 0, 1, 0, 0, -1, 0, 0, 3500, -1, -1, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB); goto m_KIB3;
m_KIB11: findimage_(#Image_6_KIB[0][0], 750, 750, 0, 1, 0, 0, -1, 0, 0, 1500, -1, -1, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB);
function start_()
{
load_image_();
pause(1000);
int x, y;
getmouse(x, y);
w_KIB=getwindow(0, x, y);
ex_KIB=w_KIB.widthclient; ey_KIB=w_KIB.heightclient;
}
function findimage_(int #Image, int t, int p1, int p2, int m, int xm, int ym, int mov_m, int mov_x, int mov_y, int p3, int wait, int cycle, int fon, int r, int p, int k, int xs, int ys, int xf, int yf, int#sum, int#x, int#y)
{
int timKIB, sumKIB, xKIB, yKIB, tx, ty, tcycle=0;
sty: pause(p1);
sumKIB=0;
if (t!=0) timKIB=gettime();
a: if (r==0 && p==100){sum=findimage(k, #Image[0][0], fon, #x[0], #y[0], xs, ys, xf, yf, w_KIB); if (sum>0) goto e;}
else {sum=findimage(k, #Image[0][0], fon, #x[0], #y[0], xs, ys, xf, yf, r, r, r, r, r, r, p, 1, w_KIB); 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){sendmouse(LEFT, xs+xKIB+xm, ys+yKIB+ym, w_KIB); goto hy;}
if (m==2){sendmouse(MIDDLE, xs+xKIB+xm, ys+yKIB+ym, w_KIB); goto hy;}
if (m==3){sendmouse(RIGHT, xs+xKIB+xm, ys+yKIB+ym, w_KIB); goto hy;}
if (m==4){sendmousedown(LEFT, xs+xKIB+xm, ys+yKIB+ym, w_KIB); goto hy;}
if (m==5){sendmousedown(MIDDLE, xs+xKIB+xm, ys+yKIB+ym, w_KIB); goto hy;}
if (m==6){sendmousedown(RIGHT, xs+xKIB+xm, ys+yKIB+ym, w_KIB); goto hy;}
if (m==7){sendmouseup(LEFT, xs+xKIB+xm, ys+yKIB+ym, w_KIB); goto hy;}
if (m==8){sendmouseup(MIDDLE, xs+xKIB+xm, ys+yKIB+ym, w_KIB); goto hy;}
if (m==9){sendmouseup(RIGHT, xs+xKIB+xm, ys+yKIB+ym, w_KIB); goto hy;}
if (m==10){sendmousedbl(LEFT, xs+xKIB+xm, ys+yKIB+ym, w_KIB); goto hy;}
if (m==11){sendmousedbl(MIDDLE, xs+xKIB+xm, ys+yKIB+ym, w_KIB); goto hy;}
if (m==12){sendmousedbl(RIGHT, xs+xKIB+xm, ys+yKIB+ym, w_KIB); goto hy;}
if (m==13)sendmousemove(xs+xKIB+xm, ys+yKIB+ym, w_KIB);
hy: if (mov_m==1)sendmousemove(mov_x, mov_y, w_KIB);
if (m>0 && m<14)pause(p3);
if (wait!=-1)
{
for (int ttim=gettime(); gettime()-ttim<wait; sleep(20))
{
if (r==0 && p==100){if (findimage(1, #Image[0][0], fon, #x[0], #y[0], xs, ys, xf, yf, w_KIB)==0)return sumKIB;}
else {if (findimage(1, #Image[0][0], fon, #x[0], #y[0], xs, ys, xf, yf, r, r, r, r, r, r, p, 1, w_KIB)==0)return sumKIB;}
}
if (tcycle<cycle){tcycle++; goto sty;}
return 0;
}
return sumKIB;
}
function load_image_()
{
loadimage (#Image_0_KIB[0][0], "C:\Íîâàÿ ïàïêà\gena.bmp" );
loadimage (#Image_1_KIB[0][0], "C:\Íîâàÿ ïàïêà\mag2.bmp" );
loadimage (#Image_2_KIB[0][0], "C:\Íîâàÿ ïàïêà\molni91.bmp" );
loadimage (#Image_3_KIB[0][0], "C:\Íîâàÿ ïàïêà\ban'wa.bmp" );
loadimage (#Image_4_KIB[0][0], "C:\Íîâàÿ ïàïêà\faza.bmp" );
loadimage (#Image_5_KIB[0][0], "C:\Íîâàÿ ïàïêà\jertva.bmp" );
loadimage (#Image_6_KIB[0][0], "C:\Íîâàÿ ïàïêà\koroleva.ban'w1.bmp" );
}
1. leva96 - 23 Сентября, 2018 - 12:23:13 - перейти к сообщению
2. Nathgul - 25 Сентября, 2018 - 23:04:51 - перейти к сообщению
сравни новые скрины со старыми, наверняка есть разница... только сравнивать нужно пиксель в пиксель... а лучше посмотри динамику изображения в реальном времени...