Jump to content
Sign in to follow this  
Nbanonimous

problem with code, noobie!

Recommended Posts

Nbanonimous

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
NELyon

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
sambalec

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
timsky

Bug with 'If not ProcessExists'

What bug?

Share this post


Link to post
Share on other sites
sambalec

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
Cynagen

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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.