Ricky1986 Posted February 12, 2017 Author Share Posted February 12, 2017 Thanks @RichardHawkesford would rather the the most automated approach when clearing the cookies so what would you say is the best way? Was going to use HMA for VPN. Currently stuck with the random url. #include <Array.au3> #include <File.au3> #include <MsgBoxConstants.au3> #include <IE.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> Global $aUserAgent, $aReferrer, $aURLList Local $sUserAgentFile = "UserAgent.txt" Local $sReferrerFile = "referrer.txt" Local $sURLListFile = "URLList.txt" _FileListArray('UserAgent', $sUserAgentFile, $aUserAgent) _FileListArray('Referrer', $sReferrerFile, $aReferrer) _FileListArray('URLList', $sURLListFile, $aURLList) Global $oIE = _IECreate() $oIE.Navigate2($aURLList[Random(0, UBound($aURLList) -1, 1)] Default, Default, Default, 'User-Agent: ' & $aUserAgent[Random(0, UBound($aUserAgent) - 1, 1)] & @CRLF & 'Referer: ' & $aReferrer[Random(0, UBound($aReferrer) - 1, 1)]) Func _FileListArray($sTitle, $sFileName, ByRef $aArray) If FileExists($sFileName) Then _FileReadToArray($sFileName, $aArray, 0, "") If @error Then MsgBox(0, $sTitle & " - Setup Error", "The file " & $sFileName & " is empty.") Exit EndIf Else MsgBox(0, $sTitle & " - Setup Error", "The File " & $sFileName & " doesn't exist.") Exit EndIf EndFunc Link to comment Share on other sites More sharing options...
Ricky1986 Posted February 15, 2017 Author Share Posted February 15, 2017 Kinda go it working basically it open the first URL but when I open it again it tells me the URL is invalid. #include <Array.au3> #include <File.au3> #include <MsgBoxConstants.au3> #include <IE.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> Global $aUserAgent, $aReferrer, $aURL Local $sUserAgentFile = "UserAgent.txt" Local $sReferrerFile = "referrer.txt" Local $sURLFile = "URL.txt" _FileListArray('UserAgent', $sUserAgentFile, $aUserAgent) _FileListArray('Referrer', $sReferrerFile, $aReferrer) _FileListArray('URL', $sURLFile, $aURL) Global $oIE = _IECreate() $oIE.Navigate2($aURL[Random(0, UBound($aURL) -1, 1)], Default, Default, Default, 'User-Agent: ' & $aUserAgent[Random(0, UBound($aUserAgent) - 1, 1)] & @CRLF & 'Referer: ' & $aReferrer[Random(0, UBound($aReferrer) - 1, 1)]) Func _FileListArray($sTitle, $sFileName, ByRef $aArray) If FileExists($sFileName) Then _FileReadToArray($sFileName, $aArray, 0, "") If @error Then MsgBox(0, $sTitle & " - Setup Error", "The file " & $sFileName & " is empty.") Exit EndIf Else MsgBox(0, $sTitle & " - Setup Error", "The File " & $sFileName & " doesn't exist.") Exit EndIf EndFunc Link to comment Share on other sites More sharing options...
Subz Posted February 15, 2017 Share Posted February 15, 2017 Can you post your URL.txt Link to comment Share on other sites More sharing options...
Ricky1986 Posted February 15, 2017 Author Share Posted February 15, 2017 just basic URLs for testing. URL.txt Link to comment Share on other sites More sharing options...
Subz Posted February 15, 2017 Share Posted February 15, 2017 It works fine for me, haven't been able to get it to error once, so puzzled. 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