Jump to content
Sign in to follow this  
Guest larkstern

Threading...

Recommended Posts

Guest larkstern

I was wondering if autoit in any way supports multi threading.

Task: I want to parse a message log file.

I need to make a script that will continuely parse a file, that is constantly changing, and report things to another script.. for instance every time it sees a certain string $magicword.

this needs to go on behind the scenes while other scripts are running.

Is this possible with autoit?

thanks much.

+larks

Share this post


Link to post
Share on other sites
Valik

I don't see why multi-threading would be necessary for that task, however, to answer your question, no, multi-threading isn't available in AutoIt.

There are multiple ways to communicate to another script, such as writing to a file, changing a window title (Using a handle to the window you want to change the title of would be useful...), writing to the registry, et cetera.

Share this post


Link to post
Share on other sites
Jon

I was wondering if autoit in any way supports multi threading.

Task:  I want to parse a message log file.

I need to make a script that will continuely parse a file, that is constantly changing, and report things to another script.. for instance every time it sees a certain string $magicword.

this needs to go on behind the scenes while other scripts are running.

Is this possible with autoit?

thanks much.

+larks

You can always use an ADLIB function. You just tell it to execute every couple of milliseconds to do an operation on your file and then it can set a global variable to something if required.

In v2 ADLIB used to be purely for waiting for a rogue window to appear, but in v3 the adlib function can do anything you want - it just acts as another function that is run on a timer. However, while the adlib function is executing your main script is paused until the adlib finishes.

Share this post


Link to post
Share on other sites
Jon

Heh, I saw

on the main page and thought, "Is Valik going to add multi-threaded support to AutoIt?!?"

I was slightly disappointed B)

The MsgBox function has always been multithreaded (to support the timeout feature).

There, happy? :whistle:

Share this post


Link to post
Share on other sites
Valik

Heh, I saw

on the main page and thought, "Is Valik going to add multi-threaded support to AutoIt?!?"

I was slightly disappointed :whistle:

No way in hell I'm trying to add that. That would be less fun than shooting myself in the crotch with a nail gun.

Share this post


Link to post
Share on other sites
trids

.. and aren't we already multi-threading when we say Run a.o.t. RunWait ? :whistle:

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  

×