sandman Posted February 28, 2007 Share Posted February 28, 2007 Example: I want to have two functions running at the same time, and at first put Sleep() into each of them. But, if one is sleeping, then it makes the other one sleep too, right? How can I have some kind of timer initiate and count time while the other one might still be doing something? [center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center] Link to comment Share on other sites More sharing options...
FreeFry Posted February 28, 2007 Share Posted February 28, 2007 (edited) Well, first of all - There's no such thing as doing two things at the same time in autoit(this is because your code is being run in one thread only(unless you use Adlib, as /dev/null advised below me, and still (if my memory doesn't fail me) autoit pauses it's current operation(ie. your code) to do the one specified in the adlib function..)))So, running two functions at the same time is (quite)impossible.Though if you want to run two functions (and do an delay/wait in one of them), you could use TimerInit() and TimerDiff() to do "manual" sleeps - sort of speak.Edit:Clarified, and corrected. Edited February 28, 2007 by FreeFry Link to comment Share on other sites More sharing options...
/dev/null Posted February 28, 2007 Share Posted February 28, 2007 Example: I want to have two functions running at the same time, and at first put Sleep() into each of them. But, if one is sleeping, then it makes the other one sleep too, right? How can I have some kind of timer initiate and count time while the other one might still be doing something?see AdlibEnable() in the help file. __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
Traddles Posted February 28, 2007 Share Posted February 28, 2007 (edited) I just wrote this post giving an example of how you CAN do multi-threading in autoIt, but then I actually tried it out for myself and it didn't actually work.... so next time I'll experiment BEFORE opening my mouth :"> Edited February 28, 2007 by Traddles Link to comment Share on other sites More sharing options...
sandman Posted February 28, 2007 Author Share Posted February 28, 2007 Okay.. thanks both of you.. I'll experiment with both things you mentioned. [center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now