Sign in to follow this  
Followers 0
Smurfin

how to create two or more loops and executed at the same time ?

5 posts in this topic

hi, can anyone give a hint how to create two loops but executed at the same time, like running 2 compiled exe.

for example i want to freeze a value in memory using nomadmemory's _memorypointerwrite udf and loop it using while, and i want to put some other things in the loop but they have some delay in it using sleep(), if I put together in one loop, the _memorypointerwrite will be affected by the delay, but if i use two 'while' , it'll be nested in one of the 'while' until it terminates, so how do i make them running at the same time ?

Share this post


Link to post
Share on other sites



Autoit is not a multithreaded application, so you can not do that directly. However there may be other ways of doing what you want by approaching things in a different manner.


[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Share this post


Link to post
Share on other sites

@Smurfin

This has been asked manytimes on forum (by me too) so please make search !

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

oh alright, thanks, i'll search for it, but meanwhile if anyone visiting this thread know where to look for it or know of any way to do that, please post it here.

Share this post


Link to post
Share on other sites

Hi Lo Smurfin........

Thats intresting......

Just a idea about this......not a programer but having a loop inside another loop is kinda bad.....

Now this might not help but here is a way to get around the problem.....and of coarse you will have to taylor it to your needs.

Most Loops will start with something to keep them running and when this value or page or whatever is no longer .........well the rollercoaster stops.

You did say you were wanting to use the While type of loop so lets do that one.

Global $nl

$nl = 0; this value will change

$x = 1

;-------------------------------------------------------------------

While $x = 1;rem this would be main loop

;The thing about call up a loop from a loop it just keeps banning away.......so you want to have some control over it......

If $x = 1 and $nl = 0 then; this should send it to your loop........but we do not want it coming back......

NextLoop()

Endif

Wend; End of main loop

;---------------------------------------------------------------------

Func NextLoop();Your next loop

$nl = 1; Setting another value to $nl so it will not come back from main loop

While $nl = 1

;your script

Wend

EndFunc

;---------------------------------------------------------------------

I am pretty sure this will be shot down by some else that actually knows something but it seems to work....if you want to have a few loops running at the same time......

Oh yes and think about a reset point where you reset you $nl back to zero

hope it helps

zz

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