two simple questions

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
pantik
Junior Coder
Posts: 45
Joined: Sun Dec 13, 2009 5:52 pm

two simple questions

Post by pantik » Wed Jan 06, 2010 9:07 am

Hello again:

I need create a script that executes a lot of subroutines simultaneosly. Is there a different method than to compile and call the executable from a script? I would not like to have a lof of .exe files running simultaneosly in the computer.

And if you alow me... i have another question:
If i use "WaitScreenImage" with WSI_TIMEOUT=0.01 and with SCREEN parameter, will i get a complete screen search?

In others words: If the "WaitSreenImage" command does not find the image for 0.01 seconds, will it stop of search?

Thank you very much and excuse me because of my grammar.

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

multi-tasking

Post by gdyvig » Wed Jan 06, 2010 3:36 pm

If you don't want to take advantage of Windows multi-tasking you would need to set up Macro Scheduler to multi-task. Strictly speaking the 2 or more subroutines cannot run simultaneously, but one after another as needed.

Your second question about WSI_TIMEOUT sounds related to your first question. I'm guessing that you have a situation where you are expecting possibly several images to display, but you don't know how many, which ones, or in which order. You don't want to wait 10 seconds for image A if image B is displayed.

My experience indicates the entire screen will be scanned for the expected image at least once regardless of how small WSI-TIMEOUT is. So you can set up a Repeat loop to test for several alternative images with a very short timeout until you find one or more images or some maximum number of iterations has been processed.

You may also want to check whether OnEvent will work for you based on a window title changing.


Gale

pantik
Junior Coder
Posts: 45
Joined: Sun Dec 13, 2009 5:52 pm

Post by pantik » Wed Jan 06, 2010 8:01 pm

Ok, thanks. I will use something similar to this:

Code: Select all

WSI_TIMEOUT=0.01
repeat>k

WaitScreenImage>%SCRIPT_DIR%\image1.bmp,0
if>WSI_TIMEDOUT=FALSE
gosub>sub1
endif

WaitScreenImage>%SCRIPT_DIR%\image2.bmp,0
if>WSI_TIMEDOUT=FALSE
gosub>sub2
endif

...
...

until>k,100

is this a good code ? I'm guessinog there is not another method than a sequential search.

The question is that i need execute subroutines while this loop continues searching, then i think that i need compile sub1, sub2, ... , right?
could i use "flag variables" and access to these since another script ?
What I really need is that a script is running while the image is displayed and stop when it is not displayed.

Only i 'd like a little help to begin :roll:

The last question :oops: :
Could i compile or encrypt image files and .wav files ? In others words, have i to include necessarily these files along with my compiled .exe. ?

Thanks again.

pantik
Junior Coder
Posts: 45
Joined: Sun Dec 13, 2009 5:52 pm

Post by pantik » Fri Jan 08, 2010 11:14 pm

Up

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Sat Jan 09, 2010 4:16 am

The last question
Could i compile or encrypt image files and .wav files ? In others words, have i to include necessarily these files along with my compiled .exe. ?
http://www.mjtnet.com/blog/2008/10/06/p ... your-exes/

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