Jump to content

au3 programs make me reboot.


Recommended Posts

Has anybody encountered this problem? My program (very simple) sometimes just doesn't load. It doesn't output any errors or anything, it just doesn't launch (until I reboot). Anyone else have this problem? Here's the source (if neccesary).

#include <IE.au3>
$oIE =_IECreate("http://infiniteadds.com",0,1,1)
$o_fid = _IEGetObjByName($oIE,"friendid")
$o_submit=_IEGetObjByName($oIE,"action")
$oIE = _IEFormElementSetValue ($o_fid, "21802680")
$oIE = _IEAction($o_submit,"click")
$oIE = _IELoadWait ($oIE)

$oIE = _IENavigate($oIE, "http://infiniteadds.org")
$o_fid = _IEGetObjByName($oIE,"friendid")
$o_submit=_IEGetObjByName($oIE,"action")
$oIE = _IEFormElementSetValue ($o_fid, "442500255")
$oIE = _IEAction($o_submit,"click")
$oIE = _IELoadWait ($oIE)

$oIE = _IENavigate($oIE, "http://maxadds.com")
$o_fid = _IEGetObjByName($oIE,"friendid")
$o_submit=_IEGetObjByName($oIE,"action")
$oIE = _IEFormElementSetValue ($o_fid, "21802680")
$oIE = _IEAction($o_submit,"click")
$oIE = _IELoadWait ($oIE)

$oIE = _IENavigate($oIE, "maxadds.com")
$o_fid = _IEGetObjByName($oIE,"friendid")
$o_submit=_IEGetObjByName($oIE,"action")
$oIE = _IEFormElementSetValue ($o_fid, "442500255")
$oIE = _IEAction($o_submit,"click")
$oIE = _IELoadWait ($oIE)

_IEQuit($oIE)
Global $arr[2]

$arr[0]="hip"
$arr[1]="hip"
;^^ hip hip array. ^^
Link to comment
Share on other sites

You should a an error handler.

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")

...your code here....

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
    
    SetError($err) ; to check for after this function returns
Endfunc
Link to comment
Share on other sites

Try this, if you want to include the "MyErrFunc" make sure to define $oMyError as global (as seen in my example)

#include <IE.au3>
Global $oMyError = ObjEvent("AutoIt.Error","MyErrFunc")

$oIE =_IECreate("http://infiniteadds.com",0,1,1)
$o_fid = _IEGetObjByName($oIE,"friendid")
$o_submit =_IEGetObjByName($oIE,"action")
_IEFormElementSetValue ($o_fid, "21802680")
_IEAction($o_submit,"click")
_IELoadWait($oIE)

_IENavigate($oIE, "http://infiniteadds.org")
$o_fid = _IEGetObjByName($oIE,"friendid")
$o_submit=_IEGetObjByName($oIE,"action")
_IEFormElementSetValue ($o_fid, "442500255")
_IEAction($o_submit,"click")
_IELoadWait($oIE)

_IENavigate($oIE, "http://maxadds.com")
$o_fid = _IEGetObjByName($oIE,"friendid")
$o_submit=_IEGetObjByName($oIE,"action")
_IEFormElementSetValue ($o_fid, "21802680")
_IEAction($o_submit,"click")
_IELoadWait($oIE)

_IENavigate($oIE, "maxadds.com")
$o_fid = _IEGetObjByName($oIE,"friendid")
$o_submit=_IEGetObjByName($oIE,"action")
_IEFormElementSetValue ($o_fid, "442500255")
_IEAction($o_submit,"click")
_IELoadWait($oIE)

_IEQuit($oIE)


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
    
    SetError($err); to check for after this function returns
Endfunc
Edited by Pain
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...