Jump to content

[UNSOLVED] Changing proxy in the middle of the script


Recommended Posts

I've got the following script:
 

#include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <Array.au3>
     
    $Site = "http://whatismyipaddress.com/"
     
    $a = FileRead(@ScriptDir & "\Proxies.txt")
    $b = StringSplit($a, @CR & @LF & @CRLF)
    $b = ClearArray($b)
     
    Global $oIE[UBound($b)]
    GUICreate("Test Browser", 1000, 500, 0, 0)
    GUISetState(@SW_SHOW)
     
    $Bound = UBound($b) - 1
    For $i = 0 To $Bound
            If $i > 0  Then GUICtrlDelete($oIE[$i - 1])
            HttpSetProxy(2, $b[$i])
            $oIE[$i] = ObjCreate("Shell.Explorer.2")
            GUICtrlCreateObj($oIE[$i], 0, 0, 1000, 500)
            $oIE[$i].navigate($Site)
            ToolTip($i & "/" & $Bound & @CRLF & $b[$i], 0, 0)
            Sleep(5000)
    Next
     
    Func ClearArray($arr)
            $i = 0
            While 1
                    If $i > UBound($arr) - 1 Then ExitLoop
     
                    Local $Delete = 0
                    If $arr[$i] = " " Then
                            $Delete = 1
                    EndIf
                    If $arr[$i] = "" Then
                            $Delete = 1
                    EndIf
                    If $arr[$i] = @CR Then
                            $Delete = 1
                    EndIf
                    If $arr[$i] = @LF Then
                            $Delete = 1
                    EndIf
                    If $arr[$i] = @CRLF Then
                            $Delete = 1
                    EndIf
                    If StringLen($arr[$i]) < 9 Then
                            $Delete = 1
                    EndIf
                    If Not StringInStr($arr[$i], ":") Then
                            $Delete = 1
                    EndIf
                    If $Delete = 0 Then
                            $arr[$i] = StringReplace($arr[$i], " ", "")
                            $arr[$i] = StringReplace($arr[$i], @TAB, "")
                    EndIf
                    If $Delete = 1 Then
                            _ArrayDelete($arr, $i)
                            $i -= 1
                    EndIf
                    $i += 1
                    If $i = UBound($arr) Then ExitLoop
            WEnd
            Return $arr
    EndFunc

The problem is that my IP isn't changing. It should be different every time, but it isn't different... Did I miss something?

Edited by Unc3nZureD
Link to comment
Share on other sites

  • Moderators

If your code panel is not working (does not work for me in 8.1), just do it manually. See below

post-54985-0-05425900-1391549751_thumb.p

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Tried to simplify everything, but the following one isn't working too:

$Site = "http://whatismyipaddress.com/"

GUICreate("Test Browser", 1000, 500, 0, 0)
GUISetState(@SW_SHOW)

HttpSetProxy(2, "109.123.115.157:3128")
$a = ObjCreate("Shell.Explorer.2")
$b = GUICtrlCreateObj($a, 0, 0, 1000, 500)
$a.navigate($Site)
Sleep(8000)

Link to comment
Share on other sites

  • 1 month later...

Referring to my topic: >How can I use a different IP proxy before manipulating a web application

Will the HttpSetProxy() function sets the internet proxy to use for http access of my Internet Explorer only?

Or it will sets also the internet proxy of my other browser?

I can test it but I'm afraid if it also sets the other internet proxies..

Edited by Servant
Link to comment
Share on other sites

Can you answer >my topic?    :think:

Please don't do this, it's impolite.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

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