при запуске кода ошибка goto блока функций. может потому что нужно что-то прописывать в окне свойства функций принимаемые параметры, на видео в ютубе данной строки в блоке функции вообще нет, поэтому неясно.
если ставлю галочку отладка, при запуске кода вообще вылетает программа кибор.
CODE:int color_KIB_8[2], sum_color_KIB_8[2];
color_KIB_8[0]=16115387; color_KIB_8[1]=16115387;
sum_color_KIB_8[0]=2; sum_color_KIB_8[1]=2;
int col_KIB, ex_KIB, ey_KIB, sum_KIB, x_KIB, y_KIB;
int Image_0_KIB[58][24];
int Image_1_KIB[53][27];
int Image_2_KIB[21][18];
start_();
findimage_(#Image_0_KIB[0][0], 5000, 500, 0, 1, 0, 0, -1, 0, 0, 500, -1, -1, -1, 10, 100, 1, 1669, 2, 1913, 106, #sum_KIB, #x_KIB, #y_KIB);
findimage_(#Image_1_KIB[0][0], 5000, 1000, 0, 1, 0, 0, -1, 0, 0, 500, -1, -1, -1, 10, 100, 1, 1178, 904, 1421, 991, #sum_KIB, #x_KIB, #y_KIB);
m_KIB3: if (findimage_(#Image_2_KIB[0][0], 3000, 1000, 0, 1, 0, 0, -1, 0, 0, 500, -1, -1, -1, 20, 100, 1, 708, 805, 787, 835, #sum_KIB, #x_KIB, #y_KIB)>0) goto m_KIB5;
else goto m_KIB4;
m_KIB5: textout(0, 945, 520, "НАШЕЛ НАТАШУ ГОТОВЛЮСЬ СТРЕЛЯТЬ", 0);
pause(2000);
goto m_KIB6;
m_KIB4: textout(0, 945, 520, "ненашел наташу", 0);
pause(3000);
goto m_KIB3;
m_KIB6: стрельба();
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 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, -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); goto hy;}
if (m==2){mouse(MIDDLE, xs+xKIB+xm, ys+yKIB+ym); goto hy;}
if (m==3){mouse(RIGHT, xs+xKIB+xm, ys+yKIB+ym); goto hy;}
if (m==4){mousedown(LEFT, xs+xKIB+xm, ys+yKIB+ym); goto hy;}
if (m==5){mousedown(MIDDLE, xs+xKIB+xm, ys+yKIB+ym); goto hy;}
if (m==6){mousedown(RIGHT, xs+xKIB+xm, ys+yKIB+ym); goto hy;}
if (m==7){mouseup(LEFT, xs+xKIB+xm, ys+yKIB+ym); goto hy;}
if (m==8){mouseup(MIDDLE, xs+xKIB+xm, ys+yKIB+ym); goto hy;}
if (m==9){mouseup(RIGHT, xs+xKIB+xm, ys+yKIB+ym); goto hy;}
if (m==10){mousedbl(LEFT, xs+xKIB+xm, ys+yKIB+ym); goto hy;}
if (m==11){mousedbl(MIDDLE, xs+xKIB+xm, ys+yKIB+ym); goto hy;}
if (m==12){mousedbl(RIGHT, xs+xKIB+xm, ys+yKIB+ym); goto hy;}
if (m==13)mousemove(xs+xKIB+xm, ys+yKIB+ym);
hy: if (mov_m==1)mousemove(mov_x, mov_y);
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, -1)==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, -1)==0)return sumKIB;}
}
if (tcycle<cycle){tcycle++; goto sty;}
return 0;
}
return sumKIB;
}
function findheapcolor_(int onx, int ony, int oox, int ooy, 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 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, tx, ty, tcycle=0;
sty: pause(p1);
sumKIB=0;
if (t!=0) timKIB=gettime();
a: if (r!=0){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;};
else {sum=findheapcolor(k, #color[0], #sum_color[0], all_col, min_col, #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); goto hy;}
if (m==2){mouse(MIDDLE, xs+xKIB+xm, ys+yKIB+ym); goto hy;}
if (m==3){mouse(RIGHT, xs+xKIB+xm, ys+yKIB+ym); goto hy;}
if (m==4){mousedown(LEFT, xs+xKIB+xm, ys+yKIB+ym); goto hy;}
if (m==5){mousedown(MIDDLE, xs+xKIB+xm, ys+yKIB+ym); goto hy;}
if (m==6){mousedown(RIGHT, xs+xKIB+xm, ys+yKIB+ym); goto hy;}
if (m==7){mouseup(LEFT, xs+xKIB+xm, ys+yKIB+ym); goto hy;}
if (m==8){mouseup(MIDDLE, xs+xKIB+xm, ys+yKIB+ym); goto hy;}
if (m==9){mouseup(RIGHT, xs+xKIB+xm, ys+yKIB+ym); goto hy;}
if (m==10){mousedbl(LEFT, xs+xKIB+xm, ys+yKIB+ym); goto hy;}
if (m==11){mousedbl(MIDDLE, xs+xKIB+xm, ys+yKIB+ym); goto hy;}
if (m==12){mousedbl(RIGHT, xs+xKIB+xm, ys+yKIB+ym); goto hy;}
if (m==13)mousemove(xs+xKIB+xm, ys+yKIB+ym);
hy: if (mov_m==1)mousemove(mov_x, mov_y);
if (m>0 && m<14)pause(p3);
if (wait!=-1)
{
for (int ttim=gettime(); gettime()-ttim<wait; sleep(20))
{
if (r!=0){if (findheapcolor(1, #color[0], #sum_color[0], all_col, min_col, #tx, #ty, onx, ony, oox, ooy, xs, ys, xf, yf, r, r, r, r, r, r, -1)==0)return sumKIB;}
else {if (findheapcolor(1, #color[0], #sum_color[0], all_col, min_col, #tx, #ty, onx, ony, oox, ooy, xs, ys, xf, yf, -1)==0)return sumKIB;}
}
if (tcycle<cycle){tcycle++; goto sty;}
return 0;
}
return sumKIB;
}
function load_image_()
{
loadimage (#Image_0_KIB[0][0], "C:\Users\Inre25\Documents\Bot_war_robot\boi1.bmp");
loadimage (#Image_1_KIB[0][0], "C:\Users\Inre25\Documents\Bot_war_robot\boi2.bmp");
loadimage (#Image_2_KIB[0][0], "C:\Users\Inre25\Documents\Bot_war_robot\natasha1.bmp");
}
function стрельба()
{
m_KIB2: if (findheapcolor_(6, 6, 14, 14, 3000, 500, 0, 0, 0, 0, -1, 0, 0, 500, -1, -1, 10, 1, 1667, 803, 1699, 828, 2, 2, #sum_KIB, #x_KIB, #y_KIB, #color_KIB_8[0], #sum_color_KIB_8[0])>0) goto m_KIB1;
else goto m_KIB3;
m_KIB1: pause(rand(500, 1000));
mouse(LEFT);
pause(rand(500, 1000));
goto m_KIB2;
m_KIB3: keydown('a');
pause(rand(500, 1000));
keyup('a');
pause(rand(500, 1000));
keydown('w');
pause(rand(500, 1000));
keyup('w');
pause(rand(500, 1000));
keydown('d');
pause(rand(500, 1000));
keyup('d);
goto m_KIB2;
}