darkmaster071 Posted April 16, 2009 Posted April 16, 2009 Ive made a script that automates IE and ive found out that it is randomly freezeing the ie instance. It pretty much makes my script useless now so i really really want a solution... So ive got _iecreate, navigate, propertyget, bodyreadhtml, loadwait... Is there anything that is known to cause problems? Or what can i try to fix the freezing. Any help greatly appreciated.
Developers Jos Posted April 16, 2009 Developers Posted April 16, 2009 Maybe start with determining which function makes it freeze by doing some debugging and then post some replication script for people to look at. 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.
Authenticity Posted April 16, 2009 Posted April 16, 2009 (edited) It may be that the page is not fully loaded and so the _IELoadWait() function, either called by you or internally, suspends your script for (default = 300000 ms aka 5 min), Windoze ;] Edited April 16, 2009 by Authenticity
darkmaster071 Posted April 16, 2009 Author Posted April 16, 2009 It may be that the page is not fully loaded and so the _IELoadWait() function, either called by you or internally, suspends your script for (default = 300000 ms aka 5 min), Windoze ;]You may be right because the last ie function called before freezing is _IELoadWait() and after that its some lines of resetting the connection. If it is loadwait what can i do about it?
Authenticity Posted April 16, 2009 Posted April 16, 2009 Reduce it's timeout value from 5 minutes to something more suiting your needs.
darkmaster071 Posted April 16, 2009 Author Posted April 16, 2009 Unfortunatly that didnt work as i dont think you got my explanation right Authenticity. Ive said it freezes the IE instance (picture stays still, i cant click nothing and then a Not responding msg appears) not that it pauses the script. Also i think ive cought the script freeze ie right when the connection connects again and the loop closes. Maybe that could cause something? I really need a solution...
darkmaster071 Posted April 16, 2009 Author Posted April 16, 2009 Ive tried some tips of Ie crashing like reseting and deleting addons and stuff. Nothing worked. Heres my code: CODE#include <IE.au3> Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("{F8}", "WriteUsername") $usernamecounter=IniRead("drek.ini", "usernames", "Counter", "0") $reza=0 While 1 $textcheck=0 While $textcheck = 0 If $omfg=0 Then $var= _IECreate("website", 0, 1, 1, 0) $hIE = _IEPropertyGet($var, "hwnd") WinSetState($hIE, "", @SW_MAXIMIZE) Else _IENavigate($var, "website", 1) EndIf $omfg=1 $source = _IEBodyReadHTML($var) $textcheck=StringInStr($source, "string") WEnd $iLen = 12 $sStr = "" Do $sHold = Chr(Random(48, 122, 1)) If StringRegExp($sHold, "(?i)[a-z0-9]") Then $sStr &= $sHold Until StringLen($sStr) = $iLen Sleep(1000) ControlClick("window - Windows Internet Explorer", "", "Internet Explorer_Server1", "left", 1, 328, 286) AutoItSetOption("SendKeyDelay", 70) ControlSend("window - Windows Internet Explorer", "", "Internet Explorer_Server1", $sStr) ControlClick("window - Windows Internet Explorer", "", "Internet Explorer_Server1", "left", 1, 328, 546) _IELoadWait($var) $usernamecounter = $usernamecounter + 1 IniWrite("drek.ini", "usernames", "Counter", $usernamecounter) IniWrite("drek.ini", "usernames", $usernamecounter, $sStr) Sleep(5000) $connect1 = _GetNetworkConnect() While $connect1 = "WAN connected" $disconnect=Run("siol_disconnect.bat", "", @SW_MINIMIZE) ProcessWaitClose("cmd.exe") Sleep(2000) $connect1 = _GetNetworkConnect() WEnd While $connect1 <> "WAN connected" $connect=Run("siol_connect.bat", "", @SW_MINIMIZE) ProcessWaitClose("cmd.exe") Sleep(2000) $connect1=_GetNetworkConnect() WEnd ;;somewhere here it hangs ie WEnd Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc Func WriteUsername() $fakcounter=IniRead("neki.ini", "usernames", "Counter", "0") $fakcounter=$fakcounter+1 IniWrite("neki.ini", "usernames", $fakcounter, $sStr) IniWrite("neki.ini", "usernames", "Counter", $fakcounter) EndFunc Func _GetNetworkConnect() Local Const $NETWORK_ALIVE_WAN = 0x2 ;RAS (internet) connection Local $aRet, $iResult $aRet = DllCall("sensapi.dll", "int", "IsNetworkAlive", "int*", 0) If BitAND($aRet[1], $NETWORK_ALIVE_WAN) Then $iResult &= "WAN connected" Return $iResult EndFunc
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