I want the edit in my autoit scripts for Autoit Proxy Switcher

11/11/2013 20:00 Martyart5936#1
I want the edit in my autoit scripts I want the edit in my autoit scripts for Autoit Proxy Switcher

1) I want to add the button for load proxy list
2) I want to add the button for changer ip address

[Only registered and activated users can see links. Click Here To Register...]
my autoit
PHP Code:
#include <GUIConstantsEx.au3>
#include <GUIListViewEx.au3>

HotKeySet("{ESC}""_Terminate")

$GUI GUICreate("[Proxy Switcher]"235369493134)
$btnOk GUICtrlCreateButton("&ON / OFF"883366525)
$lstServer GUICtrlCreateList(""86421797)
$btnExit GUICtrlCreateButton("&Exit"16033665250)
$Group GUICtrlCreateGroup("Settings"828021749)
$optEnabled GUICtrlCreateRadio("Enabled"243047317)
$optDisabled GUICtrlCreateRadio("Disabled"1443047317)
GUICtrlCreateGroup("", -99, -9911)
$grpProxy GUICtrlCreateGroup("Proxy Server"8821749)
$lblProxy GUICtrlCreateLabel("lblProxy"243219217)
GUICtrlSetFont(-188000"MS Sans Serif")
GUICtrlCreateGroup("", -99, -9911)
$edtExceptions GUICtrlCreateEdit(""820021773)
GUICtrlSetData(-1"")
$Label GUICtrlCreateLabel("Exceptions:"81805917)
GUISetBkColor(0x808080)
GUISetState(@SW_SHOW)

If 
Not FileExists(@ScriptDir "\Proxy.ini"Then
    MsgBox
(48"File Not Found""Required file not found (" & @ScriptDir "\Proxy.ini" ")" & @CRLF "" & @CRLF "Proxy Switcher Will Exit!!!")
    Exit
EndIf

Get IE Proxy server Registry values
$sProxy 
RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings""ProxyServer")
$iEnabled RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings""ProxyEnable")
$sExceptions RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings""ProxyOverride")

If 
$iEnabled Then
    GUICtrlSetState
($optEnabled$GUI_CHECKED)
    
TrayTip("Proxy Server: "$sProxy51)
    
TraySetToolTip("Proxy Server: " $sProxy)
    
GUICtrlSetData($lblProxy$sProxy)
Else
    
GUICtrlSetState($optDisabled$GUI_CHECKED)
    
TrayTip("Proxy Server: ""Disabled(Direct Connection)"51)
    
TraySetToolTip("Proxy Server: Disabled(Direct Connection)")
    
GUICtrlSetData($lblProxy$sExceptions)
EndIf

GUICtrlSetData($edtExceptions$sExceptions)

;
Proxy servers configuration
$sSection 
IniReadSection(@ScriptDir "\Proxy.ini""config")
If @
error Then
    MsgBox
(16"Proxy Switcher""Unable to read the section Server")
    Exit
Else
    ;
Load ListBox
    Local $iLstIndex 
0
    
For $iSection 1 To $sSection[0][0]
        
GUICtrlSetData($lstServer$sSection[$iSection][0] & " ===> " $sSection[$iSection][1])
        If 
$sProxy $sSection[$iSection][1Then
            GUICtrlSetData
($grpProxy"Proxy: " $sSection[$iSection][0])
            
$iLstIndex $iSection 1
        
EndIf
    
Next
    
    
If $iLstIndex 0 Then
        $ret 
GUICtrlSetData($lstServer$iLstIndex)
    EndIf
 EndIf
 
GUISetState()

While 
1
    $msg 
GUIGetMsg()
    
Select
        
Case $msg $GUI_EVENT_CLOSE Or $msg $btnExit
            _Terminate
()

        Case 
$msg $btnOk
            _Start
()
    
EndSelect
WEnd

Func _Start
()
    ;
Proxy enabled
    
If GUICtrlRead($optEnabled) = $GUI_CHECKED Then
        $sTmpKey 
GUICtrlRead($lstServer)
        
$sKey StringLeft($sTmpKeyStringInStr($sTmpKey" ===> "))

        If 
$sKey "" Then
            MsgBox
(48"Error Message""No proxy selected")
        Else
            
$sProxy IniRead(@ScriptDir "\Proxy.ini""config"$sKey"NotFound")
            If @
error Or $sProxy "NotFound" Then
                MsgBox
(16"Proxy Switcher""Unable to read the Key " $sKey)
                Exit
             Else
                
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings""ProxyServer""REG_SZ"$sProxy)
                
TrayTip("Proxy Server: "$sProxy51)
                
TraySetToolTip("Proxy Server: " $sProxy)
                
GUICtrlSetData($lblProxy$sProxy)
                
GUICtrlSetData($grpProxy"Proxy: " $sKey)
            EndIf
        EndIf
        
        
$sExceptions GUICtrlRead($edtExceptions)
        
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings""ProxyEnable""REG_DWORD"1)
        
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings""ProxyOverride""REG_SZ"$sExceptions)
    Else
        ;
Proxy Disabled
        RegWrite
("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings""ProxyEnable""REG_DWORD"0)
        
TrayTip("Proxy Server: ""Disabled (Direct Connection)"51)
        
TraySetToolTip("Proxy Server: Disabled(Direct Connection)")
        
GUICtrlSetData($lblProxy"Disabled (Direct Connection)")
        
GUICtrlSetData($grpProxy"Proxy")
    EndIf
 
EndFunc   
 
Func _Terminate
()
    Exit 
0
 EndFunc 
11/11/2013 20:23 alpines#2
Create a button and trigger this if it is clicked
Code:
$sProxyPath = FileOpenDialog("Please select a file containing IP:PORT proxies", @ScriptDir, "All Data (*.*)")
11/11/2013 22:02 Martyart5936#3
Quote:
Originally Posted by alpines View Post
Create a button and trigger this if it is clicked
Code:
$sProxyPath = FileOpenDialog("Please select a file containing IP:PORT proxies", @ScriptDir, "All Data (*.*)")
You can add it in the script
11/11/2013 23:09 alpines#4
I'm not going to do that, you have to do it by yourself so you won't ask easy questions like that anymore.
11/11/2013 23:40 Martyart5936#5
Quote:
Originally Posted by alpines View Post
I'm not going to do that, you have to do it by yourself so you won't ask easy questions like that anymore.
I do not know how