Sign in to follow this  
Followers 0
mortexu

Disable showing error msgBox when script crashes?

12 posts in this topic

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.Posted Image

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

$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)


NEWHeader1.png

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#8 ·  Posted (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 by mortexu

Share this post


Link to post
Share on other sites

#9 ·  Posted (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.Posted Image

........

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 by Volly

Share this post


Link to post
Share on other sites

#10 ·  Posted (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 by memoryoverflow

(The signature is placed on the back of this page to not disturb the flow of the thread.)

Share this post


Link to post
Share on other sites

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

There 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 than

adding some tests into existing code avoiding such crashes :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0