Прохожий
Покинул форум
Сообщений всего: 3
Дата рег-ции: Янв. 2016
Репутация: 0
|
При выполнении скрипта, когда дело доходит до проверки изображения, прога виснет, а когда отвисает скрипт начинает свою работу заного.
Вот скрипт:
int col_KIB, ex_KIB, ey_KIB, x_KIB, y_KIB, tim_KIB;
int Image_0_KIB[407][26];
start_();
m2: mousetransfer(LEFT, 1281, 344, 1128, 594, 0.0005);
mousedown (LEFT, 1142, 424);
pause (125);
mouseup (LEFT, 1142, 424);
pause (547);
mousedown (LEFT, 1108, 447);
pause (94);
mouseup (LEFT, 1108, 447);
pause (235);
mousetransfer(LEFT, 1315, 345, 1134, 614, 0.002);
mousetransfer(LEFT, 1351, 339, 1091, 657, 0.002);
mousedown (LEFT, 1030, 680);
pause (141);
mouseup (LEFT, 1030, 680);
pause (2350);
if (findimage_(#Image_0_KIB[0][0], 45, 40, 400, 0, 0, 0, 30, -1, 0, 60, 1)==1) goto m5;
else goto m1;
m5: mousetransfer(LEFT, 1281, 344, 1128, 594, 0.0005);
mousedown (LEFT, 1142, 424);
pause (125);
mouseup (LEFT, 1142, 424);
pause (547);
mousedown (LEFT, 1108, 447);
pause (94);
mouseup (LEFT, 1108, 447);
pause (235);
mousetransfer(LEFT, 1315, 345, 1134, 614, 0.002);
mousetransfer(LEFT, 1351, 339, 1091, 657, 0.002);
mousedown (LEFT, 1030, 680);
pause (141);
mouseup (LEFT, 1030, 680);
pause (2350);
if (findimage_(#Image_0_KIB[0][0], 50, 50, 50, 0, 0, 0, 50, -1, 0, 55, 1)==1) goto m8;
else goto m3;
m8: mousetransfer(LEFT, 1281, 344, 1128, 594, 0.0005);
mousedown (LEFT, 1142, 424);
pause (125);
mouseup (LEFT, 1142, 424);
pause (547);
mousedown (LEFT, 1108, 447);
pause (94);
mouseup (LEFT, 1108, 447);
pause (235);
mousetransfer(LEFT, 1389, 338, 1128, 594, 0.002);
pause (1378);
mousetransfer(LEFT, 1428, 343, 1128, 594, 0.002);
pause (1078);
mouse (LEFT, 1030, 680);
pause (1078);
if (findimage_(#Image_0_KIB[0][0], 55, 55, 50, 0, 0, 0, 50, -1, 0, 55, 1)==1) goto m11;
else goto m6;
m15: mousetransfer(LEFT, 1281, 344, 726, 229, 0.002);
mousedown (LEFT, 697, 267);
pause (125);
mouseup (LEFT, 697, 267);
pause (1703);
mousedown (LEFT, 1127, 429);
pause (172);
mouseup (LEFT, 1127, 429);
pause (2610);
goto m17;
m3: mousetransfer(LEFT, 1361, 337, 726, 229, 0.002);
mousedown (LEFT, 697, 267);
pause (125);
mouseup (LEFT, 697, 267);
pause (1703);
mousedown (LEFT, 1127, 429);
pause (172);
mouseup (LEFT, 1127, 429);
pause (2610);
goto m5;
m9: mousetransfer(LEFT, 1421, 338, 726, 229, 0.002);
mousedown (LEFT, 697, 267);
pause (125);
mouseup (LEFT, 697, 267);
pause (1703);
mousedown (LEFT, 1127, 429);
pause (172);
mouseup (LEFT, 1127, 429);
pause (2610);
goto m11;
m6: mousetransfer(LEFT, 1389, 338, 726, 229, 0.002);
mousedown (LEFT, 697, 267);
pause (125);
mouseup (LEFT, 697, 267);
pause (1703);
mousedown (LEFT, 1127, 429);
pause (172);
mouseup (LEFT, 1127, 429);
pause (2610);
goto m8;
m1: mousetransfer(LEFT, 1315, 345, 726, 229, 0.002);
mousedown (LEFT, 697, 267);
pause (125);
mouseup (LEFT, 697, 267);
pause (1703);
mousedown (LEFT, 1127, 429);
pause (172);
mouseup (LEFT, 1127, 429);
pause (2610);
goto m2;
m12: mousetransfer(LEFT, 1457, 299, 726, 229, 0.002);
mousedown (LEFT, 697, 267);
pause (125);
mouseup (LEFT, 697, 267);
pause (1703);
mousedown (LEFT, 1127, 429);
pause (172);
mouseup (LEFT, 1127, 429);
pause (2610);
goto exit;
m13: if (findimage_(#Image_0_KIB[0][0], 55, 55, 55, 0, 0, 0, 55, -1, 0, 55, 1)==1) goto m14;
else goto m9;
m14: mousetransfer(LEFT, 1281, 344, 1128, 594, 0.0005);
mousedown (LEFT, 1142, 424);
pause (125);
mouseup (LEFT, 1142, 424);
pause (547);
mousedown (LEFT, 1108, 447);
pause (94);
mouseup (LEFT, 1108, 447);
pause (235);
mousetransfer(LEFT, 1459, 339, 1134, 614, 0.002);
pause (235);
mouse (LEFT, 1481, 348);
pause (235);
mousetransfer(LEFT, 1281, 344, 1091, 657, 0.002);
pause (235);
mousedown (LEFT, 1030, 680);
pause (141);
mouseup (LEFT, 1030, 680);
pause (4350);
if (findimage_(#Image_0_KIB[0][0], 55, 55, 55, 0, 0, 0, 55, -1, 0, 55, 1)==1) goto m17;
else goto m12;
m17: mousetransfer(LEFT, 1276, 302, 1128, 594, 0.0005);
mousedown (LEFT, 1142, 424);
pause (125);
mouseup (LEFT, 1142, 424);
pause (547);
mousedown (LEFT, 1108, 447);
pause (94);
mouseup (LEFT, 1108, 447);
pause (235);
mousetransfer(LEFT, 1281, 344, 1134, 614, 0.002);
mousetransfer(LEFT, 1313, 338, 1091, 657, 0.002);
mousedown (LEFT, 1030, 680);
pause (141);
mouseup (LEFT, 1030, 680);
pause (2350);
if (findimage_(#Image_0_KIB[0][0], 55, 55, 55, 0, 0, 0, 55, -1, 0, 100, 1)==1) goto m19;
else goto m15;
m19: mousetransfer(LEFT, 1287, 298, 1275, 337, 0.005);
pause (125); goto m2;
m11: mousetransfer(LEFT, 1281, 344, 1128, 594, 0.0005);
mousedown (LEFT, 1142, 424);
pause (125);
mouseup (LEFT, 1142, 424);
pause (547);
mousedown (LEFT, 1108, 447);
pause (94);
mouseup (LEFT, 1108, 447);
pause (235);
mousetransfer(LEFT, 1421, 338, 1134, 614, 0.002);
mousetransfer(LEFT, 1457, 340, 1091, 657, 0.002);
mousedown (LEFT, 1030, 680);
pause (141);
mouseup (LEFT, 1030, 680);
pause (2350);
exit:;
function start_()
{
getdisplay(col_KIB, ex_KIB, ey_KIB);
load_image();
}
function load_image()
{
loadimage (#Image_0_KIB[0][0], "C:\Users\Андрей\Desktop\Image_0.bmp"
}
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)
{
pause(p1);
if (t!=1) tim_KIB=gettime();
a: if (r==0 && p==100){if (findimage(1, #Image[0][0], fon, #x_KIB, #y_KIB, 0, 0, ex_KIB, ey_KIB, -1)==1) goto e;}
else {if (findimage(1, #Image[0][0], fon, #x_KIB, #y_KIB, 0, 0, ex_KIB, ey_KIB, r, r, r, r, r, r, p, 1, -1)==1) goto e;}
if (t==0) return -1;
if (gettime()-tim_KIB<t){sleep(20); goto a;}
return -1;
e: pause(p2);
if (m==1){mouse(LEFT, x_KIB+xm, y_KIB+ym); pause(p3);}
if (m==2){mouse(MIDDLE, x_KIB+xm, y_KIB+ym); pause(p3);}
if (m==3){mouse(RIGHT, x_KIB+xm, y_KIB+ym); pause(p3);}
if (m==4){mousedown(LEFT, x_KIB+xm, y_KIB+ym); pause(p3);}
if (m==5){mousedown(MIDDLE, x_KIB+xm, y_KIB+ym); pause(p3);}
if (m==6){mousedown(RIGHT, x_KIB+xm, y_KIB+ym); pause(p3);}
if (m==7){mouseup(LEFT, x_KIB+xm, y_KIB+ym); pause(p3);}
if (m==8){mouseup(MIDDLE, x_KIB+xm, y_KIB+ym); pause(p3);}
if (m==9){mouseup(RIGHT, x_KIB+xm, y_KIB+ym); pause(p3);}
return 1;
} |