death pax Posted September 27, 2005 Share Posted September 27, 2005 I run a game server on my computer, and i use an autoit program to restart it if it crashes, using processexists(), however I dont know how to restart it if the server freezes(and becomes unresponsive). Any suggestions? Link to comment Share on other sites More sharing options...
Confuzzled Posted September 27, 2005 Share Posted September 27, 2005 If its frozen, then no amount of software will resurrect it. There are plugin cards available that have a 'watchdog timer' that will reboot the system unless a regular prompt is received from a program. If your system locks up, the prompt doesn't come, the timer runs out, and boom - reboot! From recollection, these cards are only a few dollars - you don't need the very fancy ones. Link to comment Share on other sites More sharing options...
death pax Posted September 27, 2005 Author Share Posted September 27, 2005 no, what i mean is the program freezes, not the system Link to comment Share on other sites More sharing options...
CyberSlug Posted September 27, 2005 Share Posted September 27, 2005 NOT A WORKING SOLUTION (but some ideas)based on http://www.thescarms.com/VBasic/AppResponse.aspConst $SMTO_BLOCK = 0x1, $SMTO_ABORTIFHUNG = 0x2 $PID = ProcessExists("notepad.exe") $HWND = WinGetHandle(_ProcessGetFirstWinTitle($PID)) $lReturn = DllCall("user32.dll","long","SendMessageTimeoutA", "long",$HWND, "long",0, "long",0, "long",0, _ "long", BitAnd($SMTO_BLOCK,$SMTO_ABORTIFHUNG), "long",1000, "long",0) MsgBox(4096,"Status...", $lReturn[0])If you have the task manager running, you could read the value of the Status column with some of the user defined functions for reading SysListView's Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
death pax Posted September 27, 2005 Author Share Posted September 27, 2005 (edited) yes, but i was hoping to do it with out taskman.... any idea one what dll calls taskman uses? or if its all self contained?also, where did you get the function _ProcessGetFirstWinTitle? nevermind, found it Edited September 27, 2005 by death pax Link to comment Share on other sites More sharing options...
death pax Posted September 27, 2005 Author Share Posted September 27, 2005 (edited) This actually goes hand in hand with my PID to Hwnd question i did edit the _processgetfirstwintitle a bit, because i already had the proper pid from when i started server with Run() Func _ProcessGetFirstWinTitle($pid) local $testpid local $winlist ; Get window list $winList = WinList() ; Find which windows go with this process For $i = 0 To $winList[0][0] - 1 $testPid = WinGetProcess($winList[$i][1]) If $testPid = $pid Then Return $winList[$i][0] EndIf Next Return 0 EndFunc $uHwnd=WinGetHandle(_ProcessGetFirstWinTitle($UnrealId)) then i checked a few things, and noticed that when the server is frozen, wingetclasslist and wingettext return empty strings, so i will check hangs that way ^.^ thanks for the help cyber Edited September 27, 2005 by death pax Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now