newuser1234

Running AutoIt Scripts Sequentially

4 posts in this topic

Hello,

I currently have 4 scripts that I am using to pull data from a website, each pulling the same data but over a different period of time. I would like to be able to run each of these scripts via "one click", but I would need to spread them out so that the run sequentially in that no two of them are downloading data simultaneously. I know that I could do this manually by staggering each script by pausing it, but I was wondering if there was a more elegant solution but I find myself unable to find any information. 

Thanks in advance! 

Share this post


Link to post
Share on other sites



If you had a 5th script that just ran the 4 current scripts using RunWait, would that serve your purpose?

RunWait("script1.exe")
RunWait("script2.exe")
RunWait("script3.exe")
RunWait("script4.exe")

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

You could just combine them to one script and have each script contents in a function and just call functions sequentially.

Script1()
Script2()
Script3()

Func Script1()
;script contents
Endfunc

Func Script2()
; Script2 contents
EndFunc

;ect

Edit: on second thought that probably won't work if you have custom functions declared in the scripts..... thinking 

O you could #include  the scripts in like the master script.  Put the body of the secondary scripts in functions and then call the functions as I described above.  

Edited by markyrocks

Share this post


Link to post
Share on other sites
22 hours ago, MuffinMan said:

If you had a 5th script that just ran the 4 current scripts using RunWait, would that serve your purpose?

RunWait("script1.exe")
RunWait("script2.exe")
RunWait("script3.exe")
RunWait("script4.exe")

 

This actually worked great! Didn't realize that it'd be that simple. Thank you both for the help!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now