Proxy ändern in Firefox// Problem mit Port ändern

07/19/2013 19:19 evoh12#1
Hey... ich hab schon wieder ein Problem:
Ich will den Port in Firefox ändern nur über eine Variable läuft es irgendwie nicht.

PHP Code:
#AutoIt3Wrapper_UseX64=n
#include <FF.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:\Users\Hove\Desktop\KODAK Autoit\Forms\Votetest1.kxf
$Form1_1 = GUICreate("Dark-Metin2 Vote Bot Copyright Evoh", 827, 327, 272, 177)
$MenuItem3 = GUICtrlCreateMenu("&Datei")
$Save = GUICtrlCreateMenuItem("Speichern", $MenuItem3)
$Load = GUICtrlCreateMenuItem("Laden", $MenuItem3)
$MenuItem4 = GUICtrlCreateMenuItem("Beenden", $MenuItem3)
$MenuItem1 = GUICtrlCreateMenu("&Help")
$MenuItem2 = GUICtrlCreateMenuItem("Hilfe", $MenuItem1)
GUISetBkColor(0x000000)
$Ueberschirft = GUICtrlCreateLabel("Test", 304, 8, 201, 28)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFFFF)
$Button1 = GUICtrlCreateButton("Vote", 704, 88, 81, 25)
GUICtrlSetCursor (-1, 0)
$Port1 = GUICtrlCreateInput("Port 1", 288, 88, 57, 21)
$Port2 = GUICtrlCreateInput("Port 2", 288, 128, 57, 21)
$Port3 = GUICtrlCreateInput("Port 3", 288, 168, 57, 21)
$Port4 = GUICtrlCreateInput(" Port 4", 288, 208, 57, 21)
$Label4 = GUICtrlCreateLabel("Ports", 288, 56, 33, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFFFF)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
= GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
         Case 
$Button1
            _Func1 
()
    EndSwitch
WEnd

Func    _Func1 
()  
Sleep(1000)
;
Seite öffnen
$variable1 
= GUICtrlRead($Port1)   ;Port 1
MsgBox
(0,"",$variable1)
_FFStart("http://www.google.de")
_FFPrefSet("network.proxy.type", 1) 
_FFPrefSet("network.proxy.http_port", $variable1)  ; wenn ich statt $variable1 eine Zahl einfüge funktioniert es...
_FFOpenURL("http://www.google.de")
MsgBox(0,"",_FFPrefGet("network.proxy.http_port"))
EndFunc 
07/19/2013 19:31 Croco™#2
Es könnte daran liegen, das _FFPrefSet einen int Wert erwartet und durch das auslesen der Inputbox einen String bekommt. Versuch es mal mit
Quote:
_FFPrefSet("network.proxy.http_port", Int($variable1))
07/19/2013 19:57 evoh12#3
:D sehr gut dankeschön --> hat funktioniert