Sign in to follow this  
Followers 0
Nbanonimous

problem with code, noobie!

10 posts in this topic

hey guys

this is wut i have so far

i want it to wait in the background to always check if the process, "server.exe" is running

and if it ISNT running, I want it to Run server.exe!

sounds simple, but I'm new with AutoIT

Sleep(1)

Local $var = 1 ; $var is a string


while ($var = 1)
    
    if (ProcessExists ("server.exe")
        then $var = 1
    Else 
        $var = 2
    
WEnd
    
sleep (1)

Run ("server.exe")

Share this post


Link to post
Share on other sites



While 1
        If Not ProcessExists("server.exe") Then
                Run("server.exe")
        EndIf
        Sleep(200)
WEnd

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

while 1 = infinite loop ^_^

Launch the script and try to kill server.exe process ;)

Edited by sambalec

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Bug with 'If not ProcessExists'

Try this :

While 1
    If ProcessExists("server.exe") Then
        ;;
    Else
        Run("server.exe")
        Sleep(500)
    Endif
Wend
Edited by sambalec

Share this post


Link to post
Share on other sites

Bug with 'If not ProcessExists'

What bug?

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

My brain's buggin... sorry just tired when i tried it. KentonBomb's code is the best

Edited by sambalec

Share this post


Link to post
Share on other sites

Bug with 'If not ProcessExists'

Try this :

While 1
    If ProcessExists("server.exe") Then
        ;;
    Else
        Run("server.exe")
        Sleep(500)
    Endif
WendoÝ÷ Ûú®¢×½éìjez¶®¶­sevÆR¢b&ö6W74W7G2gV÷C·6W'fW"æWRgV÷C²ÒFVâ'VâgV÷C·6W'fW"æWRgV÷C²¢6ÆVWS¥vVæ@

ProcessExists returns 0 if the process does not exist since there is no PID. ^_^


Blah, blah, blah... lip service... lip service.Working on a number of projects right now, just waiting for my time to post them here on AutoIt forums.

Share this post


Link to post
Share on other sites

Yes simple ^_^

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