Pfadauswahl soll in einen eingabebereich

  • Hallo,

    ich habe ein problem was sich wie folgt äussert:

    [autoit]

    $Pfad = GUICtrlCreateInput($actualpath & "programm.exe", 24, 136, 121, 22

    [/autoit]


    in diesem Inputbereich soll ein "pfad" rein der sich durch diese funktion ergeben soll
    Button dazu:

    [autoit]

    $exe = GUICtrlCreateButton("Pfad suchen", 16, 170, 99, 25, 0)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlSetOnEvent ($exe,"folder")

    [/autoit]


    Funktion:

    [autoit]

    Func folder ()
    ;FileSelectFolder("Wähle den ordner aus:", @HomePath, 0,$Pfad)
    ;If FileSelectFolder("Wähle den Ordner aus in dem das programm installiert ist:", @HomePath, 0, $Pfad) = (0) Then GUICtrlSetData ($actualpath,$Pfad)
    EndFunc
    ; ich weiss nichtmal ob das richtig ist :(

    [/autoit]

    da er dann natürlich sagt das die variable nicht gesetzt ist habe ich noch dieses als variable festgelegt:

    [autoit]

    $actualpath = "asd"

    [/autoit]


    Ich hoffe man kann mir ein wenig dabei helfen

  • Bitte, im Spoiler ist der komplette quellcode
    Ich wollte nicht das irgendwer hier wieder denkt ich würde nur "bots" coden...
    Dieses ist halt meine art des lernens (für etwas ein programm schreiben von dem ich weiss was passieren muss / sollte)

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEX.au3>
    #include <IE.au3>
    #include <WindowsConstants.au3>
    #Region ##Festgelegte Variablen
    Const $slow = 15000
    $actualsropath = "asd"
    #EndRegion ##Variablen
    #Region ##Gui
    $Form1 = GUICreate("Start-Tool", 516, 397, 552, 286)
    Opt("GuiOnEventMode",1)
    Opt("MustDeclareVars",0 )
    $PageControl1 = GUICtrlCreateTab(8, 8, 500, 336)
    GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
    GUISetOnEvent($GUI_EVENT_CLOSE, "beenden")
    #EndRegion ##Gui
    #Region ##Angaben
    $Account = GUICtrlCreateTabItem("Account")
    $ID = GUICtrlCreateInput("", 24, 72, 121, 22)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $PW = GUICtrlCreateInput("", 24, 104, 121, 22,0x0020)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $SROPfad = GUICtrlCreateInput($actualsropath & "silkroad.exe", 24, 136, 121, 22)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    #EndRegion ## Angaben
    #Region ##Angaben Label
    GUICtrlCreateLabel("ID", 160, 72, 13, 18)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlCreateLabel("PW", 160, 104, 20, 18)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlCreateLabel("SROPfad", 160, 136, 48, 18)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    #EndRegion ## Angaben Label
    #Region ##Buttons seite 1
    $Start = GUICtrlCreateButton("Starten", 256, 88, 99, 49, 0)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlSetOnEvent ($Start,"Start") ;done /buggy?
    $Bug = GUICtrlCreateButton("Bugreport", 400, 304, 99, 33, 0)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlSetOnEvent ($Bug,"bug") ;done

    [/autoit] [autoit][/autoit] [autoit]

    $Group1 = GUICtrlCreateGroup("Account Daten", 16, 56, 209, 113)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlCreateGroup("", -99, -99, 1, 1)

    [/autoit] [autoit][/autoit] [autoit]

    $hide = GUICtrlCreateButton("Client Verstecken", 16, 312, 99, 25, 0)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlSetOnEvent ($hide,"hide") ;done
    $show = GUICtrlCreateButton("Client Zeigen", 120, 312, 99, 25, 0)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlSetOnEvent ($hide,"show") ;done

    [/autoit] [autoit][/autoit] [autoit]

    $silkexe = GUICtrlCreateButton("SROPfad suchen", 16, 170, 99, 25, 0)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlSetOnEvent ($silkexe,"srofolder")

    [/autoit] [autoit][/autoit] [autoit]

    $save = GUICtrlCreateButton("save", 255, 312, 50, 25, 0)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlSetOnEvent ($save,"save") ;done
    $load = GUICtrlCreateButton("load", 305, 312, 50, 25, 0)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlSetOnEvent ($load,"load") ;done
    #EndRegion ##Buttons seite 1
    #Region ##Buttons seite 2
    $optionen = GUICtrlCreateTabItem("Optionen")
    $Enterdruecken = GUICtrlCreateCheckbox("Enterdrücken", 32, 72, 15, 17)
    GUICtrlCreateLabel ("Enterdrücken", 48, 74, 177,17)
    ;GUICtrlSetOnEvent ($Enterdruecken,"enter")
    $Client = GUICtrlCreateCheckbox("Client verstecken", 32, 96, 15, 17)
    GUICtrlCreateLabel ("Client verstecken",48,98,177,17)
    ;GUICtrlSetOnEvent ($Client,"client")
    $Restart = GUICtrlCreateCheckbox("", 32, 120, 15, 17)
    GUICtrlCreateLabel ("DC -> Clientrestart", 48, 122, 177,17)
    ;GUICtrlSetOnEvent ($Restart,"restart")
    $slowpc = GUICtrlCreateCheckbox("", 32, 144, 15, 17)
    GUICtrlCreateLabel ("Langsamer PC", 48, 146, 177, 17)
    IF $slowpc = (1) Then ;done
    $slowpc = $slow
    EndIf
    $ecsro = GUICtrlCreateCheckbox("", 32, 168, 15, 17)
    GUICtrlCreateLabel ("ECSRO Autopotter starten "&@LF&"(Nur wenn der Autopotter im selben Verzeichnis ist)",48,170,257,47)
    GUICtrlSetOnEvent ($ecsro,"ecsro")
    #EndRegion ##Buttons seite 2
    #Region ##Buttons seite 3
    $links = GUICtrlCreateTabItem("Links")
    $JMHP = GUICtrlCreateButton("Joymax Homepage", 192, 192, 123, 33, 0)
    GUICtrlSetOnEvent ($JMHP,"JMHP") ;done
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $JMBAN = GUICtrlCreateButton("Joymax Banliste", 192, 136, 123, 33, 0)
    GUICtrlSetOnEvent ($JMBAN,"JMBAN") ;done
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $FORUM = GUICtrlCreateButton("Silkroad Online Forum", 192, 80, 123, 33, 0)
    GUICtrlSetOnEvent ($FORUM,"FORUM") ;done
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $UPDATE = GUICtrlCreateButton("Updates", 192, 248, 123, 33, 0)
    GUICtrlSetOnEvent ($UPDATE,"UPDATE") ;done
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlCreateTabItem("")
    $exit = GUICtrlCreateButton("Exit", 350, 360, 75, 25, 0)
    GUICtrlSetOnEvent ($exit,"beenden") ;done
    $hilfe = GUICtrlCreateButton("Hilfe", 432, 360, 75, 25, 0)
    GUICtrlSetOnEvent ($hilfe,"hilfe") ;done
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    Case $ID
    EndSwitch
    WEnd
    #EndRegion ##Buttons seite 3

    [/autoit] [autoit][/autoit] [autoit]

    ;Func OnAutoItStart()
    ;
    ;EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    #Region ##Functions
    Func srofolder ()
    ;FileSelectFolder("Wähle den Silkroadordner aus:", @HomePath, 0,$SROPfad)
    If FileSelectFolder("Wähle den Ordner aus in dem Silkroad installiert ist:", @HomePath, 0, $SROPfad) = (0) Then GUICtrlSetData ($actualsropath,$SROPfad)
    EndFunc
    Func Start()
    GUICtrlRead($SROPfad)
    Run (GUICtrlRead($SROPfad))
    If $slowpc = (1) Then
    sleep ($slow)
    EndIf
    if $slowpc <> (1) Then
    sleep (10000)
    EndIf
    WinActivate ("[CLASS:CLIENT]")
    $handle = WinGetHandle ("[CLASS:CLIENT]")
    sleep (8000)
    Controlsend ($handle,"","Edit1","{TAB}{TAB}")
    Sleep(1000)
    ControlSend ($handle,"","Edit1",$ID)
    Sleep(1000)
    Controlsend ($handle,"","Edit2","{TAB}")
    ControlSend ($handle,"","Edit2",$PW)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func UPDATE ()
    $oIE = _IECreate ("http://semtexunion.se.funpic.de/wordpress/?p=6")
    EndFunc
    Func FORUM ()
    $oIE = _IECreate ("www.silkroadonline.de")
    EndFunc
    Func JMHP ()
    $oIE = _IECreate ("www.silkroadonline.net")
    EndFunc
    Func JMBAN ()
    $oIE = _IECreate ("http://www.joymax.com/silkroad/Silkroad_Front.jmx?workURL=http://silkroadcp.joymax.com/notarget/punishment/punishment_list.asp?")
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func bug ()
    $oIE = _IECreate ("http://www.silkroadonline.de/index.php?form=Mail&userID=25108")
    EndFunc
    Func save ()
    IniWrite("settings.ini","char","Acc-name",GUICtrlRead($ID))
    Iniwrite("settings.ini","char","Passwort", GuiCtrlRead($PW))
    Iniwrite("settings.ini","char","Silkroadordner",GUICtrlRead($SROPfad))
    Iniwrite("settings.ini","char","Autopotter",GUICtrlRead($ecsro))
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func load ()
    $1=IniRead("settings.ini","char","Acc-name", GUICtrlRead($ID))
    $2=Iniread("settings.ini","char","Passwort", GuiCtrlRead($PW))
    $3=IniRead("settings.ini","char","Silkroadordner",GUICtrlRead($SROPfad))
    $4=IniRead("settings.ini","char","Autopotter", GUICtrlRead($ecsro))
    GUICtrlSetData($ID,$1)
    GuiCtrlSetData($PW,$2)
    GUICtrlSetData($SROPfad,$3)
    GUICtrlSetData($ecsro,$4)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func ecsro ()
    if $ecsro = "1" then
    Winwaitactive ("[CLASS:CLIENT]")
    sleep (500)
    run ("autopotion.exe")
    EndIf
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func beenden ()
    Exit
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func Optionenende ()
    GUIDelete ( "Hilfe" )
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func hilfe ()
    Opt("GuiOnEventMode",1)
    $secondwindow = GUICreate ("Hilfe",400,200)
    GUISetOnEvent($GUI_EVENT_CLOSE, "Optionenende")

    GUICtrlCreateLabel ("ID: Bitte gib dort die ID deines Chars ein",20,10,250,20)
    GuiCtrlcreatelabel ("PW: Bitte gib dort das Passwort deines Chars ein",20,30,250,20)
    GUICtrlCreateLabel ("SROPfad: Bitte gib dort den Pfad zum SilkroadClienten ein "&@LF&"(mit silkroad.exe oder loader.exe)",20,50,300,50)
    GUICtrlCreateLabel ("Enterdrücken: Das Tool drückt automatisch EINMAL! die ENTER taste",20,85,250,50)
    GUICtrlCreateLabel ("Client Verstecken: Das Tool versteckt nach der eingabe der Daten den Clienten",20,120,250,50)
    GUICtrlCreateLabel ("Langsamer PC: Das Tool wartet länger auf den Clienten",20,155,250,30)
    GUISetState(@SW_Show)
    While 0
    sleep(1000)
    WEnd
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func hide ()
    $handle = WinGetHandle ("[CLASS:CLIENT]")
    WinSetState ($handle,"",@SW_HIDE)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func show ()
    $handle = WinGetHandle ("[CLASS:CLIENT]")
    WinSetState ($handle,"",@SW_SHOW)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    #EndRegion ##Functions

    [/autoit]
  • schau dir dochmal die funktion an

    Spoiler anzeigen


    $Input1 = GUICtrlCreateInput("C:\Programme\Devil Software",160, 64, 345, 21)

    Case $Button5
    GUICtrlSetData($Input1, FileSelectFolder("Bitte Installationspfad wählen","", 1))
    $PH = GUICtrlRead($Input1, 1)
    If $PH < " " Then
    MsgBox(16, "Error", "Bitte Pfad eingeben!")
    Else
    GUICtrlSetState($Button4, $GUI_ENABLE)
    EndIf


    so daraus kannst ja jetzt noch machen das er in eine ini speichert

    oder schaue ihr da siehst du den ganzen code aber mit ini schreiben musst du selber machen klick
    aber mehr hilfe bekommst nicht so wie AutoBert schon sagt ist bestimmt für dein bot und bots kannst du ihr abfragen das ist ein forum dafür autoitbot.de

  • Damit kann ich kaum etwas anfangen da ich keine blasse ahnung habe wie überhaupt ich diese befehle benutze.
    Ich habe das zwar jetzt auf verschiedene arten ausprobiert aber dort kommt kein ergebnis heraus :(

  • Hallo TheBigX,


    In dem Skript kommt mir das Wort SILKROAD zuoft vor, daher BOT verdächtig,

    mfg (Auto)Bert

  • Das wort silkroad steht zu 90% für Pfade (orte wo zum beispiel der launcher von Silkroad liegt (in diesem falle silkroad.exe)) und da dieser Pfad so von Joymax mit dem ordner Silkroad versehen wurde kann ich da nichts anderes machen als diese so zu übernehmen oder?
    Der rest sind variablen die des Verständnisses halber z.b. $SROPfad heissen (damit ich weiss das diese variable für den Pfad zu sro zuständig ist)

  • Hallo TheBigX,

    nachdem ich gerade mitbekommen habe, dass bernd670 dir in deinem anderen Thread geholfen hat und ausserdem die Feststellung getroffen hat, das es sich bei deinem Start-Tool nicht um einen Bot handelt, hier die Lösung zu deinem FileSelectFolder Problem:

    [autoit]

    #Region ##Functions
    Func srofolder ()
    ;FileSelectFolder("Wähle den Silkroadordner aus:", @HomePath, 0,$SROPfad)
    $actualsropath = FileSelectFolder("Wähle den Ordner aus in dem Silkroad installiert ist:", @HomePath, 0, $SROPfad)
    If Not @error Then
    GUICtrlSetData ($SROPfad,$actualsropath & "\silkroad.exe")
    Else
    ;Fehlermedlung ausgeben
    EndIf
    EndFunc

    [/autoit]


    sorry für meine falsche Einschätzung aber der Name TheBigX taucht dummerweise auch auf Boter-Seiten auf,

    mfg (Auto)Bert