Add Proxy Adress in IE

Get help with using AutoHotkey and its commands and hotkeys
Posts: 1
Joined: 19 Oct 2015, 00:58

Add Proxy Adress in IE

19 Oct 2015, 01:05


so I got a script written in python collecting HQ Proxies and saving them into a .txt file.

What I now want to do is.

AHK should visit a certain website. After it visited the website and purchased something it should change my proxy which I provide from the .txt file.
(I need to purchase alot of products from this website but it blocks my IP after 2 purchases)

I found out how to put in 1 proxy but it should randomly choose from the .txt file or is it possible to implent alot of proxies in the ahk script and it choose a proxy random and bans the already used one?

This is the proxy part.

Code: Select all

;Set proxy via Registry
;Set Home Page, Change to whatever you want
RegWrite,REG_SZ,HKCU,Software\microsoft\Internet Explorer\Main,Start Page,
;Set ProxyOverride to your exception list separated by ';'
regwrite,REG_SZ,HKCU,Software\Microsoft\Windows\CurrentVersion\Internet Settings,ProxyOverride,exception1;exception2;exception3 

;Function to SetProxy
setproxy(address = "",state = ""){ 
if (address = "") and (state = "") 
    state = TOGGLE 

if address
    regwrite,REG_SZ,HKCU,Software\Microsoft\Windows\CurrentVersion\Internet Settings,ProxyServer,%address%
  if (state ="ON")
    regwrite,REG_DWORD,HKCU,Software\Microsoft\Windows\CurrentVersion\Internet Settings,Proxyenable,1
  else if (state="OFF")
    regwrite,REG_DWORD,HKCU,Software\Microsoft\Windows\CurrentVersion\Internet Settings,Proxyenable,0
  else if (state = "TOGGLE")
      if regread("HKCU","Software\Microsoft\Windows\CurrentVersion\Internet Settings","Proxyenable") = 1
        regwrite,REG_DWORD,HKCU,Software\Microsoft\Windows\CurrentVersion\Internet Settings,Proxyenable,0
      else if regread("HKCU","Software\Microsoft\Windows\CurrentVersion\Internet Settings","Proxyenable") = 0
        regwrite,REG_DWORD,HKCU,Software\Microsoft\Windows\CurrentVersion\Internet Settings,Proxyenable,1 

RegRead(RootKey, SubKey, ValueName = "") {
	RegRead, v, %RootKey%, %SubKey%, %ValueName%
	Return, v
Posts: 53
Joined: 30 Sep 2013, 21:33

Re: Add Proxy Adress in IE

19 Oct 2015, 09:01

The following code will read the proxy text file into an array. A random number is generated to get a value from the array. That value is then deleted from the array. The remaining array is then read back to the proxy text file, overwriting the original values, so you end up with one less proxy value.

The proxy text file should be in the same directory as the AHK file, which it sounds like you are doing.

Code: Select all

aProxies := ""
aProxies := {}


;~ aProxies[1] := "Testing"
;~ aProxies[2] := "Testing2"
;~ aProxies[3] := "Testing3"

Random, rand, 1, aProxies.MaxIndex()
Proxy := aProxies[rand]
MsgBox, % Proxy


Load(ByRef aProxies)
	FileLoadName := "Proxies.txt"
	Loop, Read, %FileLoadName%
		aProxies[A_Index] := A_LoopReadLine

Save(ByRef aProxies)
	FileSaveName := "Proxies.txt"
	File := FileOpen(FileSaveName, "w")
	Loop, % aProxies.MaxIndex()
		File.Write(aProxies[A_Index] "`r`n")
	Sleep 100

Return to “Ask For Help”

Who is online

Users browsing this forum: boiler, duncan21, Google [Bot], thephoenix and 234 guests