Спойлер (Отобразить)
CODE:
win w=window ("Warspear Online", "Warspear", -1);
win w_KIB;
int ex_KIB, ey_KIB, sum_KIB, x_KIB, y_KIB, tim_KIB;
int Image_0_KIB[10][2];
start_();
m_KIB3: key("продам знаки 13к много.........");
key_(13, 1, 0, 200);
key_(113, 1, 0, 200);
key_(49, 1, 0, 200);
key("продам знаки 13к много.........");
key_(13, 1, 0, 200);
key_(113, 1, 0, 200);
key_(56, 1, 0, 200);
key_(112, 1, 0, 0);
if (findimage_(#Image_0_KIB[0][0], 20000, 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_KIB5;
else goto m_KIB2;
m_KIB1: key_(52, 1, 0, 200); goto m_KIB3;
m_KIB2: key_(113, 1, 0, 200); goto m_KIB1;
m_KIB5: textout(0, 100, 50, "СООБЩЕНИЕ", 0);
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 load_image_()
{
loadimage (#Image_0_KIB[0][0], "C:\Program Files (x86)\Kibor\bot\лс.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, int xs, int ys, int xf, int yf, int#sum, int#x, int#y)
{
pause(p1);
sum_KIB=0;
if (t!=1) tim_KIB=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()-tim_KIB<t){sleep(20); goto a;}
return 0;
e: sum_KIB=sum; x_KIB=x[0]; y_KIB=y[0];
pause(p2);
if (m==1){sendmouse(LEFT, xs+x_KIB+xm, ys+y_KIB+ym, w_KIB); pause(p3);}
if (m==2){sendmouse(MIDDLE, xs+x_KIB+xm, ys+y_KIB+ym, w_KIB); pause(p3);}
if (m==3){sendmouse(RIGHT, xs+x_KIB+xm, ys+y_KIB+ym, w_KIB); pause(p3);}
if (m==4){sendmousedown(LEFT, xs+x_KIB+xm, ys+y_KIB+ym, w_KIB); pause(p3);}
if (m==5){sendmousedown(MIDDLE, xs+x_KIB+xm, ys+y_KIB+ym, w_KIB); pause(p3);}
if (m==6){sendmousedown(RIGHT, xs+x_KIB+xm, ys+y_KIB+ym, w_KIB); pause(p3);}
if (m==7){sendmouseup(LEFT, xs+x_KIB+xm, ys+y_KIB+ym, w_KIB); pause(p3);}
if (m==8){sendmouseup(MIDDLE, xs+x_KIB+xm, ys+y_KIB+ym, w_KIB); pause(p3);}
if (m==9){sendmouseup(RIGHT, xs+x_KIB+xm, ys+y_KIB+ym, w_KIB); pause(p3);}
if (m==10){sendmousemove(xs+x_KIB+xm, ys+y_KIB+ym, w_KIB); pause(p3);}
return sum_KIB;
}
win w_KIB;
int ex_KIB, ey_KIB, sum_KIB, x_KIB, y_KIB, tim_KIB;
int Image_0_KIB[10][2];
start_();
m_KIB3: key("продам знаки 13к много.........");
key_(13, 1, 0, 200);
key_(113, 1, 0, 200);
key_(49, 1, 0, 200);
key("продам знаки 13к много.........");
key_(13, 1, 0, 200);
key_(113, 1, 0, 200);
key_(56, 1, 0, 200);
key_(112, 1, 0, 0);
if (findimage_(#Image_0_KIB[0][0], 20000, 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_KIB5;
else goto m_KIB2;
m_KIB1: key_(52, 1, 0, 200); goto m_KIB3;
m_KIB2: key_(113, 1, 0, 200); goto m_KIB1;
m_KIB5: textout(0, 100, 50, "СООБЩЕНИЕ", 0);
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 load_image_()
{
loadimage (#Image_0_KIB[0][0], "C:\Program Files (x86)\Kibor\bot\лс.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, int xs, int ys, int xf, int yf, int#sum, int#x, int#y)
{
pause(p1);
sum_KIB=0;
if (t!=1) tim_KIB=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()-tim_KIB<t){sleep(20); goto a;}
return 0;
e: sum_KIB=sum; x_KIB=x[0]; y_KIB=y[0];
pause(p2);
if (m==1){sendmouse(LEFT, xs+x_KIB+xm, ys+y_KIB+ym, w_KIB); pause(p3);}
if (m==2){sendmouse(MIDDLE, xs+x_KIB+xm, ys+y_KIB+ym, w_KIB); pause(p3);}
if (m==3){sendmouse(RIGHT, xs+x_KIB+xm, ys+y_KIB+ym, w_KIB); pause(p3);}
if (m==4){sendmousedown(LEFT, xs+x_KIB+xm, ys+y_KIB+ym, w_KIB); pause(p3);}
if (m==5){sendmousedown(MIDDLE, xs+x_KIB+xm, ys+y_KIB+ym, w_KIB); pause(p3);}
if (m==6){sendmousedown(RIGHT, xs+x_KIB+xm, ys+y_KIB+ym, w_KIB); pause(p3);}
if (m==7){sendmouseup(LEFT, xs+x_KIB+xm, ys+y_KIB+ym, w_KIB); pause(p3);}
if (m==8){sendmouseup(MIDDLE, xs+x_KIB+xm, ys+y_KIB+ym, w_KIB); pause(p3);}
if (m==9){sendmouseup(RIGHT, xs+x_KIB+xm, ys+y_KIB+ym, w_KIB); pause(p3);}
if (m==10){sendmousemove(xs+x_KIB+xm, ys+y_KIB+ym, w_KIB); pause(p3);}
return sum_KIB;
}
Работает в фоне и в окне на переднем плане одновременно . Т.е печатается текст, нажимаются кнопки.(для просмотра ссылки Вам необходимо авторизоваться) з.ы Вывод сообщения на экран не работает, но скрипт останавливается, что меня устраивает. Но хотелось бы узнать как правильно делать это в визуальном редакторе