Register for your free account! | Forgot your password?

Go Back   elitepvpers › Coders Den › AutoIt
You last visited: Today at 11:55

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



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

Discussion on I want the edit in my autoit scripts for Autoit Proxy Switcher within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Nov 2013
Posts: 3
Received Thanks: 0
I want the edit in my autoit scripts for Autoit Proxy Switcher

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


my autoit
PHP Code:
#include <GUIConstantsEx.au3>
#include <GUIListViewEx.au3>

HotKeySet("{ESC}", "_Terminate")

$GUI = GUICreate("[Proxy Switcher]", 235, 369, 493, 134)
$btnOk = GUICtrlCreateButton("&ON / OFF", 88, 336, 65, 25)
$lstServer = GUICtrlCreateList("", 8, 64, 217, 97)
$btnExit = GUICtrlCreateButton("&Exit", 160, 336, 65, 25, 0)
$Group = GUICtrlCreateGroup("Settings", 8, 280, 217, 49)
$optEnabled = GUICtrlCreateRadio("Enabled", 24, 304, 73, 17)
$optDisabled = GUICtrlCreateRadio("Disabled", 144, 304, 73, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$grpProxy = GUICtrlCreateGroup("Proxy Server", 8, 8, 217, 49)
$lblProxy = GUICtrlCreateLabel("lblProxy", 24, 32, 192, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$edtExceptions = GUICtrlCreateEdit("", 8, 200, 217, 73)
GUICtrlSetData(-1, "")
$Label = GUICtrlCreateLabel("Exceptions:", 8, 180, 59, 17)
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: ", $sProxy, 5, 1)
    
TraySetToolTip("Proxy Server: " & $sProxy)
    
GUICtrlSetData($lblProxy, $sProxy)
Else
    
GUICtrlSetState($optDisabled, $GUI_CHECKED)
    
TrayTip("Proxy Server: ", "Disabled(Direct Connection)", 5, 1)
    
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][1] Then
            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($sTmpKey, StringInStr($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: ", $sProxy, 5, 1)
                
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)", 5, 1)
        
TraySetToolTip("Proxy Server: Disabled(Direct Connection)")
        
GUICtrlSetData($lblProxy, "Disabled (Direct Connection)")
        
GUICtrlSetData($grpProxy, "Proxy")
    EndIf
 
EndFunc   
 
Func _Terminate
()
    Exit 
0
 EndFunc 
Martyart5936 is offline  
Old   #2
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
Create a button and trigger this if it is clicked
Code:
$sProxyPath = FileOpenDialog("Please select a file containing IP:PORT proxies", @ScriptDir, "All Data (*.*)")
alpines is offline  
Old   #3
 
elite*gold: 0
Join Date: Nov 2013
Posts: 3
Received Thanks: 0
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
Martyart5936 is offline  
Old   #4
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
I'm not going to do that, you have to do it by yourself so you won't ask easy questions like that anymore.
alpines is offline  
Old   #5
 
elite*gold: 0
Join Date: Nov 2013
Posts: 3
Received Thanks: 0
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
Martyart5936 is offline  
Reply




All times are GMT +2. The time now is 11:55.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.