Sign in to follow this  
Followers 0
standsolid

Threading Using AbLib

3 posts in this topic

I was searching through the forums for multi-threaded scripts. For the life of me I can't figure out a way to use adlibenable to do multiple functions. for example:

I was to start the following functions a the same time

Install_VNC()

Remove_InternetExplorer()

Install_FireFox()

and they would each update their progress to a nice auto-it GUI as they are going simultaneously.

The only thing I can think of doing would be to make separate compiled scripts for those functions, and have them write to a temporary file their progress. then the main launcher app will use adlibenable to check the temp file to get the progress and then update it's GUI.

Any other suggestions? Or is my multiple-script hack the only way?

Share this post


Link to post
Share on other sites



I could be wrong, but I don't believe that AutoIt supports multi-threaded processes. ...At least not the current stable release.

Share this post


Link to post
Share on other sites

Basically AutoIt does one thing at a time, but you can have it start up all 3 proccesses, and monitor all 3 and update progressbars.

1) Install_VNC()

2) Remove_InternetExplorer()

3) Install_FireFox()

I would start each of these tasks. use run and not runwait.

This is just an example, it will not work as is because I have no idea on the steps or versions of the programs you will be using.

; setup some kind of progress bar or GUI.

Run("supervnc.exe")
Run("firefox_8.exe")
run("IEremoval.exe"); not sure exactly how you plan on this actually due to various OS and protections with this program.

while 1
if winexists("superVNC setup","install directory") then
controlsend("superVNC setup","install directory","","c:\program files\SVNC{tab 2}{enter}")
$progress=$progress+10
endif
if winexists("superVNC setup","install complete") then
controlsend("superVNC setup","install complete","","{enter}")
$progress=$progress+20
endif
if winexists("firefox setup","install directory") then
controlsend("firefox setup","install directory","","c:\program files\SVNC{tab 2}{enter}")
$progress=$progress+10
endif
if winexists("firefox setup","install complete") then
controlsend("firefox setup","install complete","","{enter}")
$progress=$progress+20
endif
if winexists("Remove Internet Explorer?","&Yes") then
controlsend("Remove Internet Explorer?","&Yes","","{y}")
$progress=$progress+30
endif

wend

AutoIt3, the MACGYVER Pocket Knife for computers.

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
Sign in to follow this  
Followers 0