Mein script spinnt

  • ich habe mal aus langeweile eine computer console gemacht und wie jeder probiert jeder sein script imer wieder und aufeinmal startet mein script eine exe dauerhaft obwohl der befhel nict eingegebn wurde

    und sagt jetz nicht *das ist der reinste müll hör lieber auf zu scripten*

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

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

    HotKeySet ("^!{s}","Show")
    HotKeySet ("^!{h}","Hide")
    HotKeySet ("^!{p}","Passwort")

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

    $random = Random (0,99999999,1)
    $Form1 = GUICreate($random, 347, 191, 230, 140, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE,$WS_Popup))
    $input = GUICtrlCreateEdit("", 0, 0, 345, 81)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    $List = GUICtrlCreateList("", 0, 80, 345, 110)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    GUISetState(@SW_SHOW)
    GUICtrlSetData ($List,"Bitte das Passwort eingeben." & @CRLF)
    While 1
    WinActivate ($Form1)
    $read = GUICtrlRead ($input)
    If $read = "p" & $random Then
    $test = WinSetTitle ($Form1,"","Computer Console")
    GUICtrlSetData ($List,"")
    GUICtrlSetData ($List,"Passwort richtig." & @CRLF)
    GUICtrlSetData ($input,"")
    GUICtrlSetData ($List,"Bitte Console aktiviren." & @CRLF)
    While 1
    $read = GUICtrlRead ($input)
    If $read = "Hallo" Then
    GUICtrlSetData ($List,"")
    GUICtrlSetData ($List,"Hallo." & @CRLF)
    GUICtrlSetData ($input,"")
    While 1
    $read = GUICtrlRead ($input)
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch

    If $read = "Hallo" Then
    GUICtrlSetData ($List,"Immer noch Hallo ^^." & @CRLF)
    GUICtrlSetData ($input,"")
    EndIf

    If $read = "Delet" Then
    GUICtrlSetData ($List,"")
    GUICtrlSetData ($List,"Hallo.")
    GUICtrlSetData ($input,"")
    EndIf

    If $read = "Musik" Then
    GUICtrlSetData ($List,"Musik kommt." & @CRLF)
    GUICtrlSetData ($input,"")
    Run (@MyDocumentsDir & "\Eigene Musik\musik.m3u")
    EndIf

    If $read = "Metin2" Then
    GUICtrlSetData ($List,"Welches Metin2 ?" & @CRLF)
    GUICtrlSetData ($input,"")
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch

    $read = GUICtrlRead ($input)

    If $read = "Korea" Then
    GUICtrlSetData ($List,"Metin2 Korea wird gestartet." & @CRLF)
    GUICtrlSetData ($input,"")
    ShellExecute ( "metin2.exe", "", "D:\Programme\Metin2453" )
    ExitLoop
    EndIf

    If $read = "DE" Then
    GUICtrlSetData ($List,"Metin2 DE wird gestartet." & @CRLF)
    GUICtrlSetData ($input,"")
    ShellExecute ( "metin2.exe", "", "D:\Programme\Metin2_Germany" )
    ExitLoop
    EndIf
    WEnd
    EndIf
    WEnd
    EndIf
    WEnd
    EndIf
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    WEnd

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

    Func Show ()
    GUISetState (@SW_SHOW,$Form1)
    EndFunc

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

    Func Hide ()
    GUISetState (@SW_HIDE,$Form1)
    EndFunc

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

    Func Passwort ()
    $read = GUICtrlRead ($input)
    GUICtrlSetData ($input,$read & $random)
    EndFunc

    [/autoit]
  • omg ich führe niewieder fremde scripts aus -.-...ich konnte NIX mehr machen als das an war..bildschirm hat geflackert und nix ging..

  • Oh gott, ich geb euch allen nen gut gemeinten tipp. Fangt NIEMALS mit Metin2 an. Und wenn überhaupt, mit der US version.

    Allein für den Post hätt ich im deutschen Metin2 forum übrigens schon ne Verwarnung bekommen.

    :rofl:

  • Jo, sry auch für mein Kommentar oben ^^
    Aber ich hab mit Metin einfach zu schlechte erfahrungen gemacht.

    So, ich nun mit meinem Anfänger-Latein: ^^

    Könnte es vllt an der While 1 Schleife liegen?
    Dann könnte man evtl. mit AdlibEnablelösen.

    Welche Datei öffnet sich denn da eigl. andauernd? Will das script jetz nich unbedingt ausführen ^^

  • mhh, also wenn $WS_Popup oben dabei steht, öffnet sich nichtmal die GUI, ohne öffnet sich die GUI.


    EDIT:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    HotKeySet ("^!{s}","Show")
    HotKeySet ("^!{h}","Hide")
    HotKeySet ("^!{p}","Passwort")
    $random = Random (0,99999999,1)
    $Form1 = GUICreate($random, 347, 191, 230, 140, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))
    $input = GUICtrlCreateEdit("", 0, 0, 345, 81)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    $List = GUICtrlCreateList("", 0, 80, 345, 110)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    GUISetState(@SW_SHOW)
    GUICtrlSetData ($List,"Bitte das Passwort eingeben." & @CRLF)
    While 1
    WinActivate ($Form1)
    $read = GUICtrlRead ($input)
    If $read = "p" & $random Then
    $test = WinSetTitle ($Form1,"","Computer Console")
    GUICtrlSetData ($List,"")
    GUICtrlSetData ($List,"Passwort richtig." & @CRLF)
    GUICtrlSetData ($input,"")
    GUICtrlSetData ($List,"Bitte Console aktiviren." & @CRLF)
    While 1
    $read = GUICtrlRead ($input)
    If $read = "Hallo" Then
    GUICtrlSetData ($List,"")
    GUICtrlSetData ($List,"Hallo." & @CRLF)
    GUICtrlSetData ($input,"")
    While 1
    $read = GUICtrlRead ($input)
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch

    If $read = "Hallo" Then
    GUICtrlSetData ($List,"Immer noch Hallo ^^." & @CRLF)
    GUICtrlSetData ($input,"")
    EndIf

    If $read = "Delet" Then
    GUICtrlSetData ($List,"")
    GUICtrlSetData ($List,"Hallo.")
    GUICtrlSetData ($input,"")
    EndIf

    If $read = "Musik" Then
    GUICtrlSetData ($List,"Musik kommt." & @CRLF)
    GUICtrlSetData ($input,"")
    Run (@MyDocumentsDir & "\Eigene Musik\musik.m3u")
    EndIf

    If $read = "Metin2" Then
    GUICtrlSetData ($List,"Welches Metin2 ?" & @CRLF)
    GUICtrlSetData ($input,"")
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch

    $read = GUICtrlRead ($input)

    If $read = "Korea" Then
    GUICtrlSetData ($List,"Metin2 Korea wird gestartet." & @CRLF)
    GUICtrlSetData ($input,"")
    If FileExists ( "D:\Programme\Metin2453\metin2.exe" ) Then
    ShellExecute ( "Metin2.exe", "", "D:\Programme\Metin2453" )
    Else
    MsgBox (0, "Error", "Metin2 Korea gibt es nicht")
    Exit
    EndiF
    EndIf

    If $read = "DE" Then
    GUICtrlSetData ($List,"Metin2 DE wird gestartet." & @CRLF)
    GUICtrlSetData ($input,"")
    If FileExists ("D:\Programme\Metin2_Germany\metin2.exe") Then
    ShellExecute ( "metin2.exe", "", "D:\Programme\Metin2_Germany" )
    Else
    MsgBox (0, "Error", "Metin2 DE gibt es nicht")
    Exit
    EndIF
    EndIf
    WEnd
    EndIf
    WEnd
    EndIf
    WEnd
    EndIf
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    WEnd
    Func Show ()
    GUISetState (@SW_SHOW,$Form1)
    EndFunc
    Func Hide ()
    GUISetState (@SW_HIDE,$Form1)
    EndFunc
    Func Passwort ()
    $read = GUICtrlRead ($input)
    GUICtrlSetData ($input,$read & $random)
    EndFunc

    [/autoit]


    Und wie ist es so?
    Nu müssts aba mal gehn ^^

    4 Mal editiert, zuletzt von Commander21 (19. März 2009 um 18:50)

  • Ähm eine Frage, warum soll das Fenster als Aktivirt werden?
    Müsste das noicht so sein?

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    HotKeySet ("^!{s}","Show")
    HotKeySet ("^!{h}","Hide")
    HotKeySet ("^!{p}","Passwort")
    $random = Random (0,99999999,1)
    $Form1 = GUICreate($random, 347, 191, 230, 140, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))
    $input = GUICtrlCreateEdit("", 0, 0, 345, 81)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    $List = GUICtrlCreateList("", 0, 80, 345, 110)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    GUISetState(@SW_SHOW)
    GUICtrlSetData ($List,"Bitte das Passwort eingeben." & @CRLF)
    While 1
    $read = GUICtrlRead ($input)
    If $read = "p" & $random Then
    $test = WinSetTitle ($Form1,"","Computer Console")
    GUICtrlSetData ($List,"")
    GUICtrlSetData ($List,"Passwort richtig." & @CRLF)
    GUICtrlSetData ($input,"")
    GUICtrlSetData ($List,"Bitte Console aktiviren." & @CRLF)
    While 1
    $read = GUICtrlRead ($input)
    If $read = "Hallo" Then
    GUICtrlSetData ($List,"")
    GUICtrlSetData ($List,"Hallo." & @CRLF)
    GUICtrlSetData ($input,"")
    While 1
    $read = GUICtrlRead ($input)
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch

    If $read = "Hallo" Then
    GUICtrlSetData ($List,"Immer noch Hallo ^^." & @CRLF)
    GUICtrlSetData ($input,"")
    EndIf

    If $read = "Delet" Then
    GUICtrlSetData ($List,"")
    GUICtrlSetData ($List,"Hallo.")
    GUICtrlSetData ($input,"")
    EndIf

    If $read = "Musik" Then
    GUICtrlSetData ($List,"Musik kommt." & @CRLF)
    GUICtrlSetData ($input,"")
    Run (@MyDocumentsDir & "\Eigene Musik\musik.m3u")
    EndIf

    If $read = "Metin2" Then
    GUICtrlSetData ($List,"Welches Metin2 ?" & @CRLF)
    GUICtrlSetData ($input,"")
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch

    $read = GUICtrlRead ($input)

    If $read = "Korea" Then
    GUICtrlSetData ($List,"Metin2 Korea wird gestartet." & @CRLF)
    GUICtrlSetData ($input,"")
    If FileExists ( "D:\Programme\Metin2453\metin2.exe" ) Then
    ShellExecute ( "Metin2.exe", "", "D:\Programme\Metin2453" )
    Else
    MsgBox (0, "Error", "Metin2 Korea gibt es nicht")
    Exit
    EndiF
    EndIf

    If $read = "DE" Then
    GUICtrlSetData ($List,"Metin2 DE wird gestartet." & @CRLF)
    GUICtrlSetData ($input,"")
    If FileExists ("D:\Programme\Metin2_Germany\metin2.exe") Then
    ShellExecute ( "metin2.exe", "", "D:\Programme\Metin2_Germany" )
    Else
    MsgBox (0, "Error", "Metin2 DE gibt es nicht")
    Exit
    EndIF
    EndIf
    WEnd
    EndIf
    WEnd
    EndIf
    WEnd
    EndIf
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    WEnd
    Func Show ()
    GUISetState (@SW_SHOW,$Form1)
    EndFunc
    Func Hide ()
    GUISetState (@SW_HIDE,$Form1)
    EndFunc
    Func Passwort ()
    $read = GUICtrlRead ($input)
    GUICtrlSetData ($input,$read & $random)
    EndFunc

    [/autoit]

    mfg. Jam00

  • Hi Jam

    Sry, könntest du vllt. sagen, was du an den script verändert hast? Ich finds grad i.wie net ^^

  • [autoit]

    If $read = "p" & $random Then
    GUICtrlSetData ($List,"Passwort richtig." & @CRLF)

    [/autoit]

    aufgrund dieser 2 zeilen würde ich sagen das passwort is "p"

    hast du dir durchgelesen was das script alles macht? scheint ja paar probleme gegeben zu haben.

  • eiso ich geb in der kästchen p ein und wie tu ich des da bestätigen?
    sorry das ich mich so dumm anstelle aber ivh hab darfor nur batch programmirt :wacko: :whistling:

  • dann anscheinend "Hallo"

    [autoit]

    $read = GUICtrlRead ($input)
    If $read = "Hallo" Then

    [/autoit]

    aber an deiner stelle würde ich keine scripte ausführen die du nicht verstehst. und schon garnicht wenn die leute im autoit forum sagen das das script probleme macht :rofl:

    was versprichst du dir von dem script überhaupt? was willst du machen?