Sign in to follow this  
Followers 0
Krikov

More then one while

5 posts in this topic

Hi is it posible to write code with more then one while

or make that script working

<code>

While 1

if ProcessExists("Notepad.exe") Then

ConsoleWrite("notepad" & @CRLF)

Sleep(2000)

EndIf

WEnd

While 1

if ProcessExists("Winword.exe") Then

ConsoleWrite("BBB" & @CRLF)

Sleep(2000)

EndIf

WEnd

</code>

Krikov


[topic="63488"][font="Arial"]Krikov Tray Quick Menu[/font][/topic]

Share this post


Link to post
Share on other sites



That involves multithreading which AutoIt doesnt fully support =( Do a search for "Multi Threading" though and you will find some helpful stuff.


Click here for the best AutoIt help possible.Currently Working on: Autoit RAT

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

While 1
    if ProcessExists("Notepad.exe") Then ConsoleWrite("notepad" & @CRLF)
    if ProcessExists("Winword.exe") Then ConsoleWrite("BBB" & @CRLF)
    Sleep(2000)
WEnd

Why not combine the two? They'll run sequentially but does that matter?

Edited by spudw2k

Share this post


Link to post
Share on other sites

That involves multithreading which AutoIt doesnt fully support =( Do a search for "Multi Threading" though and you will find some helpful stuff.

Thanks i will look for it


[topic="63488"][font="Arial"]Krikov Tray Quick Menu[/font][/topic]

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

While  ProcessExists("Notepad.exe") 
        ConsoleWrite("notepad" & @CRLF)
        Sleep(2000)
WEnd

While ProcessExists("Winword.exe")
        ConsoleWrite("BBB" & @CRLF)
        Sleep(2000)
WEnd

While 1
sleep(20)
wend

Unfortunately it wouldn't go to the second while unless the first weren't true

Edited by youknowwho4eva

Giggity

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