How to make the image wait? As in a visual editor?
I do so. Tell me how to make the program wait for the image mi.
int Image_0[46][52];
int PosX_0[512];int PosY_0[512];
loadimage (#Image_0[0][0], "C:\scr\mi.bmp");
if (findimage(1, #Image_0[0][0], 0, #PosX_0[0], #PosY_0[0], 200, 355, 300, 450, -1)==1)
{
messagebox ("mi");
}
1. Sticls - 03 Декабря, 2017 - 15:41:45 - перейти к сообщению
2. Kibor - 04 Декабря, 2017 - 05:45:58 - перейти к сообщению
Waits for 60,000 msec (1 second)
CODE:
int Image_0[46][52];
int PosX_0[512];int PosY_0[512];
loadimage (#Image_0[0][0], "C:\scr\mi.bmp");
for (int t=gettime(); gettime()-t<60000; sleep(100))
{
if (findimage(1, #Image_0[0][0], 0, #PosX_0[0], #PosY_0[0], 200, 355, 300, 450, -1)==1)
{
messagebox ("mi");
}
}
int PosX_0[512];int PosY_0[512];
loadimage (#Image_0[0][0], "C:\scr\mi.bmp");
for (int t=gettime(); gettime()-t<60000; sleep(100))
{
if (findimage(1, #Image_0[0][0], 0, #PosX_0[0], #PosY_0[0], 200, 355, 300, 450, -1)==1)
{
messagebox ("mi");
}
}
3. Sticls - 05 Декабря, 2017 - 00:33:12 - перейти к сообщению
Tell me, how do I enter text in the field after pressing Ctrl A?
Draw blocks of the keyboard for a long time.
Draw blocks of the keyboard for a long time.
4. Kibor - 05 Декабря, 2017 - 05:21:08 - перейти к сообщению
After the block
keyup 17
you need to insert a block of code:
This code works like this:
Copies the text to the clipboard and inserts it from the clipboard using Ctrl V
keyup 17
you need to insert a block of code:
CODE:
sleep (500);
writeclipboard ("Text to be written");
sleep (200);
keydown (17); key (86); keyup (17);
writeclipboard ("Text to be written");
sleep (200);
keydown (17); key (86); keyup (17);
This code works like this:
Copies the text to the clipboard and inserts it from the clipboard using Ctrl V
5. Sticls - 05 Декабря, 2017 - 09:28:22 - перейти к сообщению
Can I make it so that the text can be changed when the program is compiled into exe?
I need to fill out the form. What would be possible to enter different data.
I need to fill out the form. What would be possible to enter different data.
6. Kibor - 05 Декабря, 2017 - 11:26:44 - перейти к сообщению
In this case, you can read from a file..
CODE:
string t[100];
int k=0;
int X[100], Y[100];//Here the coordinates of the fields for text input
if (fopen ("c:\file.txt", "r")!=0)//open the file for reading "r"
{
while (freadline(t[k])!=0)//We read on the whole line until the end of the file
{
k++;
}
fclose();//close the file
}
for (int n=0; n<k; n++)
{
mouse(LEFT, X[n], Y[n]);//Click on the field to enter text
sleep (200);
keydown (17); key (65); keyup (17);//Ctrl A (select the text that was)
sleep (500);
writeclipboard (t[n]);//we put into the clipboard the text to be entered
sleep (200);
keydown (17); key (86); keyup (17);//Ctrl V we (paste the text)
}
int k=0;
int X[100], Y[100];//Here the coordinates of the fields for text input
if (fopen ("c:\file.txt", "r")!=0)//open the file for reading "r"
{
while (freadline(t[k])!=0)//We read on the whole line until the end of the file
{
k++;
}
fclose();//close the file
}
for (int n=0; n<k; n++)
{
mouse(LEFT, X[n], Y[n]);//Click on the field to enter text
sleep (200);
keydown (17); key (65); keyup (17);//Ctrl A (select the text that was)
sleep (500);
writeclipboard (t[n]);//we put into the clipboard the text to be entered
sleep (200);
keydown (17); key (86); keyup (17);//Ctrl V we (paste the text)
}