im having a hard time trying to get this to work inside a loop. i can get it to work fine all by itself but then it seems to stop working inside the loop ![:(]()
![:(](http://aut1.autoit-cdn.com/forum/public/style_emoticons/autoit/sad.gif)
#cs ---------------------------------------------------------------------------- The point of this is to stop the Agent.exe process from running when d3 is started then idle untill it is detected again #ce ---------------------------------------------------------------------------- Global $process = "Agent.exe", $PID=0, $delay = 5000, $x=0 _check() Func setloop() While $x <> 1 Sleep($delay) _check() WEnd EndFunc Func _check() If ProcessExists($process) = 0 Then setloop() ElseIf ProcessExists($process) = 1 Then ProcessWaitClose($process) EndIf EndFunc