mortexu Posted May 10, 2009 Share Posted May 10, 2009 Dear Comunity,I am having a problem. I would like to disable or stop AutoIt from displaying msgBox with error when the script crashes.I am talking about RunTime errors or any kind of error notification I get when a script crashes.I am expecting you all gonna want to talk me about the fact that I should debug/improve my code and resolve the errors, but to get ahead of you, I just want to say that this is not my interest whatsoever. I just want to suppress this msgBox which always appears in the top of all other windows.The script I am making is regularily running and is being restarted like every 5-10 minutes and it actually needs not to be perfect, cause its basically a game boot and if would be perfect I risk to be discovered. The errors are not comming always and are mostly dependant on the config made outside the script and on the response I get from the browser. Its very hard to control the config and I don't wanna do this as I intend to build an Artificial Inteligence ( kind of) who will auto config the system by its own decisions.I also expect it to be very "dumb" at first and all I wanna do its to let it run, not debug it by any means.I am running this script when whatching a movie , doing my job etc... and I want not to be disturbed each time an error causes a crash.( It randomly happens about 1 time / 20 minutes (avg time) and it has became disturbing).I just want it quiet.So please post only if you can help me with an instruction , function , flag , compiling option that SUPRESSES all kind of error msgs and crash notifications.I know someone posted a topic like this -"Hide all output (including errors) from user" - and everybody gathered to criticise the man's way of work , but no one proposed a speciffic solution. The topic is now locked. Also If someone knows for sure that this is not possible by any chance , just let me know , and I'll migrate my code from AutoIt to another platform that supports this.I would like however to see it done on this platform as I worked like2-3 months to get an ideea about Autoit and I am developing the project since 1 year by now.Thank you ,Catalin I Link to comment Share on other sites More sharing options...
Developers Jos Posted May 10, 2009 Developers Share Posted May 10, 2009 (edited) Not sure what it helps not getting an msgbox telling you that there was an error, but this would dump the error to stdout in stead of a msgbox when compiled. if @Compiled then if $cmdline[0] = 0 then Run(@ScriptFullPath & " /ErrorStdOut /restarted") Exit EndIf EndIf $test = $doesnotexist Edited May 10, 2009 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Valuater Posted May 10, 2009 Share Posted May 10, 2009 $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ; Initialize a COM error handler Func MyErrFunc() ; Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ ; "err.description is: " & @TAB & $oMyError.description & @CRLF & _ ; "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ ; "err.number is: " & @TAB & hex($oMyError.number,8) & @CRLF & _ ; "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ ; "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ ; "err.source is: " & @TAB & $oMyError.source & @CRLF & _ ; "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ ; "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ; ) ; Local $err = $oMyError.number ; If $err = 0 Then $err = -1 ; $g_eventerror = $err ; to check for after this function returns Endfunc Either way, use the info or return nothing for an object error 8) Link to comment Share on other sites More sharing options...
mortexu Posted May 10, 2009 Author Share Posted May 10, 2009 Not sure what it helps not getting an msgbox telling you that there was an error, but this would dump the error to stdout in stead of a msgbox when compiled. if @Compiled then if $cmdline[0] = 0 then Run(@ScriptFullPath & " /ErrorStdOut /restarted") Exit EndIf EndIf $test = $doesnotexist Thank you very much , but I don't have errors/warnings in the compiling stage. Those I handle with care I will however try to fit the code to see the naswer Link to comment Share on other sites More sharing options...
Developers Jos Posted May 10, 2009 Developers Share Posted May 10, 2009 Also look at what Val posted in case you work with Com objects. Those really always should have a ComErrorHandler function used to catch errors and act on it. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
avery Posted May 10, 2009 Share Posted May 10, 2009 I get -1 error messages or something (I forget all what it says). Since it offers no detail or help about the real error, can it be removed from au3 please? www.abox.orgAvery HowellVisit My AutoIt Websitehttp://www.abox.org Link to comment Share on other sites More sharing options...
Developers Jos Posted May 10, 2009 Developers Share Posted May 10, 2009 I get -1 error messages or something (I forget all what it says).Since it offers no detail or help about the real error, can it be removed from au3 please?It tells you the error that occurs. Only the linenumber isn't supllied when its compiled. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
mortexu Posted November 6, 2009 Author Share Posted November 6, 2009 (edited) I tested all scripts above. None worked the way I expected. Still gt error msgs. I had to debug the script of the errors that were possible to be debugged and for the others, I just learn what they are and acknowledged them all in the script, as if they happen to ignore them or if the case , to restart script. However , for the purpose of knowing , I am still looking for a way to disable all error notifications and let the script crash quietly , as if I need to run a script where most important property is not to run flawless , but to be able to die or restart quietly , I wanna know how to do it and not invest time in searching all possible causes that could bring an error and resolve them . In practice , you never get to treat all the bugs...and that's a known fact Edited November 6, 2009 by mortexu Link to comment Share on other sites More sharing options...
Bert Posted November 6, 2009 Share Posted November 6, 2009 (edited) Dear Comunity,I am having a problem. I would like to disable or stop AutoIt from displaying msgBox with error when the script crashes.I am talking about RunTime errors or any kind of error notification I get when a script crashes.........The script I am making is regularily running and is being restarted like every 5-10 minutes and it actually needs not to be perfect, cause its basically a game boot and if would be perfect I risk to be discovered. This thing is for a bot for Heroes III. Am I correct on this? Edited November 6, 2009 by Volly The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
memoryoverflow Posted November 6, 2009 Share Posted November 6, 2009 (edited) ... its basically a game boot and if would be perfect I risk to be discovered...Whatever game that is wouldn't matter, since he explicitely states to cheat and discovery would have consequences. Edited November 6, 2009 by memoryoverflow (The signature is placed on the back of this page to not disturb the flow of the thread.) Link to comment Share on other sites More sharing options...
Bert Posted November 6, 2009 Share Posted November 6, 2009 That is my take on it. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Zedna Posted November 6, 2009 Share Posted November 6, 2009 Also If someone knows for sure that this is not possible by any chance , just let me know , and I'll migrate my code from AutoIt to another platform that supports this.I would like however to see it done on this platform as I worked like2-3 months to get an ideea about Autoit and I am developing the project since 1 year by now.Thank you ,Catalin IThere is no such "Option" in Autoit.But I saw here in the forum some attempts for autocliks on popup messageboxes.It was probably with some helper (second) process which did ControlClick if neccessary - from AdlibEnable()But I can't remember it exactly.Also consider if porting your whole project to another language will not be much more work thanadding some tests into existing code avoiding such crashes Resources UDF ResourcesEx UDF AutoIt Forum Search 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