[AutoIt]Code for Restarter
#1

I have atm this code, that Start lcsm if this not exist in taskmngr.

 

While 1
While ProcessExists("lcsm.exe") ----> Here can be Connector.exe too.
Sleep(100)
WEnd
Sleep(30)
Run( "lcsm")
Do
Sleep(100)
Until ProcessExists("lcsm.exe")
WEnd

 

But, i wanna to write a Programm, who restart the Server then the Connector or/and Gameserver Crashs.

 

A Friend send me something like this :

f _NotResponding("C:\Users\Desktop\LCSM\Connector\Connector.exe", 1) Then; The last parameter indicates whether you want to close the hung app or not.
MsgBox(0,"Restart Server", "Restart Biw")
Else
MsgBox(0,"", "Application running as intended.")
EndIf

Func _NotResponding($title, $text, $closeIfHung = 0)
$hWnd = WinGetHandle($title, $text)
If $hWnd == "C:\Users\Desktop\LCSM\Connector\Connector.exe" Then
MsgBox(0,"Error","Could not find window")
Exit
EndIf
$retArr = DllCall("user32.dll", "int", "IsHungAppWindow", "hwnd", $hWnd)
If @error == 0 Then
If $retArr[0] == 1 Then
If $closeIfHung Then
ProcessClose(WinGetProcess($title, $text))
EndIf
Return 1
EndIf
Else
Return 0
EndIf
EndFunc

 

But i cant handle with it i wanna a simple script^^



Messages In This Thread
[No subject] - by Nikolee - 02-21-2012, 04:08 PM
[No subject] - by someone - 02-21-2012, 07:30 PM
[No subject] - by Nikolee - 02-22-2012, 02:23 PM
[No subject] - by someone - 02-22-2012, 02:57 PM
[No subject] - by Nikolee - 02-22-2012, 03:03 PM
[No subject] - by kimmer01 - 03-18-2012, 06:05 PM
[No subject] - by Nikolee - 03-20-2012, 12:26 PM
[No subject] - by Wizatek - 03-20-2012, 05:14 PM
[No subject] - by Nikolee - 03-20-2012, 08:24 PM
[No subject] - by Koko - 03-20-2012, 09:42 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)