Спойлер (Отобразить)
CODE:
win w_KIB;
int ex_KIB, ey_KIB, sum_KIB, x_KIB, y_KIB;
int Image_0_KIB[11][11];
int Image_1_KIB[19][22];
int Image_2_KIB[24][20];
int Image_3_KIB[18][19];
int Image_4_KIB[11][7];
int Image_5_KIB[22][23];
int Image_6_KIB[23][18];
int Image_7_KIB[26][18];
int Image_8_KIB[16][14];
int Image_9_KIB[22][15];
int Image_10_KIB[7][7];
function load_image_()
{
string put=tempfolder();
unpack("D:\Kibor\farm\iia.bmp", temp_fold+"iia.bmp", 1);
...
unpack("D:\Kibor\oa?i_iaiiu\iia_ea?eo.bmp", temp_fold+"iia_ea?eo.bmp", 1);
loadimage (#Image_0_KIB[0][0], "D:\Kibor\farm\iia.bmp");
...
loadimage (#Image_10_KIB[0][0], "D:\Kibor\oa?i_iaiiu\iia_ea?eo.bmp");
}
start_();
m_KIB2: key_(13, 2, 0, 0);
if (findimage_(#Image_0_KIB[0][0], 0, 0, 0, 0, 0, 0, 0, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB)>0) goto m_KIB4;
else goto m_KIB2;
m_KIB4: key_(13, 3, 0, 0);
key_(49, 1, 0, 0);
key_(13, 1, 1500, 100);
key_(13, 1, 0, 0);
findimage_(#Image_1_KIB[0][0], 300, 0, 0, 1, 0, 0, 0, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB);
if (findimage_(#Image_2_KIB[0][0], 300, 0, 333, 0, 0, 0, 0, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB)>0) goto m_KIB10;
else goto m_KIB2;
m_KIB10: key_(112, 1, 0, 250);
key_(112, 1, 0, 0);
findimage_(#Image_3_KIB[0][0], 66666, 0, 3000, 1, 0, 145, 0, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB);
findimage_(#Image_4_KIB[0][0], 66666, 0, 0, 1, 0, 0, 10000, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB);
key_(39, 1, 0, 200);
key_(40, 1, 0, 100);
m_KIB18: if (findimage_(#Image_7_KIB[0][0], 100, 0, 0, 0, 0, 0, 0, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB)>0) goto m_KIB21;
else goto m_KIB17;
m_KIB21: key_(113, 1, 0, 150);
key_(113, 1, 0, 150); goto m_KIB18;
m_KIB1: goto m_KIB2;
m_KIB19: if (findimage_(#Image_5_KIB[0][0], 80, 0, 0, 0, 0, 0, 0, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB)>0) goto m_KIB23;
else goto m_KIB18;
m_KIB23: key_(112, 1, 0, 100);
findimage_(#Image_8_KIB[0][0], 66666, 0, 0, 1, 0, 0, 1000, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB);
findimage_(#Image_9_KIB[0][0], 66666, 555, 0, 1, 0, -180, 0, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB);
findimage_(#Image_10_KIB[0][0], 2147483647, 0, 0, 1, 0, 0, 0, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB); goto m_KIB1;
m_KIB16: if (findimage_(#Image_5_KIB[0][0], 100, 0, 0, 0, 0, 0, 0, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB)>0) goto m_KIB23;
else goto m_KIB22;
m_KIB22: key_(39, 1, 0, 70); goto m_KIB19;
m_KIB17: if (findimage_(#Image_6_KIB[0][0], 100, 0, 0, 0, 0, 0, 0, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB)>0) goto m_KIB21;
else goto m_KIB16;
function start_()
{
load_image_();
pause(1000);
int x, y;
getmouse(x, y);
w_KIB=getwindow(1, x, y);
ex_KIB=w_KIB.widthclient; ey_KIB=w_KIB.heightclient;
}
function key_(int k, int m, int p1, int p2)
{
pause(p1);
if (m==1) sendkey(k, w_KIB);
if (m==2) keydown(k);
if (m==3) keyup(k);
pause(p2);
}
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, 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); pause(p3);}
if (m==2){sendmouse(MIDDLE, xs+xKIB+xm, ys+yKIB+ym, w_KIB); pause(p3);}
if (m==3){sendmouse(RIGHT, xs+xKIB+xm, ys+yKIB+ym, w_KIB); pause(p3);}
if (m==4){sendmousedown(LEFT, xs+xKIB+xm, ys+yKIB+ym, w_KIB); pause(p3);}
if (m==5){sendmousedown(MIDDLE, xs+xKIB+xm, ys+yKIB+ym, w_KIB); pause(p3);}
if (m==6){sendmousedown(RIGHT, xs+xKIB+xm, ys+yKIB+ym, w_KIB); pause(p3);}
if (m==7){sendmouseup(LEFT, xs+xKIB+xm, ys+yKIB+ym, w_KIB); pause(p3);}
if (m==8){sendmouseup(MIDDLE, xs+xKIB+xm, ys+yKIB+ym, w_KIB); pause(p3);}
if (m==9){sendmouseup(RIGHT, xs+xKIB+xm, ys+yKIB+ym, w_KIB); pause(p3);}
if (m==10){sendmousemove(xs+xKIB+xm, ys+yKIB+ym, w_KIB); pause(p3);}
return sumKIB;
}
function load_image_()
{
loadimage (#Image_0_KIB[0][0], "D:\Kibor\farm\iia.bmp");
loadimage (#Image_1_KIB[0][0], "D:\Kibor\farm\?ai.bmp");
loadimage (#Image_2_KIB[0][0], "D:\Kibor\farm\noieaooe.bmp");
loadimage (#Image_3_KIB[0][0], "D:\Kibor\oa?i_iaiiu\auoia1.bmp");
loadimage (#Image_4_KIB[0][0], "D:\Kibor\oa?i_iaiiu\eoiao.bmp");
loadimage (#Image_5_KIB[0][0], "D:\Kibor\oa?i_iaiiu\eoo_eiiao.bmp");
loadimage (#Image_6_KIB[0][0], "D:\Kibor\oa?i_iaiiu\eoo2.bmp");
loadimage (#Image_7_KIB[0][0], "D:\Kibor\oa?i_iaiiu\eoo1.bmp");
loadimage (#Image_8_KIB[0][0], "D:\Kibor\oa?i_iaiiu\aoia1.bmp");
loadimage (#Image_9_KIB[0][0], "D:\Kibor\oa?i_iaiiu\aoia2.bmp");
loadimage (#Image_10_KIB[0][0], "D:\Kibor\oa?i_iaiiu\iia_ea?eo.bmp");
}
RESOURCE
{
"D:\Kibor\farm\iia.bmp";
"D:\Kibor\farm\?ai.bmp";
"D:\Kibor\farm\noieaooe.bmp";
"D:\Kibor\oa?i_iaiiu\auoia1.bmp";
"D:\Kibor\oa?i_iaiiu\eoiao.bmp";
"D:\Kibor\oa?i_iaiiu\eoo_eiiao.bmp";
"D:\Kibor\oa?i_iaiiu\eoo2.bmp";
"D:\Kibor\oa?i_iaiiu\eoo1.bmp";
"D:\Kibor\oa?i_iaiiu\aoia1.bmp";
"D:\Kibor\oa?i_iaiiu\aoia2.bmp";
"D:\Kibor\oa?i_iaiiu\iia_ea?eo.bmp";
}
int ex_KIB, ey_KIB, sum_KIB, x_KIB, y_KIB;
int Image_0_KIB[11][11];
int Image_1_KIB[19][22];
int Image_2_KIB[24][20];
int Image_3_KIB[18][19];
int Image_4_KIB[11][7];
int Image_5_KIB[22][23];
int Image_6_KIB[23][18];
int Image_7_KIB[26][18];
int Image_8_KIB[16][14];
int Image_9_KIB[22][15];
int Image_10_KIB[7][7];
function load_image_()
{
string put=tempfolder();
unpack("D:\Kibor\farm\iia.bmp", temp_fold+"iia.bmp", 1);
...
unpack("D:\Kibor\oa?i_iaiiu\iia_ea?eo.bmp", temp_fold+"iia_ea?eo.bmp", 1);
loadimage (#Image_0_KIB[0][0], "D:\Kibor\farm\iia.bmp");
...
loadimage (#Image_10_KIB[0][0], "D:\Kibor\oa?i_iaiiu\iia_ea?eo.bmp");
}
start_();
m_KIB2: key_(13, 2, 0, 0);
if (findimage_(#Image_0_KIB[0][0], 0, 0, 0, 0, 0, 0, 0, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB)>0) goto m_KIB4;
else goto m_KIB2;
m_KIB4: key_(13, 3, 0, 0);
key_(49, 1, 0, 0);
key_(13, 1, 1500, 100);
key_(13, 1, 0, 0);
findimage_(#Image_1_KIB[0][0], 300, 0, 0, 1, 0, 0, 0, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB);
if (findimage_(#Image_2_KIB[0][0], 300, 0, 333, 0, 0, 0, 0, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB)>0) goto m_KIB10;
else goto m_KIB2;
m_KIB10: key_(112, 1, 0, 250);
key_(112, 1, 0, 0);
findimage_(#Image_3_KIB[0][0], 66666, 0, 3000, 1, 0, 145, 0, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB);
findimage_(#Image_4_KIB[0][0], 66666, 0, 0, 1, 0, 0, 10000, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB);
key_(39, 1, 0, 200);
key_(40, 1, 0, 100);
m_KIB18: if (findimage_(#Image_7_KIB[0][0], 100, 0, 0, 0, 0, 0, 0, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB)>0) goto m_KIB21;
else goto m_KIB17;
m_KIB21: key_(113, 1, 0, 150);
key_(113, 1, 0, 150); goto m_KIB18;
m_KIB1: goto m_KIB2;
m_KIB19: if (findimage_(#Image_5_KIB[0][0], 80, 0, 0, 0, 0, 0, 0, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB)>0) goto m_KIB23;
else goto m_KIB18;
m_KIB23: key_(112, 1, 0, 100);
findimage_(#Image_8_KIB[0][0], 66666, 0, 0, 1, 0, 0, 1000, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB);
findimage_(#Image_9_KIB[0][0], 66666, 555, 0, 1, 0, -180, 0, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB);
findimage_(#Image_10_KIB[0][0], 2147483647, 0, 0, 1, 0, 0, 0, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB); goto m_KIB1;
m_KIB16: if (findimage_(#Image_5_KIB[0][0], 100, 0, 0, 0, 0, 0, 0, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB)>0) goto m_KIB23;
else goto m_KIB22;
m_KIB22: key_(39, 1, 0, 70); goto m_KIB19;
m_KIB17: if (findimage_(#Image_6_KIB[0][0], 100, 0, 0, 0, 0, 0, 0, -1, 0, 100, 1, 0, 0, ex_KIB, ey_KIB, #sum_KIB, #x_KIB, #y_KIB)>0) goto m_KIB21;
else goto m_KIB16;
function start_()
{
load_image_();
pause(1000);
int x, y;
getmouse(x, y);
w_KIB=getwindow(1, x, y);
ex_KIB=w_KIB.widthclient; ey_KIB=w_KIB.heightclient;
}
function key_(int k, int m, int p1, int p2)
{
pause(p1);
if (m==1) sendkey(k, w_KIB);
if (m==2) keydown(k);
if (m==3) keyup(k);
pause(p2);
}
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, 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); pause(p3);}
if (m==2){sendmouse(MIDDLE, xs+xKIB+xm, ys+yKIB+ym, w_KIB); pause(p3);}
if (m==3){sendmouse(RIGHT, xs+xKIB+xm, ys+yKIB+ym, w_KIB); pause(p3);}
if (m==4){sendmousedown(LEFT, xs+xKIB+xm, ys+yKIB+ym, w_KIB); pause(p3);}
if (m==5){sendmousedown(MIDDLE, xs+xKIB+xm, ys+yKIB+ym, w_KIB); pause(p3);}
if (m==6){sendmousedown(RIGHT, xs+xKIB+xm, ys+yKIB+ym, w_KIB); pause(p3);}
if (m==7){sendmouseup(LEFT, xs+xKIB+xm, ys+yKIB+ym, w_KIB); pause(p3);}
if (m==8){sendmouseup(MIDDLE, xs+xKIB+xm, ys+yKIB+ym, w_KIB); pause(p3);}
if (m==9){sendmouseup(RIGHT, xs+xKIB+xm, ys+yKIB+ym, w_KIB); pause(p3);}
if (m==10){sendmousemove(xs+xKIB+xm, ys+yKIB+ym, w_KIB); pause(p3);}
return sumKIB;
}
function load_image_()
{
loadimage (#Image_0_KIB[0][0], "D:\Kibor\farm\iia.bmp");
loadimage (#Image_1_KIB[0][0], "D:\Kibor\farm\?ai.bmp");
loadimage (#Image_2_KIB[0][0], "D:\Kibor\farm\noieaooe.bmp");
loadimage (#Image_3_KIB[0][0], "D:\Kibor\oa?i_iaiiu\auoia1.bmp");
loadimage (#Image_4_KIB[0][0], "D:\Kibor\oa?i_iaiiu\eoiao.bmp");
loadimage (#Image_5_KIB[0][0], "D:\Kibor\oa?i_iaiiu\eoo_eiiao.bmp");
loadimage (#Image_6_KIB[0][0], "D:\Kibor\oa?i_iaiiu\eoo2.bmp");
loadimage (#Image_7_KIB[0][0], "D:\Kibor\oa?i_iaiiu\eoo1.bmp");
loadimage (#Image_8_KIB[0][0], "D:\Kibor\oa?i_iaiiu\aoia1.bmp");
loadimage (#Image_9_KIB[0][0], "D:\Kibor\oa?i_iaiiu\aoia2.bmp");
loadimage (#Image_10_KIB[0][0], "D:\Kibor\oa?i_iaiiu\iia_ea?eo.bmp");
}
RESOURCE
{
"D:\Kibor\farm\iia.bmp";
"D:\Kibor\farm\?ai.bmp";
"D:\Kibor\farm\noieaooe.bmp";
"D:\Kibor\oa?i_iaiiu\auoia1.bmp";
"D:\Kibor\oa?i_iaiiu\eoiao.bmp";
"D:\Kibor\oa?i_iaiiu\eoo_eiiao.bmp";
"D:\Kibor\oa?i_iaiiu\eoo2.bmp";
"D:\Kibor\oa?i_iaiiu\eoo1.bmp";
"D:\Kibor\oa?i_iaiiu\aoia1.bmp";
"D:\Kibor\oa?i_iaiiu\aoia2.bmp";
"D:\Kibor\oa?i_iaiiu\iia_ea?eo.bmp";
}