Thanks, enaiman.
I tried adding that line to my code but it doesn't seem to be making a difference - the script will apply a random proxy the first time it's run but not during the loop. Can you take a look at the snippet below and let me know if I'm missing something silly?
Dim $aRecords
FileOpen("D:\sites.log")
If Not _FileReadToArray("d:\sites.log",$aRecords) Then
MsgBox(4096,"Error", " Error reading log to Array error:" & @error)
Exit
EndIf
FileClose("D:\sites.log")
FileOpen("D:\proxies.txt")
Dim $aProxy
If Not _FileReadToArray("d:\proxies.txt",$aProxy) Then
MsgBox(4096,"Error", " Error reading log to Array error:" & @error)
EndIf
FileClose("D:\proxies.txt")
for $x = 1 to $aRecords[0]
$rnd=random(1,$aProxy[0],1)
$key = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
$reg = RegWrite($key, "ProxyEnable", "REG_DWORD", "1")
$reg1 = RegWrite($key, "ProxyServer", "REG_SZ", $aProxy[$rnd])
;HttpSetProxy(2, $aProxy[$rnd])
DllCall('WININET.DLL', 'long', 'InternetSetOption', 'int', 0, 'long', 39, 'str', 0, 'long', 0)
MsgBox(0,"",$aProxy[$rnd])
$oIE=_IECreate("http://www.whatismyip.com")
sleep(1000)
_IEQuit($oIE)
Next