WSI_TIMEOUT PROBLEM

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
tpreston
Newbie
Posts: 4
Joined: Fri Mar 06, 2009 10:31 pm

WSI_TIMEOUT PROBLEM

Post by tpreston » Fri Mar 06, 2009 10:45 pm

Hi,

I installed the trial version last week and I'm having a problem with WSI_TIMEOUT. No matter what I set it to the timeout always lasts about ten seconds. I'll copy a sample below...

Label>SCAN
LET WSI_TIMEOUT=1/32
WaitScreenImage>C:\Documents and Settings\Daddy\My Documents\Macro Scheduler 11\Red.bmp,0
If>WSI_TIMEDOUT=FALSE
MouseMove>1418,577
LClick
Endif
LET WSI_TIMEOUT=1/32
WaitScreenImage>C:\Documents and Settings\Daddy\My Documents\Macro Scheduler 11\Blue.bmp,0
If>WSI_TIMEDOUT=FALSE
MouseMove>1418,577
LClick
Endif
LET WSI_TIMEOUT=1/32
WaitScreenImage>C:\Documents and Settings\Daddy\My Documents\Macro Scheduler 11\Green.bmp,0
If>WSI_TIMEDOUT=FALSE
MouseMove>1618,570
LClick
Endif
LET WSI_TIMEOUT=1/32
WaitScreenImage>C:\Documents and Settings\Daddy\My Documents\Macro Scheduler 11\Yellow.bmp,0
If>WSI_TIMEDOUT=FALSE
MouseMove>1618,570
LClick
wait 1
MouseMove>1522,571
LET WSI_TIMEOUT=1/32
WaitScreenImage>C:\Documents and Settings\Daddy\My Documents\Macro Scheduler 11\Orange.bmp,0
ENDIF
If>WSI_TIMEDOUT=FALSE
MouseMove>1522,571
LClick
Endif
Goto>SCAN

I tried setting WSI_TIMEOUT to 1 second, but it takes 10. Now I set it to 1/32 of a second, but it still takes 10. When I use the Step command (F8), each WaitScreenImage command lasts 10 seconds...but the variable value for WSI_TIMEOUT in the debugger shows the correct value (0.03125). I love the product and intend to purchase if I can get past this problem. Please help.

Thanks,
Tom Preston

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Fri Mar 06, 2009 11:01 pm

Hi tpreston,

I am not sure if 1/32 will work there however 0.031 would probably work and its about as long.

Also, why are you are leaving out the > after the Let? The command is Let> not Let.

Try this...

LET>WSI_TIMEOUT=1.5

Does that work any better?
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

tpreston
Newbie
Posts: 4
Joined: Fri Mar 06, 2009 10:31 pm

Post by tpreston » Fri Mar 06, 2009 11:10 pm

Hi jpuziano,

Thanks for the quick reply. I changed it as you suggested but still the same result (and I added the missing ">" also). Still the delay is 10 seconds. Any more ideas? I'm an old database programmer from way back and this is driving me batty!

Thanks,
Tom

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Sat Mar 07, 2009 4:43 am

Hi tpreston,

I ran your script as you posted it in the debugger and see that 1/32 works fine... sets it to 0.03125 and Let without the > seems to be understood as well (though I still would include it).
Help File Out-Take for WaitScreenImage> wrote:If WSI_TIMEOUT is used, WSI_TIMEDOUT will indicate whether or not the command ended successfully. If it timed out WSI_TIMEDOUT will be set to TRUE otherwise, if the image was found within the time out period it will be set to FALSE.
When I ran your code... WSI_TIMEDOUT was being set to false every time. Look at the line above in red. That's telling me it didn't time out... which is the same as saying... it found a match.

But how could it have found a match? The BitmapFile that the WaitScreenImage> command in your code points to... does not exist on my machine... and the directory doesn't exist either. :?

Marcus - In the case where WSI_TIMEOUT is being used (we've set it to some value) and the BitmapFile does not exist on the machine... what should this command be setting the WSI_TIMEDOUT system variable to?

At present, it seems to be setting it to FALSE... but that doesn't seem right because that indicates a successful find... which is not possible it it can't even locate the BitmapFile.
  • Question for Marcus: Could this command be modified so that if it can't locate the BitMapfile specified... it simply errors out, perhaps with an error message informing the user what the problem is?

    Marcus is this a known issue or am I missing something? If so please set me straight.
Anyway, tpreston, when the BitMapfile you point it to does exist, this command does seem to work fine.

If you're running XP, try the following code and post back to let us know how it works for you:

Code: Select all

Label>SCAN
LET>WSI_TIMEOUT=2
WaitScreenImage>c:\needle.bmp,0
If>WSI_TIMEDOUT=FALSE
PlayWav>c:\windows\media\chimes.wav
Else
PlayWav>c:\windows\media\Windows XP Critical Stop.wav
Endif
Goto>SCAN
Before you run that, use Macro Scheduler's built-in Image Capture Tool to capture a small image sample of one of your open windows... and save that as c:\needle.bmp

When you run the macro... if the image captured in needle.bmp is visible on the screen, it will continually chime away. The 2 second timeout value is not coming into play here as it is continually finding a match. It will continue to do so as fast as it can - on a fast machine the chiming may be almost continuous.

Now while the macro is still running, make it so the the image captured in needle.bmp is no longer visible on the screen; minimize that window or move another window over the image to cover it. Now the timeout value comes into play and you will be getting the other sound... about every 2 seconds as that's what the timeout value is set to.

This confirms for me that when WaitScreenImage> command can find the BitMapfile as specified, it works perfectly.

But if it can't find it, that's another story. Perhaps your problem lies in that direction.

- make sure you use the "Image Capture Tool" built into Macro Scheduler to capture your .bmp image files to avoid problems
- make sure your BitMapfiles are where you have specified them to be in the WaitScreenImage> command parameter

Let us know what you find... and take care.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts