На писал бота для СОЛО, на две клавиши (а и пробел). Суть проста с помощью поиска изображения каждой клавише присваивается буква, если находит зелёный цвет, то срабатывает клавиша привязанная к этим координатам.
[code][/int size_key_char_KIB=-1;
int color_KIB_6[1], sum_color_KIB_6[1];
color_KIB_6[0]=4240197;
sum_color_KIB_6[0]=10;
int color_KIB_5[1], sum_color_KIB_5[1];
color_KIB_5[0]=4240197;
sum_color_KIB_5[0]=10;
int col_KIB, ex_KIB, ey_KIB, sum_KIB, x_KIB, y_KIB;
start_();
m_KIB1: if (findheapcolor_(20, 20, 50, 50, 3000, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, -1, 0, 1, 671, 897, 694, 910, 1, 2, #sum_KIB, #x_KIB, #y_KIB, #color_KIB_5[0], #sum_color_KIB_5[0])>0) goto m_KIB4;
else goto m_KIB2;
m_KIB4: key_(70, 1, "", 0, 500, 0); goto m_KIB1;
m_KIB3:
goto m_KIB1;
m_KIB2: if (findheapcolor_(20, 20, 50, 50, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, -1, 0, 1, 776, 955, 870, 966, 1, 2, #sum_KIB, #x_KIB, #y_KIB, #color_KIB_6[0], #sum_color_KIB_6[0])>0) goto m_KIB5;
else goto m_KIB3;
m_KIB5: key_(32, 1, "", 0, 0, 0); goto m_KIB2;
function key_(int k, int m, string text, int pc, int p1, int p2)
{
pause(p1);
if (m==-1)
{
if (size_key_char_KIB==-1)
{
size_key_char_KIB=100;
new char key_char_KIB[size_key_char_KIB+1];
}
int size_key=size(text);
if (size_key_char_KIB<size_key)
{
delete key_char_KIB;
size_key_char_KIB=size_key;
new char key_char_KIB[size_key_char_KIB+1];
}
strcpy(#key_char_KIB[0], text);
for (int n=0; n<size_key; n++){key(key_char_KIB[n]); sleep(pc);}
}
else
{
if (m==1) key(k);
if (m==2) keydown(k);
if (m==3) keyup(k);
}
pause(p2);
}
function start_()
{
getdisplay(col_KIB, ex_KIB, ey_KIB);
pause(1000);
}
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;
}
]
1. DreadBot8546 - 31 Мая, 2020 - 06:30:45 - перейти к сообщению