int col_KIB, ex_KIB, ey_KIB, sum_KIB, x_KIB, y_KIB;
int Image_0_KIB[47][12];
int Image_1_KIB[49][8];
start_();
m_KIB5: enablerealmouse(60, 15, 5, 5);
findimage_(#Image_1_KIB[0][0], 2000, 0, 0, 1, 1, 1, 0, -1, 0, 90, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB);
pause(rand(1000, 2000));
finddynamic_(5, 5, 30, 30, 2000, 200, 10, 0, 1, 1, 1, 0, 1, 73, 240, 1513, 364, #sum_KIB, #x_KIB, #y_KIB);
mouse(LEFT);
m_KIB3: if (findimage_(#Image_0_KIB[0][0], 3000, 0, 0, 0, 0, 0, 0, -1, 0, 90, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB)>0) goto m_KIB0;
else goto m_KIB8;
m_KIB0: pause(25000);
pause(rand(1000, 2000)); goto m_KIB5;
m_KIB9: mouse(LEFT); goto m_KIB3;
m_KIB8: finddynamic_(5, 5, 30, 30, 2000, 200, 0, 0, 1, 2, 2, 0, 1, 1034, 240, 1329, 519, #sum_KIB, #x_KIB, #y_KIB); goto m_KIB9;
function start_()
{
getdisplay(col_KIB, ex_KIB, ey_KIB);
load_image_();
pause(1000);
}
function findimage_(int #Image, int t, int p1, int p2, int m, int xm, int ym, int p3, 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;
pause(p1);
sumKIB=0;
if (t!=1) timKIB=gettime();
a: if (r==0 && p==100){sum=findimage(k, #Image[0][0], fon, #x[0], #y[0], xs, ys, xf, yf, -1); 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, -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;
}
function finddynamic_(int onx, int ony, int oox, int ooy, int t, int pscan, int p1, int p2, int m, int xm, int ym, int p3, int k, int xs, int ys, int xf, int yf, int#sum, int#x, int#y)
{
int timKIB, sumKIB, xKIB, yKIB;
pause(p1);
sumKIB=0;
if (t!=1) timKIB=gettime();
a: finddynamic(0, #x[0], #y[0], 0, 0, 0, 0, xs, ys, xf, yf, -1);
pause(pscan);
sum=finddynamic(k, #x[0], #y[0], onx, ony, oox, ooy, xs, ys, xf, yf, -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;
}
function load_image_()
{
loadimage (#Image_0_KIB[0][0], "D:\av\Рыбалка\Image_0.bmp"
;
loadimage (#Image_1_KIB[0][0], "D:\av\Рыбалка\Image_1.bmp"
;
}