help pls script geht viel zu oft auf :(

  • Hier mal mein script


    [autoit]

    #include <GUIConstants.au3>

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Flash_CD", 363, 201, 193, 115)
    $winamp = GUICtrlCreateLabel("winamp", 16, 32, 40, 17)
    $firefox = GUICtrlCreateLabel("firefox", 16, 72, 32, 17)
    $fraps = GUICtrlCreateLabel("fraps", 16, 104, 27, 17)
    $TeamViewer = GUICtrlCreateLabel("TeamViewer", 16, 136, 63, 17)
    $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 104, 32, 17, 17)
    $Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 104, 72, 17, 17)
    $Checkbox3 = GUICtrlCreateCheckbox("Checkbox3", 104, 104, 17, 17)
    $Checkbox4 = GUICtrlCreateCheckbox("Checkbox4", 104, 128, 17, 17)
    $INSTALL = GUICtrlCreateButton("INSTALL", 96, 160, 177, 33, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $INSTALL
    If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then
    RunWait("winamp.exe" , "" , @SW_HIDE)
    EndIf
    If GUICtrlRead($Checkbox2) = $GUI_CHECKED Then
    RunWait("firefox.exe")
    EndIf

    EndSwitch
    WEnd

    [/autoit]


    meine frage ist wenn ich die 1. checkbox nur anklicke das geht das script ohne probleme.
    doch wenn ich die erste und die zweite checkbox anklicke dann instal das script das erste programm und wenn es das 2te programm instal will öffnet sich das script so oft bis mein pc die fliege macht
    also was ist denn ein men script fasch
    hilfe habe ich nix gefunden
    hoffe man kann mich gut verstehen was ich wil
    mfg manny89

  • Heißt deine Autoit-Exe vllt. Firefox.exe ? :P
    //Edit: Dann wärs aber trotzdem komisch, da ja nicht jedes Mal automatisch auf INSTALL geklickt wird.
    Möglicherweise ist aber firefox.exe ein 2.Skript, das einen Fehlöer hat :)

    Einmal editiert, zuletzt von progandy (17. April 2008 um 19:03)

  • Haha stimmt :D Eigentlich logisch, aber wer nennt sein Script firefox.exe :D
    //Edit: Stimmt, aber ich denke, er möchte sich nur ein schönes Programm schreiben, womit er das starten kann, was er möchte, weil er die Labels schon so genannt hat. Von daher sollte eine direkte Pfadangabe dann auch das Problem lösen ;).

  • kannst mal das Skript kurz testen und schauen was für werte du bekommst für:
    $back1+$file1
    $back2+$file2

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Flash_CD", 363, 201, 193, 115)
    $winamp = GUICtrlCreateLabel("winamp", 16, 32, 40, 17)
    $firefox = GUICtrlCreateLabel("firefox", 16, 72, 32, 17)
    $fraps = GUICtrlCreateLabel("fraps", 16, 104, 27, 17)
    $TeamViewer = GUICtrlCreateLabel("TeamViewer", 16, 136, 63, 17)
    $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 104, 32, 17, 17)
    $Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 104, 72, 17, 17)
    $Checkbox3 = GUICtrlCreateCheckbox("Checkbox3", 104, 104, 17, 17)
    $Checkbox4 = GUICtrlCreateCheckbox("Checkbox4", 104, 128, 17, 17)
    $INSTALL = GUICtrlCreateButton("INSTALL", 96, 160, 177, 33, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

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

    Case $INSTALL
    If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then
    $file1 = FileExists("winamp.exe")
    MsgBox(0,"",$file1)
    $back1 = RunWait("winamp.exe" , "" , @SW_HIDE)
    MsgBox(0,"",$back1)
    EndIf
    If GUICtrlRead($Checkbox2) = $GUI_CHECKED Then
    $file2 = FileExists("firefox.exe")
    MsgBox(0,"",$file2)
    $back2 = RunWait("firefox.exe")
    MsgBox(0,"",$back2)
    EndIf
    EndSwitch
    WEnd

    [/autoit]


    Danke und Gruß Stormy

    Edit:
    So, konnten Problem herausfinden, winamp klappt einwandfrei, ohne Probleme, $file1 = 1 und $back1 = 0, also optimal.
    Probleme hat Firefox gemacht, war wahrscheinlich in den ersten Zeilen RunWait("Firefox.exe") drin und das Skript hieß ja so bzw. die compilierte Exe, dadurch hat sich die exe immer wieder selbst gestartet. :D :D :D
    Habs bei mir ausprobiert, hat echt fun gemacht.
    Für alle die es auch mal probieren wollen, einfach den code kompilieren und in firefox.exe umbennen:

    Spoiler anzeigen
    [autoit]

    RunWait("firefox.exe")

    [/autoit]

    Gruß Stormy

    Edit2: les grad den Beitrag von Progandy...
      @progandy: jo, des war des Prob

    4 Mal editiert, zuletzt von stormy (17. April 2008 um 20:14)

  • ja ich will mir so ein fenster machen mit heckbokxen wo man auswählen kann was man instal will

  • Ich hab mir selber mal sowas geschrieben...

    Spoiler anzeigen
    [autoit]


    #include <GUIConstants.au3>

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

    #include<Funktionen.au3>

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

    $gui = GUICreate("TestPfeil", 450, 450, @DesktopWidth / 2 - 225, @DesktopHeight / 2 - 225)
    $01 = GUICtrlCreateCheckbox("Firefox", 25, 25)
    $02 = GUICtrlCreateCheckbox("Autoit", 25, 45)
    $03 = GUICtrlCreateCheckbox("Scite Editor", 25, 65)
    $04 = GUICtrlCreateCheckbox("ICQ 6.0", 25, 85)
    $05 = GUICtrlCreateCheckbox("Teamspeak", 25, 105)
    $06 = GUICtrlCreateCheckbox("Xfire", 25, 125)
    $07 = GUICtrlCreateCheckbox("WinRar", 25, 145)
    $08 = GUICtrlCreateCheckbox("7Zip", 25, 165)
    $09 = GUICtrlCreateCheckbox("VLC Player", 25, 185)
    $10 = GUICtrlCreateCheckbox("Xchat", 25, 205)
    $11 = GUICtrlCreateCheckbox("Thunderbird", 25, 225)

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

    $pfad = GUICtrlCreateInput("", 25, 275, 225)

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

    $B_install = GUICtrlCreateButton("Installieren", 75, 350, 75, 50)
    $B_abort = GUICtrlCreateButton("Abbrechen", 300, 350, 75, 50)
    GUISetState(@SW_SHOW)
    While 1
    $msg = GUIGetMsg()
    If $msg = $B_install Then
    $path = GUICtrlRead($pfad)
    If $path = "" Then
    $path = "C:\Programme\"
    EndIf

    If GUICtrlRead($01) = 1 Then
    Call("firefox", $path)
    EndIf

    If GUICtrlRead($02) = 1 Then
    call("Autoit", $path)
    EndIf

    If GUICtrlRead($03) = 1 Then
    Call("Scite", $path)
    EndIf

    If GUICtrlRead($04) = 1 Then
    Call("icq", $path)
    EndIf

    If GUICtrlRead($05) = 1 Then
    Call("teamspeak", $path)
    EndIf

    If GUICtrlRead($06) = 1 Then
    Call("xfire", $path)
    EndIf

    If GUICtrlRead($07) = 1 Then
    Call("winrar", $path)
    EndIf

    If GUICtrlRead($08) = 1 Then
    Call("_7zip", $path)
    EndIf

    If GUICtrlRead($09) = 1 Then
    Call("vlc", $path)
    EndIf

    If GUICtrlRead($10) = 1 Then
    ;Call("xchat", $path)
    EndIf

    If GUICtrlRead($11) = 1 Then
    Call("thunderbird", $path)
    EndIf
    ElseIf $msg = $B_abort Then
    ExitLoop
    ElseIf $msg = $GUI_EVENT_CLOSE Then
    ExitLoop
    EndIf
    WEnd

    [/autoit]

    Die ganzen Funktionen für die Installationen hab ich in ner extra .au3 File und rufe in dem Script nur die Funktionen auf. z.B sieht die Funktion für den Firefox so aus:


    [autoit]

    func firefox($Path="C:\Programme")
    run(@ScriptDir&"\Installer\Firefox_Setup_2.0.0.12de.exe")
    sleep(100)
    winwait("Mozilla Firefox-Installation")
    controlclick("Mozilla Firefox-Installation", "", 1)
    ControlSend("Mozilla Firefox-Installation", "","", "!a")
    controlclick("Mozilla Firefox-Installation", "", 1)
    controlclick("Mozilla Firefox-Installation", "", 1202)
    controlclick("Mozilla Firefox-Installation", "", 1)
    controlclick("Mozilla Firefox-Installation", "", 1)
    ControlSend("Mozilla Firefox-Installation", "", 1019, $Path&"\Firefox")
    controlclick("Mozilla Firefox-Installation", "", 1)
    controlcommand("Mozilla Firefox-Installation", "", 1203, "Uncheck")
    controlclick("Mozilla Firefox-Installation", "", 1)
    controlclick("Mozilla Firefox-Installation", "", 1)
    winwait("Mozilla Firefox-Installation", "Klicken Sie auf Fertig stellen, um den Installations-Assistenten zu schließen.")
    controlclick("Mozilla Firefox-Installation", "", 1203)
    controlclick("Mozilla Firefox-Installation", "", 1)
    EndFunc

    [/autoit]


    In das InputFelpd kann man nen Alternativen Installations-Pfad angeben.

    Ich hoffe ich konnte Helfen...

    Mfg
    monkey

    Monkey - die finale Potenz von göttlich!
    Sloganizer