jacob_1998_1999 Posted April 22, 2006 Share Posted April 22, 2006 (edited) As stated in my previous post which has since died.. I am looking for ways to rid a process that stops responding. So.. In an effort to do this, I have thought up a simple plan. Simple to think, however, More than likely Vastly out of my coding abilities. Simply put.. my idea to check for a Frozen Screen consists of using a series of plotted boxes to compare against saved temp boxes of the previous plotted areas. lol.. Okay that makes no sense.. Let me try and rephrase. You have a full screen program/ game running. You choose 3 areas to place a 10x10 or higher pixel box. This program would run comparisons between the the boxes as follows given a timed interval: A, B, C. 00:00:00 -- A1, B1, C1. 00:00:20 -- A2, B2, C2. --------------------------- if all = = = Terminate program. Is this possible? or Can my previous and much simpler sounding method of Searching the TaskManager for a "Not Responding" program be simpler? Edit: Expanding on this Idea, All pixels would need to be stored in an array to correctly work right? That is alot of processing for this program to do in the background. Or.. perhaps I am underestimating my dual P4 3ghz processors. Edited April 22, 2006 by jacob_1998_1999 Link to comment Share on other sites More sharing options...
neogia Posted April 22, 2006 Share Posted April 22, 2006 Untested: AdlibEnable("_IsResponding", 20000) Func _IsResponding() If IsDeclared("prevSum") Then If PixelChecksum(0,0,10,10) == $prevSum Then ; Program is hung, handling code here EndIf Else $prevSum = PixelChecksum(0,0,10,10) EndIf EndFunc [u]My UDFs[/u]Coroutine Multithreading UDF LibraryStringRegExp GuideRandom EncryptorArrayToDisplayString"The Brain, expecting disaster, fails to find the obvious solution." -- neogia Link to comment Share on other sites More sharing options...
jacob_1998_1999 Posted April 22, 2006 Author Share Posted April 22, 2006 I deleted my previous post and am including a better excert.. expandcollapse popupWhile $Connected = 0 Connect() Wend CharSelect() StartBot() While 1 While $Disconnected = 0 Disconnect() AdlibEnable("_IsResponding", 20000) Wend While $Connected = 0 Connect() Wend CharSelect() StartBot() Wend ;=========================================================================== ; Funcs ;=========================================================================== Func Disconnect() If PixelGetColor(519, 458) = 1644825 AND PixelGetColor(755, 561) = 2169881 Then ControlSend($SROClient, "", "", "{ENTER}") EndIF Sleep (1000) If ProcessExists ($SROExe) Then $Disconnected = 0 Else $Disconnected = 1 EndIf EndFunc; => Disconnect() Func _IsResponding() If WinActive($SROClient) Then If IsDeclared("prevSum") Then If PixelChecksum(0,0,1279,1023,10) == $prevSum Then WinKill ($SROClient) ProcessClose($SROExe) ToolTip("This is so a test...") sleep(5000) $Disconnected = 1 EndIf Else $prevSum = PixelChecksum(0,0,1279,1023,10) EndIf EndIf EndFunc You know.. its hard to test something that only happens every few hours. 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