The program I’m automating sends data over the internet and waits for a return,
but the screen doesn’t auto refresh , so I don’t know when to continue the script.
I’m using “WaitScreenImageâ€
Help with Repeat/Until
Moderators: JRL, Dorian (MJT support)
-
- Pro Scripter
- Posts: 132
- Joined: Mon Dec 22, 2008 4:56 pm
- Location: St Augustine FL
Refresh Screen
If I read this correctly you could just send F5 and then check the screen as F5 would refresh it and then you could compare it.
-
- Pro Scripter
- Posts: 132
- Joined: Mon Dec 22, 2008 4:56 pm
- Location: St Augustine FL
Help with Repeat/Until
I'm doing a screen refresh in the program with the Alt R and the Press Enter(see script)
The issue is not knowing how long it will take to get the data back.
The issue is not knowing how long it will take to get the data back.
Wait Screen image
Use WSI_TIMEOUT so it checks if it is not found it goes into a loop where you refresh the screen and try again.
So you have something like (untested)
Let>z=1
label>updateloop
Let>WSI_TIMEOUT=5
WaitScreenImage=C:\CP_Macros\JohnW\AES_ShipmentAdded.bmp,10
If>WSI_RESULT=0
If>z=10,tenattemps
Send>F5
Let>z=z+1
Goto>updateloop
Endif
Goto>matched
//ten attemps were made to read the screen with each attempt checking for 5 seconds
Label>tenattemps
MDL>no match
Label>matched
After 10 attemps or whatever it assumes that it is never going to be returned.
So you have something like (untested)
Let>z=1
label>updateloop
Let>WSI_TIMEOUT=5
WaitScreenImage=C:\CP_Macros\JohnW\AES_ShipmentAdded.bmp,10
If>WSI_RESULT=0
If>z=10,tenattemps
Send>F5
Let>z=z+1
Goto>updateloop
Endif
Goto>matched
//ten attemps were made to read the screen with each attempt checking for 5 seconds
Label>tenattemps
MDL>no match
Label>matched
After 10 attemps or whatever it assumes that it is never going to be returned.