Вот пример:
CODE:
int size_key_char_KIB=-1;
win w_KIB;
int ex_KIB, ey_KIB, sum_KIB, x_KIB, y_KIB;
start_();
key_(73, 1, "", 0, 0, 0);
function start_()
{
pause(1000);
int x, y;
getmouse(x, y);
w_KIB=getwindow(0, x, y);
ex_KIB=w_KIB.widthclient; ey_KIB=w_KIB.heightclient;
}
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++){sendkey(key_char_KIB[n], w_KIB); sleep(pc);}
}
else
{
if (m==1) sendkey(k, w_KIB);
if (m==2) sendkeydown(k, w_KIB);
if (m==3) sendkeyup(k, w_KIB);
}
pause(p2);
}
win w_KIB;
int ex_KIB, ey_KIB, sum_KIB, x_KIB, y_KIB;
start_();
key_(73, 1, "", 0, 0, 0);
function start_()
{
pause(1000);
int x, y;
getmouse(x, y);
w_KIB=getwindow(0, x, y);
ex_KIB=w_KIB.widthclient; ey_KIB=w_KIB.heightclient;
}
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++){sendkey(key_char_KIB[n], w_KIB); sleep(pc);}
}
else
{
if (m==1) sendkey(k, w_KIB);
if (m==2) sendkeydown(k, w_KIB);
if (m==3) sendkeyup(k, w_KIB);
}
pause(p2);
}