1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. Waluev

Beiträge von Waluev

  • µit - September

    • Waluev
    • 1. September 2008 um 14:49

    Die aktuellen Werte vom Montagstest: :)


    eukalyptus:
    Average: 0.0656 sec.
    Minimum: 0.0608 sec.
    Maximum: 0.0748 sec.
    2451 Bytes

    pee:
    Average: 0.0883 sec.
    Minimum: 0.0794 sec.
    Maximum: 0.0956 sec.
    711 Bytes

    BugFix:
    Average: 0.1202 sec.
    Minimum: 0.1116 sec.
    Maximum: 0.1338 sec.
    2139 Bytes

    Tom99: (ADDITION ONLY!!!)
    Average: 0.4225 sec.
    Minimum: 0.4125 sec.
    Maximum: 0.4362 sec.
    1637 Bytes

    Oscar:
    Average: 0.4445 sec.
    Minimum: 0.4261 sec.
    Maximum: 0.4651 sec.
    1676 Bytes

    goliath:
    Average: 0.8900 sec.
    Minimum: 0.8761 sec.
    Maximum: 0.9255 sec.
    1943 Bytes

    GTA:
    Average: 0.9349 sec.
    Minimum: 0.8983 sec.
    Maximum: 1.1231 sec.
    631 Bytes

    Walle

  • µit - September

    • Waluev
    • 31. August 2008 um 13:12

    BugFix:
    0.134 sec.
    0.125 sec.
    0.144 sec.
    1905 Bytes

    pee:
    0.324 sec.
    0.313 sec.
    0.337 sec.
    793 Bytes

    eukalyptus:
    0.381 sec.
    0.363 sec.
    0.396 sec.
    2042 Bytes

    Tom99: (ADDITION ONLY!!!)
    0.422 sec.
    0.408 sec.
    0.435 sec.
    1637 Bytes

    Oscar:
    0.439 sec.
    0.427 sec.
    0.453 sec.
    2096 Bytes

    GTA:
    0.940 sec.
    0.920 sec.
    0.968 sec.
    4096 Bytes

  • µit - September

    • Waluev
    • 30. August 2008 um 16:41

    Hier mal die aktuellen Werte von Oscar und BugFix:
    Oscar:
    0.449 sec.
    0.433 sec.
    0.463 sec.

    BugFix:
    0.664 sec.
    0.642 sec.
    0.695 sec.


    Walle

  • µit - September

    • Waluev
    • 30. August 2008 um 14:11

    BugFix Runtimes:

    Average: 1.119 sec.
    Minimum: 1.089 sec.
    Maximum: 1.169 sec.

  • µit - September

    • Waluev
    • 30. August 2008 um 11:10

    stimmt...ihr müsst ja schließlich wissen wie ihr steht.

    Also hier die aktuellen Werte in der Reihenfolge: Average,Min,Max.

    pee:
    0,772
    0,761
    0,782

    GTA:
    0,940
    0,910
    0,966

    eukalyptus:
    0,444
    0,419
    0,458

    Oscar:
    0,529
    0,513
    0,556


    Die Werte werden auf meinem Computer unter stets gleichen Ausgangsbedingungen getestet (kein ICQ an, kein Browser an, keine Musik etc.) FW und andere Programme die von nöten sind laufen im Hintergrund, aber wiegesagt, das ist bei allen gleich.
    Trotzdem sind die Messungen selbst wenn ich sie zweimal direkt hintereinander ausführe mit Abweichungen behaftet, das kann ich aber leider nicht ändern.


    Der Größen Benchmark funktioniert bei mir irgendwie noch nicht, da muss ich mich nochmal mit pee kurz schließen^^


    Walle

  • µit - September

    • Waluev
    • 30. August 2008 um 10:51

    Wenn keiner was dagegen hat würde ich die aktuellen Speed Werte der abgegebenen Skripte immer mal online stellen.

  • µit - September

    • Waluev
    • 29. August 2008 um 19:49

    wenn ich das so höre bin ich froh das ich garnicht in die Verlegenheit kommen kann mitzumachen^^

    Aber nur nicht den Mut verlieren ;)

    [Blockierte Grafik: http://www.kinotainment.de/Home/Filmbilder/WALLE1.jpg]

  • Musik-Quiz

    • Waluev
    • 29. August 2008 um 19:33

    Ich hab eure Skripte alle mit den Beatles Ordner getestet. (Also auch ausschließlich Musik der Beatles^^)

    Walle

  • Musik-Quiz

    • Waluev
    • 29. August 2008 um 18:13

    Die Böhsen Onkelz haben 900 Lieder?! *wow*

    Walle

  • µit - September

    • Waluev
    • 29. August 2008 um 16:36

    Ja, das ist wichtig^^ Pee unterstützt mich nur, bekommt aber keine Skripte zu sehen, also das PW bitte NUR an mich senden...


    Walle

  • µit - August

    • Waluev
    • 29. August 2008 um 15:07

    danke für die Info, habs geändert ;)

  • µit - September

    • Waluev
    • 28. August 2008 um 22:32

    du hast es erfasst

  • µit - September

    • Waluev
    • 28. August 2008 um 22:06

    -µIt September 2008 ist vorbei-
    Es werden keine Skripte mehr angenommen

    Die Aufgabe für September 2008:

    Entwickle eine BigInt Bibliothek.
    Aufgabe und Hintergrund:

    Es soll eine einfache "BigInt"-Bibliothek umgesetzt werden. Das heißt eine Funktionssammlung, die beliebig große Zahlen verarbeiten kann und zumindest die Grundrechenarten unterstützt. Dafür ist eine eigene Bibliothek nötig, weil AutoIt (wie fast alle Programmiersprachen) normale Zahlen in ihrem Wertebereich begrenzt. Von Zeit zu Zeit will man diese Schranken aber überschreiten und dann braucht es neue Werkzeuge.

    Funktionen:

    Die zu entwerfende Bibliothek soll folgende Funktionen bieten:
    $b = _BigInt_Load($a) ; Ganze Zahl aus der Dezimaldarstellung in einem String in die interne Darstellung laden
    $a = _BigInt_Print($b) ; Ganze Zahl aus der internen Darstellung in einem String mit der Dezimaldarstellung ausgeben (keine wissenschaftliche Darstellung!). Es ist darauf zu achten, dass führende Nullen entfernt werden und dass insbesondere die Zahl Null exakt als "0" dargestellt wird.
    $d = _BigInt_Add($b, $c) ; addiert $b und $c und liefert das Ergebnis als $d zurück
    $d = _BigInt_Mul($b, $c) ; multipliziert $b und $c und liefert das Ergebnis als $d zurück

    $a ist hierbei jeweils ein String mit einer ganzen Zahl in Dezimaldarstellung, $b, $c und $d Zahlen in der internen Darstellung.
    Voraussetzungen:

    Dabei ist euch freigestellt, welche Datentypen ihr zur Speicherung verwendet, es müssen aber mindestens Zahlen mit einer Dezimallänge von 200 Stellen hineinpassen. Der Rückgabetyp der Funktionen muss so gestaltet sein, dass er sich direkt wieder als Parameter für die nächste Berechnung verwenden lässt. Negative Zahlen müssen nicht unterstützt werden.

    Bewertung:

    Bewertet werden alle vier Funktionen zusammen einmal nach der Länge und einmal nach der Geschwindigkeit (gemittelte Ausführungszeit von 20 Tests).

    Testdaten:
    Siehe Anhang. Einfach die myBigInt.au3 austauschen und die benchmark.au3 starten :).

    Hinweis:

    Die "Schulmethoden" sind für beide Funktionen mögliche Lösungen, aber nicht unbedingt die schnellsten. Auch die gewählte Datenstruktur dürfte großen Einfluss auf die Geschwindigkeit haben.


    Abgabetermin:

    Samstag, 27. September 2008, 20.00 Uhr
    Es ist erlaubt zwei Versionen abzugeben, eine für den Größenwettbewerb, eine für die Geschwindigkeitsmessung.

    WICHTIG!!!:
    Regeln für den µit Wettbewerb

    Ausgeschlossen ist jede Umsetzung, die sich einer anderen Programmiersprache bedient (z.B DLL Calls), es soll wirklich eine Umsetzung mit den Mitteln von AutoIt sein.

    Wenn ihr das Programm fertig habt, bitte als rar Archiv mit PW geschützt posten und dann eine PN mit dem PW an mich, damit ich schonmal anfangen kann die Programme zu studieren. Das Programm kann bis zum Abgabetermin, auch wenn es schonmal veröffentlicht wurde immer wieder verändert werden. Dies sollte aber im Post (z.B durch Versions Nummer) erkennbar sein - das PW bleibt dabei bitte gleich, damit ich dann nich wieder zig PNs bekomme :)

    Für Fragen zur Aufgabe oder dem Wettbewerb an sich, einfach hier posten oder eine PN an mich.

    Viel Spaß und Erfolg beim Lösen der Aufgabe.

    peethebee + Walle

    Edit 29.08.2008 14:32: Neue Testsuite, die einen weiteren Sonderfall beim Addieren abprüft und die 0-Tests korrekt mit Load und Print anspricht (und auch andere Zahlen, weil das Generieren so Spaß macht :D). Bitte updaten, die Dateien add_test.au3 und mul_test.au3 haben sich geändert.

    Edit 29.08.2008 14:59: Es ist erlaubt zwei Versionen abzugeben, eine für den Größenwettbewerb, eine für die Geschwindigkeitsmessung.

    Edit 29.08.2008 15:58: Das Benchmark-Skript unterstützt jetzt getrennte Skripte für Speed und Size.

  • µit - August

    • Waluev
    • 28. August 2008 um 19:11

    Auswertung

    Zunächst einmal möchte ich mich wieder bei allen bedanken, die am Wettbewerb teilgenommen haben. Diesmal waren es zwar leider nur 3 Leute, die sich dieser Aufgabe stellten, aber hauptsache mehr als einer :) Nächstes mal gibts ja was sehr anspruchsvolles mit Daten und ich hoffe damit ein breiteres Spektrum anzusprechen.

     Jetzt aber der eigentlich wichtige Teil, die Auswertung der Einzelnen Arbeiten:

    fabs
    Bugs:

    • Programm beendet sich nach dem Spielen eines Liedes -> Array Problem
    • Unterordner

    MaxWinTrans.au3

    Spoiler anzeigen
    [autoit]

    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_Icon=gfx\icon.ico
    #AutoIt3Wrapper_Outfile=..\..\..\QuizIt!_v1.exe
    #AutoIt3Wrapper_Res_Description=by fabs
    #AutoIt3Wrapper_Res_Fileversion=1.0.0.0
    #AutoIt3Wrapper_Res_Language=1031
    #AutoIt3Wrapper_Run_Au3check=n
    #AutoIt3Wrapper_Tidy_Stop_OnError=n
    #AutoIt3Wrapper_Run_Obfuscator=y
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <ButtonConstants.au3>
    #include <File.au3>
    #include <Misc.au3>
    #include <Sound.au3>
    #NoTrayIcon

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

    DirCreate(@ScriptDir & "\gfx")
    FileInstall("gfx\img1.jpeg", "gfx\img1.jpeg")
    FileInstall("gfx\img2.jpeg", "gfx\img2.jpeg")
    FileInstall("gfx\img3.jpeg", "gfx\img3.jpeg")
    FileInstall("gfx\img4.jpeg", "gfx\img4.jpeg")
    FileInstall("gfx\img5.jpeg", "gfx\img5.jpeg")
    FileInstall("gfx\background.jpeg", "gfx\background.jpeg")
    FileInstall("gfx\logo.jpeg", "gfx\logo.jpeg")
    FileInstall("gfx\icon.ico", "gfx\icon.ico")

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

    Global $covercheck, $artist1, $artist2, $artist3, $title1, $title2, $title3
    Global $gamerun = False
    Global $open, $playtrack, $track1, $track2, $track3, $levelsleep
    Global Const $ver = "1.0"
    Global Const $title = "QuizIt! " & $ver
    Global Const $name = "QuizIt!"
    Global Const $dll = DllOpen("User32.dll")

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

    $splashgui = GUICreate("", 421, 211, @DesktopHeight - 515, 164, $WS_POPUP)
    $logo = GUICtrlCreatePic("gfx\logo.jpeg", 0, 0, 420, 210)

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

    GUICtrlCreateLabel("v. " & $ver, 176, 80, 87, 45)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetFont(-1, 27, 400, 0, "Calisto MT")
    GUICtrlSetColor(-1, 0xFFFFFF)

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

    WinSetTrans($splashgui, "", 10)
    GUISetState(@SW_SHOW)

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

    For $trans = 10 To 240 Step +8
    WinSetTrans($splashgui, "", $trans)
    Sleep(3)
    Next

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

    Sleep(1600)

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

    For $trans = 240 To 0 Step -8
    WinSetTrans($splashgui, "", $trans)
    Sleep(3)
    Next

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

    GUIDelete($splashgui)

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

    Global $gui = GUICreate($title, 490, 330, @DesktopHeight - 550, 110)
    $background = GUICtrlCreatePic("gfx\background.jpeg", 0, 0, 490, 330)
    GUICtrlSetState($background, $GUI_DISABLE)

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

    $pathinput = GUICtrlCreateInput("", 8, 8, 393, 21)
    GUICtrlSetState($pathinput, $GUI_DISABLE)
    $browse = GUICtrlCreateButton("Durchsuchen", 402, 6, 81, 25, 0)

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

    GUICtrlCreateLabel("Fortschritt", 8, 48, 50, 17)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    $soundprogress = GUICtrlCreateProgress(64, 40, 419, 25)

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

    GUICtrlCreateLabel("Punkte", 16, 72, 38, 17)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    $scorelabel = GUICtrlCreateLabel("0", 64, 72, 160, 17)
    GUICtrlSetBkColor($scorelabel, $GUI_BKCOLOR_TRANSPARENT)
    Global $score = ControlGetText($gui, "", $scorelabel)

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

    Global $cover1 = GUICtrlCreatePic("gfx\img1.jpeg", 8, 104, 137, 161)
    Global $artistlabel1 = GUICtrlCreateLabel("Unbekannter Interpret", 8, 272, 137, 17)
    Global $titlelabel1 = GUICtrlCreateLabel("Unbekannter Titel", 8, 290, 139, 17)
    GUICtrlSetBkColor($artistlabel1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetBkColor($titlelabel1, $GUI_BKCOLOR_TRANSPARENT)

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

    Global $cover2 = GUICtrlCreatePic("gfx\img2.jpeg", 176, 104, 137, 161)
    Global $artistlabel2 = GUICtrlCreateLabel("Unbekannter Interpret", 176, 272, 137, 17)
    Global $titlelabel2 = GUICtrlCreateLabel("Unbekannter Titel", 176, 290, 139, 17)
    GUICtrlSetBkColor($artistlabel2, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetBkColor($titlelabel2, $GUI_BKCOLOR_TRANSPARENT)

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

    Global $cover3 = GUICtrlCreatePic("gfx\img3.jpeg", 344, 104, 137, 161)
    Global $artistlabel3 = GUICtrlCreateLabel("Unbekannter Interpret", 344, 272, 137, 17)
    Global $titlelabel3 = GUICtrlCreateLabel("Unbekannter Titel", 344, 290, 139, 17)
    GUICtrlSetBkColor($artistlabel3, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetBkColor($titlelabel3, $GUI_BKCOLOR_TRANSPARENT)

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

    $game = GUICtrlCreateMenu("Spiel")

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

    $play = GUICtrlCreateMenuItem("Neues Spiel starten", $game)

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

    $levelmenu = GUICtrlCreateMenu("Schwierigkeit", $game)
    $easy = GUICtrlCreateMenuItem("Einfach", $levelmenu)
    $middle = GUICtrlCreateMenuItem("Mittel", $levelmenu)
    $hard = GUICtrlCreateMenuItem("Schwer", $levelmenu)
    GUICtrlSetState($easy, $GUI_CHECKED)
    Global $level = "easy"
    Global $levelsleep = 750
    Global $levelmulti = 0

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

    GUICtrlCreateMenuItem("", $game)
    $quit = GUICtrlCreateMenuItem("Beenden" & @TAB & "Esc", $game)

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

    $info = GUICtrlCreateMenu("?")
    $about = GUICtrlCreateMenuItem("Info", $info)

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

    WinSetTrans($gui, "", 10)
    GUISetState(@SW_SHOW)

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

    For $trans = 10 To 240 Step +7
    WinSetTrans($gui, "", $trans)
    Sleep(2)
    Next

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

    $timer = TimerInit()
    While 1
    Global $nMsg = GUIGetMsg()
    Global $tMsg = TrayGetMsg()

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

    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    _terminate()
    Case $easy
    Global $level = "easy"
    $levelsleep = 750
    GUICtrlSetState($easy, $GUI_CHECKED)
    GUICtrlSetState($middle, $GUI_UNCHECKED)
    GUICtrlSetState($hard, $GUI_UNCHECKED)
    Case $middle
    Global $level = "middle"
    $levelsleep = 500
    GUICtrlSetState($easy, $GUI_UNCHECKED)
    GUICtrlSetState($middle, $GUI_CHECKED)
    GUICtrlSetState($hard, $GUI_UNCHECKED)
    Case $hard
    Global $level = "hard"
    $levelsleep = 250
    GUICtrlSetState($easy, $GUI_UNCHECKED)
    GUICtrlSetState($middle, $GUI_UNCHECKED)
    GUICtrlSetState($hard, $GUI_CHECKED)
    Case $browse
    $path = FileSelectFolder("Bitte wählen Sie Ihren Musikordner aus:", "", 2)
    If @error = 1 Then ContinueLoop

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

    Global $files = _FileListToArray($path, "*.mp3", 1)
    If @error = 4 Then
    MsgBox(16, "Fehler", "Das angegebene Verzeichnis enthält keine Musikdateien")
    ContinueLoop
    ElseIf $files[0] < 3 Then
    MsgBox(16, "Fehler", "Es müssen mindestens 3 Musikdateien vorhanden sein")
    ContinueLoop
    Else
    GUICtrlSetData($pathinput, $path)
    ContinueLoop
    EndIf
    Case $about
    _aboutbox()
    Case $play
    If $gamerun = False Then
    _start()
    ElseIf $gamerun = True Then
    If IsDeclared("open") Then _SoundPause($open)
    $newgamebox = MsgBox(36, "Neues Spiel starten", "Möchten Sie wirklich ein neues Spiel starten?" & @CRLF & "Der aktuelle Fortschritt geht verloren")

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

    Do
    Sleep(10)
    Until $newgamebox = 6 Or $newgamebox = 7

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

    If $newgamebox = 6 Then
    Global $levelmulti = 0
    GUICtrlSetData($soundprogress, 0)
    Global $set = "zero"
    _setscore()
    _start()
    ElseIf $newgamebox = 7 Then
    If IsDeclared("open") Then _SoundResume($open)
    ContinueLoop
    EndIf
    EndIf
    Case $quit
    _terminate()
    Case $cover1
    If Not IsDeclared("covercheck") Or $covercheck = False Then
    ContinueLoop
    ElseIf IsDeclared("covercheck") And $covercheck = True Then
    _check()
    EndIf
    Case $cover2
    If Not IsDeclared("covercheck") Or $covercheck = False Then
    ContinueLoop
    ElseIf IsDeclared("covercheck") And $covercheck = True Then
    _check()
    EndIf
    Case $cover3
    If Not IsDeclared("covercheck") Or $covercheck = False Then
    ContinueLoop
    ElseIf IsDeclared("covercheck") And $covercheck = True Then
    _check()
    EndIf
    EndSwitch

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

    If $gamerun = True Then
    If $levelmulti = 100 Then
    $levelmulti = 0
    GUICtrlSetData($soundprogress, 0)
    If $level = "easy" Then
    $levelsleep = 750
    ElseIf $level = "middle" Then
    $levelsleep = 500
    ElseIf $level = "hard" Then
    $levelsleep = 250
    EndIf

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

    Global $set = "down"
    _setscore()
    _start()
    EndIf
    If TimerDiff($timer) > $levelsleep Then
    GUICtrlSetData($soundprogress, $levelmulti)
    $levelmulti += 5
    $timer = TimerInit()
    EndIf
    EndIf

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

    If _IsPressed("41", $dll) And WinActive($gui) Then
    Global $nMsg = $cover1
    ElseIf _IsPressed("42", $dll) And WinActive($gui) Then
    Global $nMsg = $cover2
    ElseIf _IsPressed("43", $dll) And WinActive($gui) Then
    Global $nMsg = $cover3
    EndIf
    Sleep(10)
    WEnd

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

    Func _start()
    $checkgui = _checkgui()
    If $checkgui = False Then Return
    Global $gamerun = True

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

    Global $random = "all"
    _random()

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

    Global $track1 = $files[$rTrack1]
    Global $track2 = $files[$rTrack2]
    Global $track3 = $files[$rTrack3]

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

    If $rPlaytrack = 1 Then
    Global $playtrack = $track1
    ElseIf $rPlaytrack = 2 Then
    Global $playtrack = $track2
    ElseIf $rPlaytrack = 3 Then
    Global $playtrack = $track3
    EndIf

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

    $track1tags = _MP3GetID3v1Tag($path & "\" & $track1)
    $track2tags = _MP3GetID3v1Tag($path & "\" & $track2)
    $track3tags = _MP3GetID3v1Tag($path & "\" & $track3)

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

    #comments-start
    $track1tags = _MP3GetID3v1Tag($path & "\" & $track1)
    If IsArray($track1tags) = 0 Then
    ConsoleWrite(@CRLF & "$track1tags is no array")
    Global $random = 1
    Do
    ConsoleWrite(@CRLF & "calling random 1 func")
    _random()
    $track1tags = _MP3GetID3v1Tag($path & "\" & $track1)
    ConsoleWrite(@CRLF & "tagging file")
    Until IsArray($track1tags) = 1
    ConsoleWrite(@CRLF & "$track1tags is array")
    EndIf

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

    $track2tags = _MP3GetID3v1Tag($path & "\" & $track2)
    If IsArray($track2tags) = 0 Then
    ConsoleWrite(@CRLF & "$track2tags is no array")
    Global $random = 2
    Do
    ConsoleWrite(@CRLF & "calling random 2 func")
    _random()
    $track2tags = _MP3GetID3v1Tag($path & "\" & $track2)
    ConsoleWrite(@CRLF & "tagging file")
    Until IsArray($track2tags) = 1
    ConsoleWrite(@CRLF & "$track2tags is array")
    EndIf

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

    $track3tags = _MP3GetID3v1Tag($path & "\" & $track3)
    If IsArray($track3tags) = 0 Then
    ConsoleWrite(@CRLF & "$track3tags is no array")
    Global $random = 3
    Do
    ConsoleWrite(@CRLF & "calling random 3 func")
    _random()
    $track3tags = _MP3GetID3v1Tag($path & "\" & $track3)
    ConsoleWrite(@CRLF & "tagging file")
    Until IsArray($track3tags) = 1
    ConsoleWrite(@CRLF & "$track3tags is array")
    EndIf
    #comments-end

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

    Global $artist1 = $track1tags[1] ;==> Subscript used with non-Array variable.:
    Global $artist2 = $track2tags[1] ;Global $artist1 = $track1tags[1]
    Global $artist3 = $track3tags[1] ;Global $artist1 = $track1tags^ ERROR

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

    Global $title1 = $track1tags[0]
    Global $title2 = $track2tags[0]
    Global $title3 = $track3tags[0]

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

    Select
    Case $artist1 = ""
    $artist1 = "Unbekannter Interpret"
    Case $artist2 = ""
    $artist2 = "Unbekannter Interpret"
    Case $artist3 = ""
    $artist3 = "Unbekannter Interpret"
    Case $title1 = ""
    $title1 = "Unbekannter Titel"
    Case $title2 = ""
    $title2 = "Unbekannter Titel"
    Case $title3 = ""
    $title3 = "Unbekannter Titel"
    EndSelect

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

    _settext()
    _play()
    EndFunc ;==>_start

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

    Func _checkgui()
    If GUICtrlRead($pathinput) = "" Then
    MsgBox(16, "Fehler", "Es wurde kein Musikordner ausgewählt")
    Return False
    Else
    Return True
    EndIf
    EndFunc ;==>_checkgui

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

    Func _random()
    If $random = 1 Then
    _random1()
    ElseIf $random = 2 Then
    _random2()
    ElseIf $random = 3 Then
    _random3()
    ElseIf $random = 4 Then
    _random4()
    ElseIf $random = "all" Then
    _random1()
    _random2()
    _random3()
    _random4()
    ;~ Return
    EndIf
    EndFunc ;==>_random

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

    Func _random1()
    Global $rTrack1 = Random(1, $files[0], 1)
    ConsoleWrite(@CRLF & "rTrack1: " & $rTrack1)
    ;~ Return
    EndFunc ;==>_random1

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

    Func _random2()
    Do
    Global $rTrack2 = Random(1, $files[0], 1)
    Until $rTrack2 <> $rTrack1
    ConsoleWrite(@CRLF & "rTrack2: " & $rTrack2)
    ;~ Return
    EndFunc ;==>_random2

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

    Func _random3()
    Do
    Global $rTrack3 = Random(1, $files[0], 1)
    Until $rTrack3 <> $rTrack2 And $rTrack3 <> $rTrack1
    ConsoleWrite(@CRLF & "rTrack3: " & $rTrack3)
    ;~ Return
    EndFunc ;==>_random3

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

    Func _random4()
    Global $rPlaytrack = Random(1, 3, 1)
    Return
    EndFunc ;==>_random4

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

    Func _settext()
    Select
    Case StringLen($artist1) > 23
    $trimlen = StringLen($artist1) - 23
    $tArtist1 = StringTrimRight($artist1, $trimlen)
    $artist1 = $tArtist1
    Case StringLen($artist2) > 23
    $trimlen = StringLen($artist2) - 23
    $tArtist2 = StringTrimRight($artist2, $trimlen)
    $artist2 = $tArtist2
    Case StringLen($artist3) > 23
    $trimlen = StringLen($artist3) - 23
    $tArtist3 = StringTrimRight($artist3, $trimlen)
    $artist3 = $tArtist3
    Case StringLen($title1) > 22
    $trimlen = StringLen($title1) - 22
    $tTitle1 = StringTrimRight($title1, $trimlen)
    $title1 = $tTitle1
    Case StringLen($title2) > 22
    $trimlen = StringLen($title2) - 22
    $tTitle2 = StringTrimRight($title2, $trimlen)
    $title2 = $tTitle2
    Case StringLen($title3) > 22
    $trimlen = StringLen($title3) - 22
    $tTitle3 = StringTrimRight($title3, $trimlen)
    $title3 = $tTitle3
    EndSelect

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

    GUICtrlSetData($artistlabel1, $artist1)
    GUICtrlSetData($artistlabel2, $artist2)
    GUICtrlSetData($artistlabel3, $artist3)

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

    GUICtrlSetData($titlelabel1, $title1)
    GUICtrlSetData($titlelabel2, $title2)
    GUICtrlSetData($titlelabel3, $title3)
    Global $nMsg = $cover1
    Global $covercheck = True
    EndFunc ;==>_settext

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

    Func _play()
    If IsDeclared("open") Then
    _SoundStop($open)
    _SoundClose($open)
    EndIf

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

    Global $open = _SoundOpen($path & "\" & $playtrack)

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

    $TrackLength = _SoundLength($open)

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

    $length = StringSplit($TrackLength, ":")

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

    $TrackHourLength = $length[1]
    $TrackMinLength = $length[2]
    $TrackSecLength = $length[3]

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

    $rSeekHour = Random(0, $TrackHourLength, 1) ;min 15s verbleibend @ easy
    $rSeekMin = Random(0, $TrackMinLength, 1) ;min 10s verbleibend @ middle
    $rSeekSec = Random(0, $TrackSecLength, 1) ;min 5s verbleibend @ hard

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

    _SoundPlay($open)
    _SoundSeek($open, $rSeekHour, $rSeekMin, $rSeekSec)
    _SoundPlay($open)
    EndFunc ;==>_play

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

    Func _check()
    Select
    Case $nMsg = $cover1 And $playtrack = $track1
    _success()
    Case $nMsg = $cover2 And $playtrack = $track2
    _success()
    Case $nMsg = $cover3 And $playtrack = $track3
    _success()
    Case Else
    _fail()
    EndSelect
    EndFunc ;==>_check

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

    Func _fail()
    If $nMsg = $cover1 Then
    GUICtrlSetImage($cover1, "gfx\img5.jpeg")
    Sleep(900)
    GUICtrlSetImage($cover1, "gfx\img1.jpeg")
    ElseIf $nMsg = $cover2 Then
    GUICtrlSetImage($cover2, "gfx\img5.jpeg")
    Sleep(900)
    GUICtrlSetImage($cover2, "gfx\img2.jpeg")
    ElseIf $nMsg = $cover3 Then
    GUICtrlSetImage($cover3, "gfx\img5.jpeg")
    Sleep(900)
    GUICtrlSetImage($cover3, "gfx\img3.jpeg")
    EndIf
    Global $set = "down"
    _setscore()
    EndFunc ;==>_fail

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

    Func _success()
    If $nMsg = $cover1 Then
    GUICtrlSetImage($cover1, "gfx\img4.jpeg")
    Sleep(900)
    GUICtrlSetImage($cover1, "gfx\img1.jpeg")
    ElseIf $nMsg = $cover2 Then
    GUICtrlSetImage($cover2, "gfx\img4.jpeg")
    Sleep(900)
    GUICtrlSetImage($cover2, "gfx\img2.jpeg")
    ElseIf $nMsg = $cover3 Then
    GUICtrlSetImage($cover3, "gfx\img4.jpeg")
    Sleep(900)
    GUICtrlSetImage($cover3, "gfx\img3.jpeg")
    EndIf

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

    Global $levelmulti = 0
    GUICtrlSetData($soundprogress, 0)
    Global $set = "up"
    _setscore()
    _start()
    EndFunc ;==>_success

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

    Func _setscore()
    If $set = "down" Then
    If $score <> 0 Then
    $score = $score - 10
    GUICtrlSetData($scorelabel, $score)
    EndIf
    ElseIf $set = "down" And $score = 0 Then
    $score = 0
    GUICtrlSetData($scorelabel, $score)
    ElseIf $set = "up" Then
    $score = $score + 10
    GUICtrlSetData($scorelabel, $score)
    ElseIf $set = "zero" Then
    $score = 0
    GUICtrlSetData($scorelabel, $score)
    EndIf
    Return
    EndFunc ;==>_setscore

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

    Func _aboutbox()
    MsgBox(64, "Über " & $title, "Copyright (C) 2008 by fabs für AutoIt.de (µit August)" & @CRLF & "fabs06@gmail.com")
    Return
    EndFunc ;==>_aboutbox

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

    Func _terminate()
    If IsDeclared("open") Then _SoundPause($open)
    $quitbox = MsgBox(36, $name & " beenden", "Möchten Sie " & $name & " wirklich beenden?" & @CRLF & "Der aktuelle Fortschritt geht verloren.", 0, $gui)

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

    Do
    Sleep(10)
    Until $quitbox = 6 Or $quitbox = 7

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

    If $quitbox = 6 Then
    For $trans = 255 To 0 Step -7
    WinSetTrans($gui, "", $trans)
    Sleep(2)
    Next

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

    DllClose($dll)

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

    If IsDeclared("open") Then
    _SoundStop($open)
    _SoundClose($open)
    EndIf
    Exit
    Else
    If IsDeclared("open") Then _SoundResume($open)
    Return
    EndIf
    EndFunc ;==>_terminate

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

    ;===============================================================================
    ; Function Name:_MP3GetID3v1Tag($sFile)
    ; Description: Retrive MP3 ID3Tag v1.0 & v1.1
    ; Parameter(s): $sFile = FileFullPath
    ; Requirement(s):Autoit v3.2.0
    ; Return Value(s):On Success - array with data:
    ; 0 - Title
    ; 1 - Artist
    ; 2 - Album
    ; 3 - Year
    ; 4 - Comment
    ; 5 - Track number
    ; 6 - Genre
    ; 7 - Tag version
    ; On Failure empty string and sets @ERROR:
    ; -1 - File not found
    ; 1 - TAG not found
    ; Version : 2.6.0
    ; Author(s): taz742 based on Lazycat's UDF _MP3GetTag()
    ;===============================================================================
    ;
    Func _MP3GetID3v1Tag($sFile)
    Local $ret = DllCall("kernel32.dll", "int", "CreateFile", _
    "str", $sFile, _
    "int", 0x80000000, _
    "int", 0, _
    "ptr", 0, _
    "int", 3, _
    "int", 0x80, _
    "ptr", 0), $error = 0

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

    If @error Or Not $ret[0] Then
    $error = -1
    Else
    Local $aID3v1
    Local $pTag = _FileReadToStruct("char[3];char[30];char[30];char[30];char[4];char[28];byte[2];byte", $ret[0], FileGetSize($sFile) - 128)
    ;TAG Header|Title|Artist|Album|Year|Comment|Track|Genre
    If Not (DllStructGetData($pTag, 1) == "TAG") Then
    $error = 1
    Else
    Dim $aID3v1[8]
    $aID3v1[0] = DllStructGetData($pTag, 2) ;Title
    $aID3v1[1] = DllStructGetData($pTag, 3) ;Artist
    $aID3v1[2] = DllStructGetData($pTag, 4) ;Album
    $aID3v1[3] = DllStructGetData($pTag, 5) ;Year
    If DllStructGetData($pTag, 7, 1) = 0 Then ;ID3Tag is v1.1 -> Track
    $aID3v1[4] = DllStructGetData($pTag, 6) ;Comment
    $aID3v1[5] = DllStructGetData($pTag, 7, 2) ;Track
    $aID3v1[7] = "1.1" ;version info
    Else ;ID3Tag is v1.0 -> Not Track
    $aID3v1[4] = DllStructGetData($pTag, 6) & String(BinaryToString(DllStructGetData($pTag, 7))) ;Comment
    $aID3v1[5] = "" ;Track is empty because not yet implanted in ID3v1.0
    $aID3v1[7] = "1.0" ;version info
    EndIf
    $aID3v1[6] = _MP3GetGenreByID(DllStructGetData($pTag, 8)) ;Genre
    EndIf
    EndIf
    DllCall("kernel32.dll", "int", "CloseHandle", "int", $ret[0])
    If Not $error Then Return $aID3v1
    SetError($error)
    Return ""
    EndFunc ;==>_MP3GetID3v1Tag

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

    Func _MP3GetGenreByID($iID)
    Local $asGenre = StringSplit("Blues,Classic Rock,Country,Dance,Disco,Funk,Grunge,Hip-Hop," & _
    "Jazz,Metal,New Age,Oldies,Other,Pop,R&B,Rap,Reggae,Rock,Techno,Industrial,Alternative," & _
    "Ska,Death Metal,Pranks,Soundtrack,Euro-Techno,Ambient,Trip-Hop,Vocal,Jazz+Funk,Fusion," & _
    "Trance,Classical,Instrumental,Acid,House,Game,Sound Clip,Gospel,Noise,Alternative Rock," & _
    "Bass,Soul,Punk,Space,Meditative,Instrumental Pop,Instrumental Rock,Ethnic,Gothic,Darkwave," & _
    "Techno-Industrial,Electronic,Pop-Folk,Eurodance,Dream,Southern Rock,Comedy,Cult,Gangsta," & _
    "Top 40,Christian Rap,Pop/Funk,Jungle,Native US,Cabaret,New Wave,Psychadelic,Rave,Showtunes," & _
    "Trailer,Lo-Fi,Tribal,Acid Punk,Acid Jazz,Polka,Retro,Musical,Rock & Roll,Hard Rock,Folk," & _
    "Folk-Rock,National Folk,Swing,Fast Fusion,Bebob,Latin,Revival,Celtic,Bluegrass,Avantgarde," & _
    "Gothic Rock,Progressive Rock,Psychedelic Rock,Symphonic Rock,Slow Rock,Big Band,Chorus," & _
    "Easy Listening,Acoustic,Humour,Speech,Chanson,Opera,Chamber Music,Sonata,Symphony,Booty Bass," & _
    "Primus,Porn Groove,Satire,Slow Jam,Club,Tango,Samba,Folklore,Ballad,Power Ballad,Rhytmic Soul," & _
    "Freestyle,Duet,Punk Rock,Drum Solo,Acapella,Euro-House,Dance Hall,Goa,Drum & Bass,Club-House," & _
    "Hardcore,Terror,Indie,BritPop,Negerpunk,Polsk Punk,Beat,Christian Gangsta,Heavy Metal,Black Metal," & _
    "Crossover,Contemporary C,Christian Rock,Merengue,Salsa,Thrash Metal,Anime,JPop,SynthPop", ",")
    If ($iID >= 0) And ($iID < 148) Then Return $asGenre[$iID + 1]
    Return ("")
    EndFunc ;==>_MP3GetGenreByID

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

    Func _FileReadToStruct($vStruct, $hFile, $nOffset)
    If Not DllStructGetSize($vStruct) Then $vStruct = DllStructCreate($vStruct)
    Local $nLen = DllStructGetSize($vStruct)
    Local $ret = DllCall("kernel32.dll", "int", "SetFilePointer", _
    "int", $hFile, _
    "int", $nOffset, _
    "int", 0, _
    "int", 0) ; FILE_BEGIN
    Local $pRead = DllStructCreate("dword")
    $ret = DllCall("kernel32.dll", "int", "ReadFile", _
    "int", $hFile, _
    "ptr", DllStructGetPtr($vStruct), _
    "int", $nLen, _
    "ptr", DllStructGetPtr($pRead), _
    "ptr", 0)
    If @error Then
    SetError(1)
    EndIf
    Local $nRead = DllStructGetData($pRead, 1)
    $pRead = 0
    SetExtended($nRead)
    If Not ($nRead = $nLen) Then SetError(2)
    Return $vStruct
    EndFunc ;==>_FileReadToStruct

    [/autoit]

    Leider wurde das Programm nach der Entscheidung für die Antwort immer sofort beendet bzw stürzte ab. Grafisch schöne Ansätze, die StartUp GUI fand ich toll :)

    limette:
    Bugs: /

    bild1.jpg

    Spoiler anzeigen
    [autoit]

    #include<WindowsConstants.au3>
    #include<Sound.au3>
    #include<Array.au3>
    #include<EditConstants.au3>
    #include<ComboConstants.au3>
    #include<GUIConstantsEx.au3>
    #include <Inet.au3>
    #include 'mysql.au3'
    #cs ----------------------------------------------------------------------------

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

    AutoIt Version: 3.2.12.1
    Author: limette

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

    Script Function:
    MusicQuiz

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

    #ce ----------------------------------------------------------------------------
    Opt( 'TrayIconDebug', 1 )
    Global $selected = '', $diff = 'medium', $oSound, $oPosH, $oPosM, $oPosS, $curscore, $gscore, $correct, $correctNr, $anzahl_fragen = 0, $correctName, $row = 0
    Global $h_ListView1
    Opt("GUIOnEventMode", 1)
    #Region ### START Koda GUI section ### Form=c:\dokumente und einstellungen\nils.nobody\desktop\musicquiz\aform1.kxf
    $Form1_1 = GUICreate("MusicQuiz", 347, 351, 195, 110)
    GUISetOnEvent( $GUI_EVENT_CLOSE, '_exit' )
    $Group1 = GUICtrlCreateGroup("Media", 8, 8, 329, 117)
    $Combo1 = GUICtrlCreateCombo("", 16, 24, 209, 25, $CBS_DROPDOWNLIST)
    GUICtrlSetTip( -1, 'Auswahl an Listen' )
    $Button1 = GUICtrlCreateButton("OK", 240, 24, 73, 20, 0)
    GUICtrlSetTip( -1, 'Bestätigt die Auswahl der Liste' )
    GUICtrlSetOnEvent( -1, '_select' )
    $Button2 = GUICtrlCreateButton("Hinzufügen", 240, 96, 73, 20, 0)
    GUICtrlSetTip( -1, 'Fügt den gewählten Ordner als Liste hinzu' )
    GUICtrlSetOnEvent( -1, '_add' )
    $Input1 = GUICtrlCreateEdit(@ScriptDir & '\', 16, 72, 209, 42, BitOR( $ES_READONLY, $WS_VSCROLL, $ES_AUTOVSCROLL ))
    $Button3 = GUICtrlCreateButton(" ... ", 240, 72, 73, 20, 0)
    GUICtrlSetTip( -1, 'Durchsuchen Sie ihren PC nach Ordnern mit *.mp3-Dateien' )
    GUICtrlSetOnEvent( -1, '_durchsuchen' )
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Radio4 = GUICtrlCreateRadio("leicht", 180, 150, 40, 17)
    GUICtrlSetOnEvent( -1, '_radio' )
    GUICtrlSetState(-1, $GUI_CHECKED)
    $Radio5 = GUICtrlCreateRadio("mittel", 230, 150, 40, 17)
    GUICtrlSetOnEvent( -1, '_radio' )
    $Radio6 = GUICtrlCreateRadio("schwer", 280, 150, 49, 17)
    GUICtrlSetOnEvent( -1, '_radio' )
    $Group2 = GUICtrlCreateGroup("Quiz", 8, 142, 329, 195)
    $Button4 = GUICtrlCreateButton("Start", 16, 168, 73, 20, 0)
    GUICtrlSetTip( -1, 'Startet das Quiz' )
    GUICtrlSetOnEvent( -1, '_start' )
    GUICtrlSetState( -1, $GUI_DISABLE )
    $Radio1 = GUICtrlCreateRadio("Antwort A", 98, 168, 231, 25)
    GUICtrlSetTip( -1, 'Antwort A' )
    GUICtrlSetState( -1, $GUI_DISABLE )
    GUICtrlSetState(-1, $GUI_CHECKED)
    $Radio2 = GUICtrlCreateRadio("Antwort B", 98, 200, 231, 25)
    GUICtrlSetTip( -1, 'Antwort B' )
    GUICtrlSetState( -1, $GUI_DISABLE )
    $Radio3 = GUICtrlCreateRadio("Antwort C", 98, 232, 231, 25)
    GUICtrlSetTip( -1, 'Antwort C' )
    GUICtrlSetState( -1, $GUI_DISABLE )
    $Button5 = GUICtrlCreateButton("Replay", 32, 192, 41, 33, 0)
    GUICtrlSetTip( -1, 'Wiederholt den Ausschnitt' )
    GUICtrlSetOnEvent( -1, '_replay' )
    GUICtrlSetState( -1, $GUI_DISABLE )
    $Label1 = GUICtrlCreateLabel("Akt. Frage:", 16, 256, 229, 17)
    $Label2 = GUICtrlCreateLabel("Gesamtpunktzahl: ", 16, 297, 230, 17)
    $Label3 = GUICtrlCreateLabel( '', 16, 270, 300, 28 )
    $Button6 = GUICtrlCreateButton("Weiter", 248, 312, 81, 20, 0)
    GUICtrlSetTip( -1, 'Weiter zum nächsten Song' )
    GUICtrlSetOnEvent( -1, '_next' )
    GUICtrlSetState( -1, $GUI_DISABLE )
    $Button_Highscore = GUICtrlCreateButton( 'Highscore', 159, 312, 81, 20, 0 )
    GUICtrlSetOnEvent( -1, '_highscore' )
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    If Not FileExists( @ScriptDir & '\save.ini' ) Then
    If MsgBox( 36, 'Info', 'Sie scheinen das Programm zum ersten Mal zu starten.' & @CRLF & 'Wünschen Sie eine kleine Einführung ?' ) = 6 Then
    WinWaitActive( 'MusicQuiz' )
    $win_coords = WinGetPos( 'MusicQuiz', '' )
    $coords = ControlGetPos( 'MusicQuiz', '', $Button3 )
    If IsArray( $win_coords ) And IsArray( $coords ) Then ToolTip( '<- Wählen Sie zunächst einen Ordner mit max. 2000 Musikstücken.', $win_coords[0]+$coords[0]+73, $win_coords[1]+$coords[1]+30 )
    While GUICtrlRead( $Input1 ) = @ScriptDir & '\'
    Sleep( 100 )
    $win_coords = WinGetPos( 'MusicQuiz', '' )
    $coords = ControlGetPos( 'MusicQuiz', '', $Button3 )
    If IsArray( $win_coords ) And IsArray( $coords ) ThenToolTip( '<- Wählen Sie zunächst einen Ordner mit max. 2000 Musikstücken.', $win_coords[0]+$coords[0]+73, $win_coords[1]+$coords[1]+30 )
    WEnd
    $win_coords = WinGetPos( 'MusicQuiz', '' )
    $coords = ControlGetPos( 'MusicQuiz', '', $Button2 )
    If IsArray( $win_coords ) And IsArray( $coords ) Then ToolTip( '<- Klicken Sie nun auf ''Hinzufügen'' um die Liste zu erstellen.', $win_coords[0]+$coords[0]+73, $win_coords[1]+$coords[1]+30 )
    Sleep( 10000 )
    $win_coords = WinGetPos( 'MusicQuiz', '' )
    $coords = ControlGetPos( 'MusicQuiz', '', $Button1 )
    If IsArray( $win_coords ) And IsArray( $coords ) Then ToolTip( '<- Wählen Sie danach die erstellte Liste aus und klicken Sie ''ok''.', $win_coords[0]+$coords[0]+73, $win_coords[1]+$coords[1]+30 )
    While BitAND( GUICtrlGetState( $Button4 ), $GUI_DISABLE ) = $GUI_DISABLE
    Sleep( 100 )
    $win_coords = WinGetPos( 'MusicQuiz', '' )
    $coords = ControlGetPos( 'MusicQuiz', '', $Button1 )
    If IsArray( $win_coords ) And IsArray( $coords ) Then ToolTip( '<- Wählen Sie danach die erstellte Liste aus und klicken Sie ''ok''.', $win_coords[0]+$coords[0]+73, $win_coords[1]+$coords[1]+30 )
    WEnd
    $win_coords = WinGetPos( 'MusicQuiz', '' )
    $coords = ControlGetPos( 'MusicQuiz', '', $Button4 )
    If IsArray( $win_coords ) And IsArray( $coords ) Then ToolTip( '<- Zum starten klicken Sie auf ''Start''.', $win_coords[0]+$coords[0]+73, $win_coords[1]+$coords[1]+30 )
    Sleep( 5000 )
    ToolTip( '' )
    EndIf
    EndIf

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

    $read = IniReadSectionNames( @ScriptDir & '\save.ini' )
    If Not @error Then
    For $i = 1 To $read[0]
    GUICtrlSetData( $Combo1, $read[$i] )
    Next
    EndIf

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

    While 1
    Sleep(100)
    WEnd

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

    Func _next()
    Local $richtig = False
    If ( BitAND( GUICtrlRead( $Radio1 ), $GUI_CHECKED ) = $GUI_CHECKED And $correctNr = 1 ) Or ( BitAND( GUICtrlRead( $Radio2 ), $GUI_CHECKED ) = $GUI_CHECKED And $correctNr = 2 ) Or ( BitAND( GUICtrlRead( $Radio3 ), $GUI_CHECKED ) = $GUI_CHECKED And $correctNr = 3 ) Then $richtig = True
    If $richtig Then
    If $curscore >= 0 Then
    $gscore += $curscore + $row
    EndIf
    GUICtrlSetData( $Label2, 'Gesamtpunktzahl: ' & $gscore )
    GUICtrlSetData( $Label3, 'richtige Antwort ! =)' )
    Else
    If $curscore < 0 Then
    $gscore += $curscore
    EndIf
    GUICtrlSetData( $Label2, 'Gesamtpunktzahl: ' & $gscore )
    GuiCtrlSetData( $Label3, 'leider falsch =(' & @CRLF &'Richtig war:' & $correctName )
    EndIf
    If $curscore = 100 And $richtig Then
    $row += 1
    Else
    $row = 0
    EndIf
    $curscore = 100
    GUICtrlSetData( $Label1, 'Akt. Frage: ' & $curscore & ' +' & $row & ' Reihenbonus' )
    $anzahl_fragen += 1
    GUICtrlSetData( $Label2, 'Gesamtpunktzahl: ' & $gscore & ' / ' & $anzahl_fragen*100 )
    _do()
    EndFunc

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

    Func _replay()
    If GUICtrlRead( $Button4 ) = 'Start' Then Return
    $curscore -= 10
    GUICtrlSetData( $Label1, 'Akt. Frage: ' & $curscore )
    _SoundSeek( $oSound, $oPosH, $oPosM, $oPosS )
    SoundSetWaveVolume ( 0 )
    _SoundPlay( $oSound )
    For $s = 1 To 100 Step 2
    SoundSetWaveVolume ( $s )
    Sleep( 20 )
    Next
    If $diff = 'easy' Then
    Sleep( 10000 )
    ElseIf $diff = 'medium' Then
    Sleep( 4000 )
    Else
    Sleep( 500 )
    EndIf
    For $s = 100 To 1 Step -2
    SoundSetWaveVolume ( $s )
    Sleep( 20 )
    Next
    _SoundStop( $oSound )
    SoundSetWaveVolume ( 100 )
    EndFunc

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

    Func _start()
    If BitAND( GUICtrlRead( $Radio4 ), $GUI_CHECKED ) = $GUI_CHECKED Then
    $diff = 'easy'
    ElseIf BitAND( GUICtrlRead( $Radio5 ), $GUI_CHECKED ) = $GUI_CHECKED Then
    $diff = 'medium'
    Else
    $diff = 'hard'
    EndIf
    GUICtrlSetData( $Button4, 'Restart' )
    $anzahl_fragen = 0
    $row = 0
    Global $gscore = 0, $curscore = 100
    GUICtrlSetData( $Label1, 'Akt. Frage: ' & $curscore )
    GUICtrlSetData( $Label2, 'Gesamtpunktzahl: ' & $gscore & ' / ' & $anzahl_fragen*100 )
    _do()
    EndFunc

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

    Func _do()
    $mp3 = IniReadSection( @ScriptDir & '\save.ini', $selected )

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

    Local $rand[3]
    Local $t[3]

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

    Do
    $rand[0] = Random( 2, $mp3[0][0], 1 )
    $prop = _property( $mp3[$rand[0]][1] )
    If IsArray( $prop ) Then
    $t[0] = $prop[1] & ' - ' & $prop[0]
    Else
    $t[0] = $prop
    EndIf
    Until $mp3[$rand[0]][1] <> ''

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

    Do
    $rand[1] = Random( 2, $mp3[0][0], 1 )
    $prop = _property( $mp3[$rand[1]][1] )
    If IsArray( $prop ) Then
    $t[1] = $prop[1] & ' - ' & $prop[0]
    Else
    $t[1] = $prop
    EndIf
    Until $mp3[$rand[1]][1] <> '' And $mp3[$rand[1]][1] <> $mp3[$rand[0]][1] And $t[1] <> $t[0]

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

    Do
    $rand[2] = Random( 2, $mp3[0][0], 1 )
    $prop = _property( $mp3[$rand[2]][1] )
    If IsArray( $prop ) Then
    $t[2] = $prop[1] & ' - ' & $prop[0]
    Else
    $t[2] = $prop
    EndIf
    Until $mp3[$rand[2]][1] <> '' And $mp3[$rand[2]][1] <> $mp3[$rand[1]][1] And $mp3[$rand[2]][1] <> $mp3[$rand[0]][1] And $t[2] <> $t[1] And $t[2] <> $t[0]

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

    Global $correctNr = Random( 1, 3, 1 )
    Global $correct = $mp3[$rand[$correctNr-1]][1]

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

    Global $correctName = $t[$correctNr-1]

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

    GUICtrlSetData( $Radio1, $t[0] )
    GUICtrlSetData( $Radio2, $t[1] )
    GUICtrlSetData( $Radio3, $t[2] )
    GUICtrlSetTip( $Radio1, $t[0] )
    GUICtrlSetTip( $Radio2, $t[1] )
    GUICtrlSetTip( $Radio3, $t[2] )
    Sleep( 1000 )
    Global $oSound = _SoundOpen( $correct )
    $oLen = _SoundLength( $oSound, 2 )
    $oPos = Int( $oLen/2)
    $oPosHrest = Mod( $oPos, 60*60*1000 )
    Global $oPosH = ($oPos-$oPosHrest)/(60*60*1000)

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

    $oPosMrest = Mod( $oPosHrest, 60*1000 )
    Global $oPosM = ($oPosHrest-$oPosMrest)/(60*1000)

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

    $oPosSrest = Mod( $oPosMrest, 1000 )
    Global $oPosS = ($oPosMrest-$oPosSrest)/(1000)

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

    _SoundSeek( $oSound, $oPosH, $oPosM, $oPosS )
    SoundSetWaveVolume ( 0 )
    _SoundPlay( $oSound, 0 )
    For $s = 1 To 100 Step 2
    SoundSetWaveVolume ( $s )
    Sleep( 20 )
    Next
    If $diff = 'easy' Then
    Sleep( 10000 )
    ElseIf $diff = 'medium' Then
    Sleep( 4000 )
    Else
    Sleep( 200 )
    EndIf
    For $s = 100 To 1 Step -2
    SoundSetWaveVolume ( $s )
    Sleep( 20 )
    Next
    _SoundStop( $oSound )
    SoundSetWaveVolume ( 100 )
    EndFunc

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

    Func _select()
    Global $selected = GUICtrlRead( $Combo1 )
    If $selected = '' Then
    MsgBox( 0, 'Error', 'Keine Liste gewählt' )
    GUICtrlSetState( $Radio1, $GUI_DISABLE )
    GUICtrlSetState( $Radio2, $GUI_DISABLE )
    GUICtrlSetState( $Radio3, $GUI_DISABLE )
    GUICtrlSetState( $Button4, $GUI_DISABLE )
    GUICtrlSetState( $Button5, $GUI_DISABLE )
    GUICtrlSetState( $Button6, $GUI_DISABLE )
    Return
    EndIf
    GUICtrlSetData( $Group2, 'Quiz - ' & $selected )
    GUICtrlSetState( $Radio1, $GUI_ENABLE )
    GUICtrlSetState( $Radio2, $GUI_ENABLE )
    GUICtrlSetState( $Radio3, $GUI_ENABLE )
    GUICtrlSetState( $Button4, $GUI_ENABLE )
    GUICtrlSetState( $Button5, $GUI_ENABLE )
    GUICtrlSetState( $Button6, $GUI_ENABLE )
    EndFunc

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

    Func _add()
    $mfolder = GUICtrlRead( $Input1 )

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

    $get = _getmp3( $mfolder )
    ;~ _ArrayDisplay( $get )
    $len = UBound( $get )
    Local $empty = True

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

    For $i = 0 To UBound( $get ) -1
    If $get[$i] <> '' Then
    $empty = False
    Else
    $len -= 1
    EndIf
    Next
    If $empty Then
    MsgBox( 16, 'Error', 'Es wurden keine *.mp3 gefunden.' )
    Return
    ElseIf $len < 4 Then
    _ArrayDisplay( $get )
    MsgBox( 16, 'Error', 'Es wurden zu wenige *.mp3 gefunden.' )
    Return
    Else
    $name = InputBox( 'Liste speichern', 'Die soeben erstellte Liste besteht aus ' & $len & ' Musikstücken,' & @CRLF & 'Sie können ihr nun einen individuellen Namen geben.', 'NewList' )
    If $name = '' Then Return

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

    If FileExists( @ScriptDir & '\save.ini' ) Then
    $check = IniReadSectionNames( @ScriptDir & '\save.ini' )
    $oldname = $name
    $n = 0
    While 1
    $n += 1
    For $ch = 1 To $check[0]
    If $name = $check[$ch] Then
    $name = $oldname & '('& $n &')'
    ContinueLoop 2
    EndIf
    Next
    ExitLoop
    WEnd
    EndIf

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

    $y = 0
    $o = UBound( $get )
    For $x = 0 To UBound( $get ) -1
    ToolTip( Int( $x/$o*100 ) & ' %' )
    If $get[$x] <> '' Then
    IniWrite( @ScriptDir & '\save.ini', $name, $y, $get[$x] )
    $y += 1
    EndIf
    Next
    ToolTip( '' )
    MsgBox( 0, 'Success', 'Die Liste "' & $name & '" wurde gespeichert' )
    GUICtrlSetData( $Combo1, $name )
    EndIf
    EndFunc

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

    Func _getmp3($root)
    If StringRight( $root, 1 ) <> '\' Then $root &= '\'
    Local $array[1]
    Local $i = 0
    FileChangeDir( $root )
    $first = FileFindFirstFile( '*.*' )
    While 1
    $next = FileFindNextFile( $first )
    If @error Then ExitLoop
    If StringRight( $next, 4 ) = '.mp3' Then
    $array[$i] = $root & $next
    $i += 1
    ReDim $array[$i+1]
    Else
    If FileExists( $root & $next ) Then
    $open = FileOpen( $root & $next, 0 )
    If $open = -1 Then
    $ret = _getmp3($root & $next)
    FileChangeDir( $root )
    For $a = 0 To UBound( $ret ) -1
    $array[$i] = $ret[$a]
    $i += 1
    ReDim $array[$i+1]
    Next
    Else
    FileClose( $open )
    EndIf
    EndIf
    EndIf
    WEnd
    Return $array
    EndFunc

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

    Func _durchsuchen()
    $folder = FileSelectFolder( 'select folder with your media', '' )
    If StringRight( $folder, 1 ) <> '\' Then $folder &= '\'
    GUICtrlSetData( $Input1, $folder )
    EndFunc
    Func _exit()
    SoundSetWaveVolume ( 100 )
    Exit
    EndFunc

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

    Func _property($path)
    Local $ordner = StringLeft( $path, StringInStr( $path, '\', 0, -1 ) )
    Local $file = StringTrimLeft( $path, StringLen( $ordner ) )
    Local $shell = ObjCreate( 'shell.application' )
    Local $shellOrdner = $shell.NameSpace( $ordner )
    Local $shellOrdnerDatei = $shellOrdner.ParseName( $file )
    Local $return_props[2]
    For $index = 1 To 99
    $re_props_type = $shellOrdner.GetDetailsOf($shellOrdner.Items, $index )
    If $re_props_type = 'Title' Or $re_props_type = 'Titel' Then $return_props[0] = $shellOrdner.GetDetailsOf( $shellOrdnerDatei, $index )
    If $re_props_type = 'Interpret' Then $return_props[1] = $shellOrdner.GetDetailsOf( $shellOrdnerDatei, $index )
    Next
    If $return_props[0] = '' Then Return $file
    Return $return_props
    EndFunc

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

    Func _radio()
    Local $diff_compare
    Switch @GUI_CtrlId
    Case $Radio4
    $diff_compare = 'easy'
    Case $Radio5
    $diff_compare = 'medium'
    Case $Radio6
    $diff_compare = 'hard'
    EndSwitch
    If $diff <> $diff_compare And GUICtrlRead( $Button4 ) <> 'Start' Then
    ToolTip( 'Um die Einstellung zu übernehmen muss die Runde neu gestartet werden.' )
    Sleep( 2500 )
    ToolTip( '' )
    EndIf
    EndFunc

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

    #Region highscore - new. Läuft hier via php, - action.php im Anhang.
    Func _highscore()
    Opt( 'GUIOnEventMode', 0 )
    $h_Form1 = GUICreate("Highscores - MusicQuiz", 347, 455, 193, 115)
    $h_ListView1 = GUICtrlCreateListView("Rang|Name|Punkte|Durchschnitt|Datum", 8, 16, 329, 361)
    $h_Input1 = GUICtrlCreateInput(@UserName, 8, 392, 105, 21)
    $h_Input2 = GUICtrlCreateInput($gscore & '/' & $anzahl_fragen*100, 120, 392, 105, 21, $ES_READONLY)
    $h_Input3 = GUICtrlCreateInput(Round( ($gscore/($anzahl_fragen*100)), 3 ), 232, 392, 105, 21, $ES_READONLY)
    $h_Button1 = GUICtrlCreateButton("Absenden", 8, 424, 105, 20, 0)
    $h_Button2 = GUICtrlCreateButton("Schließen", 232, 424, 105, 20, 0)
    $h_Button3 = GUICtrlCreateButton("Aktualisieren", 120, 424, 105, 20, 0)
    GUISetState(@SW_SHOW)
    $nMsg = $h_Button3
    While 1

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

    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    ExitLoop
    Case $h_Button1
    If GUICtrlRead( $h_Input1 ) = '' Then
    MsgBox( 48, 'Error', 'Du hast keinen Namen angegeben.' )
    ElseIf $anzahl_fragen = 0 Or $gscore = 0 Then
    MsgBox( 48, 'Error', 'Du hast noch keine Songs erraten.' )
    Else
    GUICtrlSetState( $h_Button1, $GUI_DISABLE )
    $playername = GUICtrlRead( $h_Input1 )
    $punkte = $gscore & '/' & $anzahl_fragen*100
    $date_ = @MDAY & '.' & @MON & '.' & @YEAR
    GUICtrlDelete( $h_ListView1 )
    Global $h_ListView1 = GUICtrlCreateListView("Rang|Name|Punkte|Durchschnitt|Datum", 8, 16, 329, 361)
    _INetGetSource( 'http://www.unzensiert.biz/php/action.php?do=insert&name=' & $playername & '&punkte=' & $punkte & '&schnitt=' & Round( $gscore / ($anzahl_fragen*100), 3 ) & '&date=' & $date_ )
    _refresh()
    EndIf
    Case $h_Button2
    ExitLoop
    Case $h_Button3
    GUICtrlDelete( $h_ListView1 )
    $h_ListView1 = GUICtrlCreateListView("Rang|Name|Punkte|Durchschnitt|Datum", 8, 16, 329, 361)
    $ref = _refresh()
    EndSwitch
    $nMsg = GUIGetMsg()
    WEnd
    GUIDelete( $h_Form1 )
    Opt( 'GUIOnEventMode', 1 )
    EndFunc
    Func _refresh()
    Local $rank = 1
    $ref_get = _INetGetSource( 'http://www.unzensiert.biz/php/action.php?do=list' )
    $ref_split1 = StringSplit( $ref_get, '<>', 1 )
    For $i = 1 To $ref_split1[0]
    $ref_wr = $rank & '|' & StringRight( $ref_split1[$i], StringLen( $ref_split1[$i] ) - StringInStr( $ref_split1[$i], '|', 0, 1 ) )
    GUICtrlCreateListViewItem( $ref_wr, $h_ListView1 )
    $rank += 1
    Next
    EndFunc

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

    #Region highscore - old. Kann leider nicht vom installierten ODBC-Treiber ausgehen...
    Func _highscore_old()
    Opt( 'GUIOnEventMode', 0 )
    $h_Form1 = GUICreate("Highscores - MusicQuiz", 347, 455, 193, 115)
    $h_ListView1 = GUICtrlCreateListView("Rang|Name|Punkte|Durchschnitt|Datum", 8, 16, 329, 361)
    $h_Input1 = GUICtrlCreateInput(@UserName, 8, 392, 105, 21)
    $h_Input2 = GUICtrlCreateInput($gscore & '/' & $anzahl_fragen*100, 120, 392, 105, 21, $ES_READONLY)
    $h_Input3 = GUICtrlCreateInput(Round( ($gscore/($anzahl_fragen*100)), 3 ), 232, 392, 105, 21, $ES_READONLY)
    $h_Button1 = GUICtrlCreateButton("Absenden", 8, 424, 105, 20, 0)
    $h_Button2 = GUICtrlCreateButton("Schließen", 232, 424, 105, 20, 0)
    $h_Button3 = GUICtrlCreateButton("Aktualisieren", 120, 424, 105, 20, 0)
    GUISetState(@SW_SHOW)
    $nMsg = $h_Button3
    While 1

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

    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    ExitLoop
    Case $h_Button1
    If GUICtrlRead( $h_Input1 ) = '' Then
    MsgBox( 48, 'Error', 'Du hast keinen Namen angegeben.' )
    ElseIf $anzahl_fragen = 0 Or $gscore = 0 Then
    MsgBox( 48, 'Error', 'Du hast noch garkeine Songs erraten.' )
    Else
    $playername = GUICtrlRead( $h_Input1 )
    $punkte = $gscore & '/' & $anzahl_fragen*100
    $date_ = @MDAY & '.' & @MON & '.' & @YEAR
    $connect = _MySQLConnect( 'unzensiert', '********', 'unzensiert', 'FRESHSQL.COM')
    If @error Then
    MsgBox( 16, 'Error', 'Verbindung fehlgeschlagen' )
    ExitLoop
    EndIf
    $h_qu4insert = 'INSERT INTO highscore (name,punkte,durchschnitt,date) VALUES ("' & $playername & '","' & GUICtrlRead( $h_Input2 ) & '","' & GUICtrlRead( $h_Input3 ) & '","' & $date_ & '")'
    $connect.execute( $h_qu4insert )
    $h_qu4id = 'SELECT id FROM highscore WHERE name="' & $playername & '" AND punkte="' & $punkte & '" AND date="' & $date_ & '"'
    $h_result = $connect.execute( $h_qu4id )
    $id = $h_result.Fields(0).value
    _MySqlEnd( $connect )
    GUICtrlDelete( $h_ListView1 )
    Global $h_ListView1 = GUICtrlCreateListView("Rang|Name|Punkte|Durchschnitt|Datum", 8, 16, 329, 361)
    $ind = _direkt_mysql_akt($id)
    GUICtrlSetState( $ind, $GUI_FOCUS )

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

    EndIf
    Case $h_Button2
    ExitLoop
    Case $h_Button3
    GUICtrlDelete( $h_ListView1 )
    $h_ListView1 = GUICtrlCreateListView("Rang|Name|Punkte|Durchschnitt|Datum", 8, 16, 329, 361)
    _direkt_mysql_akt()
    EndSwitch
    $nMsg = GUIGetMsg()
    WEnd
    GUIDelete( $h_Form1 )
    Opt( 'GUIOnEventMode', 1 )
    EndFunc
    Func _direkt_mysql_akt($mark=-1)
    Local $listviewindex
    $connect = _MySQLConnect( 'unzensiert', '********', 'unzensiert', 'FRESHSQL.COM')
    If @error Then
    MsgBox( 16, 'Error', 'Verbindung zur Highscore-Liste fehlgeschlagen.~error:' & @error )
    Return
    Else
    $h_qu4list = 'SELECT * FROM highscore ORDER BY durchschnitt DESC'
    $h_result = $connect.execute( $h_qu4list )
    Local $h_ind = 1
    With $h_result
    While Not .EOF
    $b = GUICtrlCreateListViewItem( $h_ind & '|' & .Fields(1).value & '|' & .Fields(2).value & '|' & .Fields(3).value & '|' & .Fields(4).value, $h_ListView1 )
    If $mark <> -1 Then
    If $mark = .Fields(0).value Then
    $listviewindex = $b;$h_ind
    EndIf
    EndIf
    .MoveNext
    $h_ind += 1
    WEnd
    EndWith
    EndIf
    _MySqlEnd( $connect )
    Return $listviewindex
    EndFunc
    #EndRegion

    [/autoit]

    Nicht so optimal fand ich, dass man das Lied immer hören musste, auch wenn man sich schon entschieden hatte. Gut hingegen sind die Gedanken bezühlich der Realisierung eines Highscores.

    Oscar:
    Bugs: Leerzeichen im Pfad gehen nicht

    Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist.

    Spoiler anzeigen
    [autoit]

    #include<WindowsConstants.au3>
    #include<Sound.au3>
    #include<Array.au3>
    #include<EditConstants.au3>
    #include<ComboConstants.au3>
    #include<GUIConstantsEx.au3>
    #include <Inet.au3>
    #include 'mysql.au3'
    #cs ----------------------------------------------------------------------------

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

    AutoIt Version: 3.2.12.1
    Author: limette

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

    Script Function:
    MusicQuiz

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

    #ce ----------------------------------------------------------------------------
    Opt( 'TrayIconDebug', 1 )
    Global $selected = '', $diff = 'medium', $oSound, $oPosH, $oPosM, $oPosS, $curscore, $gscore, $correct, $correctNr, $anzahl_fragen = 0, $correctName, $row = 0
    Global $h_ListView1
    Opt("GUIOnEventMode", 1)
    #Region ### START Koda GUI section ### Form=c:\dokumente und einstellungen\nils.nobody\desktop\musicquiz\aform1.kxf
    $Form1_1 = GUICreate("MusicQuiz", 347, 351, 195, 110)
    GUISetOnEvent( $GUI_EVENT_CLOSE, '_exit' )
    $Group1 = GUICtrlCreateGroup("Media", 8, 8, 329, 117)
    $Combo1 = GUICtrlCreateCombo("", 16, 24, 209, 25, $CBS_DROPDOWNLIST)
    GUICtrlSetTip( -1, 'Auswahl an Listen' )
    $Button1 = GUICtrlCreateButton("OK", 240, 24, 73, 20, 0)
    GUICtrlSetTip( -1, 'Bestätigt die Auswahl der Liste' )
    GUICtrlSetOnEvent( -1, '_select' )
    $Button2 = GUICtrlCreateButton("Hinzufügen", 240, 96, 73, 20, 0)
    GUICtrlSetTip( -1, 'Fügt den gewählten Ordner als Liste hinzu' )
    GUICtrlSetOnEvent( -1, '_add' )
    $Input1 = GUICtrlCreateEdit(@ScriptDir & '\', 16, 72, 209, 42, BitOR( $ES_READONLY, $WS_VSCROLL, $ES_AUTOVSCROLL ))
    $Button3 = GUICtrlCreateButton(" ... ", 240, 72, 73, 20, 0)
    GUICtrlSetTip( -1, 'Durchsuchen Sie ihren PC nach Ordnern mit *.mp3-Dateien' )
    GUICtrlSetOnEvent( -1, '_durchsuchen' )
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Radio4 = GUICtrlCreateRadio("leicht", 180, 150, 40, 17)
    GUICtrlSetOnEvent( -1, '_radio' )
    GUICtrlSetState(-1, $GUI_CHECKED)
    $Radio5 = GUICtrlCreateRadio("mittel", 230, 150, 40, 17)
    GUICtrlSetOnEvent( -1, '_radio' )
    $Radio6 = GUICtrlCreateRadio("schwer", 280, 150, 49, 17)
    GUICtrlSetOnEvent( -1, '_radio' )
    $Group2 = GUICtrlCreateGroup("Quiz", 8, 142, 329, 195)
    $Button4 = GUICtrlCreateButton("Start", 16, 168, 73, 20, 0)
    GUICtrlSetTip( -1, 'Startet das Quiz' )
    GUICtrlSetOnEvent( -1, '_start' )
    GUICtrlSetState( -1, $GUI_DISABLE )
    $Radio1 = GUICtrlCreateRadio("Antwort A", 98, 168, 231, 25)
    GUICtrlSetTip( -1, 'Antwort A' )
    GUICtrlSetState( -1, $GUI_DISABLE )
    GUICtrlSetState(-1, $GUI_CHECKED)
    $Radio2 = GUICtrlCreateRadio("Antwort B", 98, 200, 231, 25)
    GUICtrlSetTip( -1, 'Antwort B' )
    GUICtrlSetState( -1, $GUI_DISABLE )
    $Radio3 = GUICtrlCreateRadio("Antwort C", 98, 232, 231, 25)
    GUICtrlSetTip( -1, 'Antwort C' )
    GUICtrlSetState( -1, $GUI_DISABLE )
    $Button5 = GUICtrlCreateButton("Replay", 32, 192, 41, 33, 0)
    GUICtrlSetTip( -1, 'Wiederholt den Ausschnitt' )
    GUICtrlSetOnEvent( -1, '_replay' )
    GUICtrlSetState( -1, $GUI_DISABLE )
    $Label1 = GUICtrlCreateLabel("Akt. Frage:", 16, 256, 229, 17)
    $Label2 = GUICtrlCreateLabel("Gesamtpunktzahl: ", 16, 297, 230, 17)
    $Label3 = GUICtrlCreateLabel( '', 16, 270, 300, 28 )
    $Button6 = GUICtrlCreateButton("Weiter", 248, 312, 81, 20, 0)
    GUICtrlSetTip( -1, 'Weiter zum nächsten Song' )
    GUICtrlSetOnEvent( -1, '_next' )
    GUICtrlSetState( -1, $GUI_DISABLE )
    $Button_Highscore = GUICtrlCreateButton( 'Highscore', 159, 312, 81, 20, 0 )
    GUICtrlSetOnEvent( -1, '_highscore' )
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    If Not FileExists( @ScriptDir & '\save.ini' ) Then
    If MsgBox( 36, 'Info', 'Sie scheinen das Programm zum ersten Mal zu starten.' & @CRLF & 'Wünschen Sie eine kleine Einführung ?' ) = 6 Then
    WinWaitActive( 'MusicQuiz' )
    $win_coords = WinGetPos( 'MusicQuiz', '' )
    $coords = ControlGetPos( 'MusicQuiz', '', $Button3 )
    If IsArray( $win_coords ) And IsArray( $coords ) Then ToolTip( '<- Wählen Sie zunächst einen Ordner mit max. 2000 Musikstücken.', $win_coords[0]+$coords[0]+73, $win_coords[1]+$coords[1]+30 )
    While GUICtrlRead( $Input1 ) = @ScriptDir & '\'
    Sleep( 100 )
    $win_coords = WinGetPos( 'MusicQuiz', '' )
    $coords = ControlGetPos( 'MusicQuiz', '', $Button3 )
    If IsArray( $win_coords ) And IsArray( $coords ) Then ToolTip( '<- Wählen Sie zunächst einen Ordner mit max. 2000 Musikstücken.', $win_coords[0]+$coords[0]+73, $win_coords[1]+$coords[1]+30 )
    WEnd
    $win_coords = WinGetPos( 'MusicQuiz', '' )
    $coords = ControlGetPos( 'MusicQuiz', '', $Button2 )
    If IsArray( $win_coords ) And IsArray( $coords ) Then ToolTip( '<- Klicken Sie nun auf ''Hinzufügen'' um die Liste zu erstellen.', $win_coords[0]+$coords[0]+73, $win_coords[1]+$coords[1]+30 )
    Sleep( 10000 )
    $win_coords = WinGetPos( 'MusicQuiz', '' )
    $coords = ControlGetPos( 'MusicQuiz', '', $Button1 )
    If IsArray( $win_coords ) And IsArray( $coords ) Then ToolTip( '<- Wählen Sie danach die erstellte Liste aus und klicken Sie ''ok''.', $win_coords[0]+$coords[0]+73, $win_coords[1]+$coords[1]+30 )
    While BitAND( GUICtrlGetState( $Button4 ), $GUI_DISABLE ) = $GUI_DISABLE
    Sleep( 100 )
    $win_coords = WinGetPos( 'MusicQuiz', '' )
    $coords = ControlGetPos( 'MusicQuiz', '', $Button1 )
    If IsArray( $win_coords ) And IsArray( $coords ) Then ToolTip( '<- Wählen Sie danach die erstellte Liste aus und klicken Sie ''ok''.', $win_coords[0]+$coords[0]+73, $win_coords[1]+$coords[1]+30 )
    WEnd
    $win_coords = WinGetPos( 'MusicQuiz', '' )
    $coords = ControlGetPos( 'MusicQuiz', '', $Button4 )
    If IsArray( $win_coords ) And IsArray( $coords ) Then ToolTip( '<- Zum starten klicken Sie auf ''Start''.', $win_coords[0]+$coords[0]+73, $win_coords[1]+$coords[1]+30 )
    Sleep( 5000 )
    ToolTip( '' )
    EndIf
    EndIf

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

    $read = IniReadSectionNames( @ScriptDir & '\save.ini' )
    If Not @error Then
    For $i = 1 To $read[0]
    GUICtrlSetData( $Combo1, $read[$i] )
    Next
    EndIf

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

    While 1
    Sleep(100)
    WEnd

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

    Func _next()
    Local $richtig = False
    If ( BitAND( GUICtrlRead( $Radio1 ), $GUI_CHECKED ) = $GUI_CHECKED And $correctNr = 1 ) Or ( BitAND( GUICtrlRead( $Radio2 ), $GUI_CHECKED ) = $GUI_CHECKED And $correctNr = 2 ) Or ( BitAND( GUICtrlRead( $Radio3 ), $GUI_CHECKED ) = $GUI_CHECKED And $correctNr = 3 ) Then $richtig = True
    If $richtig Then
    If $curscore >= 0 Then
    $gscore += $curscore + $row
    EndIf
    GUICtrlSetData( $Label2, 'Gesamtpunktzahl: ' & $gscore )
    GUICtrlSetData( $Label3, 'richtige Antwort ! =)' )
    Else
    If $curscore < 0 Then
    $gscore += $curscore
    EndIf
    GUICtrlSetData( $Label2, 'Gesamtpunktzahl: ' & $gscore )
    GuiCtrlSetData( $Label3, 'leider falsch =(' & @CRLF &'Richtig war: ' & $correctName )
    EndIf
    If $curscore = 100 And $richtig Then
    $row += 1
    Else
    $row = 0
    EndIf
    $curscore = 100
    GUICtrlSetData( $Label1, 'Akt. Frage: ' & $curscore & ' +' & $row & ' Reihenbonus' )
    $anzahl_fragen += 1
    GUICtrlSetData( $Label2, 'Gesamtpunktzahl: ' & $gscore & ' / ' & $anzahl_fragen*100 )
    _do()
    EndFunc

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

    Func _replay()
    If GUICtrlRead( $Button4 ) = 'Start' Then Return
    $curscore -= 10
    GUICtrlSetData( $Label1, 'Akt. Frage: ' & $curscore )
    _SoundSeek( $oSound, $oPosH, $oPosM, $oPosS )
    SoundSetWaveVolume ( 0 )
    _SoundPlay( $oSound )
    For $s = 1 To 100 Step 2
    SoundSetWaveVolume ( $s )
    Sleep( 20 )
    Next
    If $diff = 'easy' Then
    Sleep( 10000 )
    ElseIf $diff = 'medium' Then
    Sleep( 4000 )
    Else
    Sleep( 500 )
    EndIf
    For $s = 100 To 1 Step -2
    SoundSetWaveVolume ( $s )
    Sleep( 20 )
    Next
    _SoundStop( $oSound )
    SoundSetWaveVolume ( 100 )
    EndFunc

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

    Func _start()
    If BitAND( GUICtrlRead( $Radio4 ), $GUI_CHECKED ) = $GUI_CHECKED Then
    $diff = 'easy'
    ElseIf BitAND( GUICtrlRead( $Radio5 ), $GUI_CHECKED ) = $GUI_CHECKED Then
    $diff = 'medium'
    Else
    $diff = 'hard'
    EndIf
    GUICtrlSetData( $Button4, 'Restart' )
    $anzahl_fragen = 0
    $row = 0
    Global $gscore = 0, $curscore = 100
    GUICtrlSetData( $Label1, 'Akt. Frage: ' & $curscore )
    GUICtrlSetData( $Label2, 'Gesamtpunktzahl: ' & $gscore & ' / ' & $anzahl_fragen*100 )
    _do()
    EndFunc

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

    Func _do()
    $mp3 = IniReadSection( @ScriptDir & '\save.ini', $selected )

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


    Local $rand[3]
    Local $t[3]

    Do
    $rand[0] = Random( 2, $mp3[0][0], 1 )
    $prop = _property( $mp3[$rand[0]][1] )
    If IsArray( $prop ) Then
    $t[0] = $prop[1] & ' - ' & $prop[0]
    Else
    $t[0] = $prop
    EndIf
    Until $mp3[$rand[0]][1] <> ''

    Do
    $rand[1] = Random( 2, $mp3[0][0], 1 )
    $prop = _property( $mp3[$rand[1]][1] )
    If IsArray( $prop ) Then
    $t[1] = $prop[1] & ' - ' & $prop[0]
    Else
    $t[1] = $prop
    EndIf
    Until $mp3[$rand[1]][1] <> '' And $mp3[$rand[1]][1] <> $mp3[$rand[0]][1] And $t[1] <> $t[0]

    Do
    $rand[2] = Random( 2, $mp3[0][0], 1 )
    $prop = _property( $mp3[$rand[2]][1] )
    If IsArray( $prop ) Then
    $t[2] = $prop[1] & ' - ' & $prop[0]
    Else
    $t[2] = $prop
    EndIf
    Until $mp3[$rand[2]][1] <> '' And $mp3[$rand[2]][1] <> $mp3[$rand[1]][1] And $mp3[$rand[2]][1] <> $mp3[$rand[0]][1] And $t[2] <> $t[1] And $t[2] <> $t[0]

    Global $correctNr = Random( 1, 3, 1 )
    Global $correct = $mp3[$rand[$correctNr-1]][1]

    Global $correctName = $t[$correctNr-1]

    GUICtrlSetData( $Radio1, $t[0] )
    GUICtrlSetData( $Radio2, $t[1] )
    GUICtrlSetData( $Radio3, $t[2] )
    GUICtrlSetTip( $Radio1, $t[0] )
    GUICtrlSetTip( $Radio2, $t[1] )
    GUICtrlSetTip( $Radio3, $t[2] )
    Sleep( 1000 )
    Global $oSound = _SoundOpen( $correct )
    $oLen = _SoundLength( $oSound, 2 )
    $oPos = Int( $oLen/2)
    $oPosHrest = Mod( $oPos, 60*60*1000 )
    Global $oPosH = ($oPos-$oPosHrest)/(60*60*1000)

    $oPosMrest = Mod( $oPosHrest, 60*1000 )
    Global $oPosM = ($oPosHrest-$oPosMrest)/(60*1000)

    $oPosSrest = Mod( $oPosMrest, 1000 )
    Global $oPosS = ($oPosMrest-$oPosSrest)/(1000)


    _SoundSeek( $oSound, $oPosH, $oPosM, $oPosS )
    SoundSetWaveVolume ( 0 )
    _SoundPlay( $oSound, 0 )
    For $s = 1 To 100 Step 2
    SoundSetWaveVolume ( $s )
    Sleep( 20 )
    Next
    If $diff = 'easy' Then
    Sleep( 10000 )
    ElseIf $diff = 'medium' Then
    Sleep( 4000 )
    Else
    Sleep( 200 )
    EndIf
    For $s = 100 To 1 Step -2
    SoundSetWaveVolume ( $s )
    Sleep( 20 )
    Next
    _SoundStop( $oSound )
    SoundSetWaveVolume ( 100 )
    EndFunc

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

    Func _select()
    Global $selected = GUICtrlRead( $Combo1 )
    If $selected = '' Then
    MsgBox( 0, 'Error', 'Keine Liste gewählt' )
    GUICtrlSetState( $Radio1, $GUI_DISABLE )
    GUICtrlSetState( $Radio2, $GUI_DISABLE )
    GUICtrlSetState( $Radio3, $GUI_DISABLE )
    GUICtrlSetState( $Button4, $GUI_DISABLE )
    GUICtrlSetState( $Button5, $GUI_DISABLE )
    GUICtrlSetState( $Button6, $GUI_DISABLE )
    Return
    EndIf
    GUICtrlSetData( $Group2, 'Quiz - ' & $selected )
    GUICtrlSetState( $Radio1, $GUI_ENABLE )
    GUICtrlSetState( $Radio2, $GUI_ENABLE )
    GUICtrlSetState( $Radio3, $GUI_ENABLE )
    GUICtrlSetState( $Button4, $GUI_ENABLE )
    GUICtrlSetState( $Button5, $GUI_ENABLE )
    GUICtrlSetState( $Button6, $GUI_ENABLE )
    EndFunc

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

    Func _add()
    $mfolder = GUICtrlRead( $Input1 )

    $get = _getmp3( $mfolder )
    ;~ _ArrayDisplay( $get )
    $len = UBound( $get )
    Local $empty = True

    For $i = 0 To UBound( $get ) -1
    If $get[$i] <> '' Then
    $empty = False
    Else
    $len -= 1
    EndIf
    Next
    If $empty Then
    MsgBox( 16, 'Error', 'Es wurden keine *.mp3 gefunden.' )
    Return
    ElseIf $len < 4 Then
    _ArrayDisplay( $get )
    MsgBox( 16, 'Error', 'Es wurden zu wenige *.mp3 gefunden.' )
    Return
    Else
    $name = InputBox( 'Liste speichern', 'Die soeben erstellte Liste besteht aus ' & $len & ' Musikstücken,' & @CRLF & 'Sie können ihr nun einen individuellen Namen geben.', 'NewList' )
    If $name = '' Then Return

    If FileExists( @ScriptDir & '\save.ini' ) Then
    $check = IniReadSectionNames( @ScriptDir & '\save.ini' )
    $oldname = $name
    $n = 0
    While 1
    $n += 1
    For $ch = 1 To $check[0]
    If $name = $check[$ch] Then
    $name = $oldname & '('& $n &')'
    ContinueLoop 2
    EndIf
    Next
    ExitLoop
    WEnd
    EndIf

    $y = 0
    $o = UBound( $get )
    For $x = 0 To UBound( $get ) -1
    ToolTip( Int( $x/$o*100 ) & ' %' )
    If $get[$x] <> '' Then
    IniWrite( @ScriptDir & '\save.ini', $name, $y, $get[$x] )
    $y += 1
    EndIf
    Next
    ToolTip( '' )
    MsgBox( 0, 'Success', 'Die Liste "' & $name & '" wurde gespeichert' )
    GUICtrlSetData( $Combo1, $name )
    EndIf
    EndFunc

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

    Func _getmp3($root)
    If StringRight( $root, 1 ) <> '\' Then $root &= '\'
    Local $array[1]
    Local $i = 0
    FileChangeDir( $root )
    $first = FileFindFirstFile( '*.*' )
    While 1
    $next = FileFindNextFile( $first )
    If @error Then ExitLoop
    If StringRight( $next, 4 ) = '.mp3' Then
    $array[$i] = $root & $next
    $i += 1
    ReDim $array[$i+1]
    Else
    If FileExists( $root & $next ) Then
    $open = FileOpen( $root & $next, 0 )
    If $open = -1 Then
    $ret = _getmp3($root & $next)
    FileChangeDir( $root )
    For $a = 0 To UBound( $ret ) -1
    $array[$i] = $ret[$a]
    $i += 1
    ReDim $array[$i+1]
    Next
    Else
    FileClose( $open )
    EndIf
    EndIf
    EndIf
    WEnd
    Return $array
    EndFunc

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

    Func _durchsuchen()
    $folder = FileSelectFolder( 'select folder with your media', '' )
    If StringRight( $folder, 1 ) <> '\' Then $folder &= '\'
    GUICtrlSetData( $Input1, $folder )
    EndFunc
    Func _exit()
    SoundSetWaveVolume ( 100 )
    Exit
    EndFunc

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

    Func _property($path)
    Local $ordner = StringLeft( $path, StringInStr( $path, '\', 0, -1 ) )
    Local $file = StringTrimLeft( $path, StringLen( $ordner ) )
    Local $shell = ObjCreate( 'shell.application' )
    Local $shellOrdner = $shell.NameSpace( $ordner )
    Local $shellOrdnerDatei = $shellOrdner.ParseName( $file )
    Local $return_props[2]
    For $index = 1 To 99
    $re_props_type = $shellOrdner.GetDetailsOf($shellOrdner.Items, $index )
    If $re_props_type = 'Title' Or $re_props_type = 'Titel' Then $return_props[0] = $shellOrdner.GetDetailsOf( $shellOrdnerDatei, $index )
    If $re_props_type = 'Interpret' Then $return_props[1] = $shellOrdner.GetDetailsOf( $shellOrdnerDatei, $index )
    Next
    If $return_props[0] = '' Then Return $file
    Return $return_props
    EndFunc

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

    Func _radio()
    Local $diff_compare
    Switch @GUI_CtrlId
    Case $Radio4
    $diff_compare = 'easy'
    Case $Radio5
    $diff_compare = 'medium'
    Case $Radio6
    $diff_compare = 'hard'
    EndSwitch
    If $diff <> $diff_compare And GUICtrlRead( $Button4 ) <> 'Start' Then
    ToolTip( 'Um die Einstellung zu übernehmen muss die Runde neu gestartet werden.' )
    Sleep( 2500 )
    ToolTip( '' )
    EndIf
    EndFunc

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

    #Region highscore - new. Läuft hier via php, - action.php im Anhang.
    Func _highscore()
    Opt( 'GUIOnEventMode', 0 )
    $h_Form1 = GUICreate("Highscores - MusicQuiz", 347, 455, 193, 115)
    $h_ListView1 = GUICtrlCreateListView("Rang|Name|Punkte|Durchschnitt|Datum", 8, 16, 329, 361)
    $h_Input1 = GUICtrlCreateInput(@UserName, 8, 392, 105, 21)
    $h_Input2 = GUICtrlCreateInput($gscore & '/' & $anzahl_fragen*100, 120, 392, 105, 21, $ES_READONLY)
    $h_Input3 = GUICtrlCreateInput(Round( ($gscore/($anzahl_fragen*100)), 3 ), 232, 392, 105, 21, $ES_READONLY)
    $h_Button1 = GUICtrlCreateButton("Absenden", 8, 424, 105, 20, 0)
    $h_Button2 = GUICtrlCreateButton("Schließen", 232, 424, 105, 20, 0)
    $h_Button3 = GUICtrlCreateButton("Aktualisieren", 120, 424, 105, 20, 0)
    GUISetState(@SW_SHOW)
    $nMsg = $h_Button3
    While 1

    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    ExitLoop
    Case $h_Button1
    If GUICtrlRead( $h_Input1 ) = '' Then
    MsgBox( 48, 'Error', 'Du hast keinen Namen angegeben.' )
    ElseIf $anzahl_fragen = 0 Or $gscore = 0 Then
    MsgBox( 48, 'Error', 'Du hast noch keine Songs erraten.' )
    Else
    GUICtrlSetState( $h_Button1, $GUI_DISABLE )
    $playername = GUICtrlRead( $h_Input1 )
    $punkte = $gscore & '/' & $anzahl_fragen*100
    $date_ = @MDAY & '.' & @MON & '.' & @YEAR
    GUICtrlDelete( $h_ListView1 )
    Global $h_ListView1 = GUICtrlCreateListView("Rang|Name|Punkte|Durchschnitt|Datum", 8, 16, 329, 361)
    _INetGetSource( 'http://www.unzensiert.biz/php/action.php?do=insert&name=' & $playername & '&punkte=' & $punkte & '&schnitt=' & Round( $gscore / ($anzahl_fragen*100), 3 ) & '&date=' & $date_ )
    _refresh()
    EndIf
    Case $h_Button2
    ExitLoop
    Case $h_Button3
    GUICtrlDelete( $h_ListView1 )
    $h_ListView1 = GUICtrlCreateListView("Rang|Name|Punkte|Durchschnitt|Datum", 8, 16, 329, 361)
    $ref = _refresh()
    EndSwitch
    $nMsg = GUIGetMsg()
    WEnd
    GUIDelete( $h_Form1 )
    Opt( 'GUIOnEventMode', 1 )
    EndFunc
    Func _refresh()
    Local $rank = 1
    $ref_get = _INetGetSource( 'http://www.unzensiert.biz/php/action.php?do=list' )
    $ref_split1 = StringSplit( $ref_get, '<>', 1 )
    For $i = 1 To $ref_split1[0]
    $ref_wr = $rank & '|' & StringRight( $ref_split1[$i], StringLen( $ref_split1[$i] ) - StringInStr( $ref_split1[$i], '|', 0, 1 ) )
    GUICtrlCreateListViewItem( $ref_wr, $h_ListView1 )
    $rank += 1
    Next
    EndFunc

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

    #Region highscore - old. Kann leider nicht vom installierten ODBC-Treiber ausgehen...
    Func _highscore_old()
    Opt( 'GUIOnEventMode', 0 )
    $h_Form1 = GUICreate("Highscores - MusicQuiz", 347, 455, 193, 115)
    $h_ListView1 = GUICtrlCreateListView("Rang|Name|Punkte|Durchschnitt|Datum", 8, 16, 329, 361)
    $h_Input1 = GUICtrlCreateInput(@UserName, 8, 392, 105, 21)
    $h_Input2 = GUICtrlCreateInput($gscore & '/' & $anzahl_fragen*100, 120, 392, 105, 21, $ES_READONLY)
    $h_Input3 = GUICtrlCreateInput(Round( ($gscore/($anzahl_fragen*100)), 3 ), 232, 392, 105, 21, $ES_READONLY)
    $h_Button1 = GUICtrlCreateButton("Absenden", 8, 424, 105, 20, 0)
    $h_Button2 = GUICtrlCreateButton("Schließen", 232, 424, 105, 20, 0)
    $h_Button3 = GUICtrlCreateButton("Aktualisieren", 120, 424, 105, 20, 0)
    GUISetState(@SW_SHOW)
    $nMsg = $h_Button3
    While 1

    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    ExitLoop
    Case $h_Button1
    If GUICtrlRead( $h_Input1 ) = '' Then
    MsgBox( 48, 'Error', 'Du hast keinen Namen angegeben.' )
    ElseIf $anzahl_fragen = 0 Or $gscore = 0 Then
    MsgBox( 48, 'Error', 'Du hast noch garkeine Songs erraten.' )
    Else
    $playername = GUICtrlRead( $h_Input1 )
    $punkte = $gscore & '/' & $anzahl_fragen*100
    $date_ = @MDAY & '.' & @MON & '.' & @YEAR
    $connect = _MySQLConnect( 'unzensiert', '********', 'unzensiert', 'FRESHSQL.COM')
    If @error Then
    MsgBox( 16, 'Error', 'Verbindung fehlgeschlagen' )
    ExitLoop
    EndIf
    $h_qu4insert = 'INSERT INTO highscore (name,punkte,durchschnitt,date) VALUES ("' & $playername & '","' & GUICtrlRead( $h_Input2 ) & '","' & GUICtrlRead( $h_Input3 ) & '","' & $date_ & '")'
    $connect.execute( $h_qu4insert )
    $h_qu4id = 'SELECT id FROM highscore WHERE name="' & $playername & '" AND punkte="' & $punkte & '" AND date="' & $date_ & '"'
    $h_result = $connect.execute( $h_qu4id )
    $id = $h_result.Fields(0).value
    _MySqlEnd( $connect )
    GUICtrlDelete( $h_ListView1 )
    Global $h_ListView1 = GUICtrlCreateListView("Rang|Name|Punkte|Durchschnitt|Datum", 8, 16, 329, 361)
    $ind = _direkt_mysql_akt($id)
    GUICtrlSetState( $ind, $GUI_FOCUS )

    EndIf
    Case $h_Button2
    ExitLoop
    Case $h_Button3
    GUICtrlDelete( $h_ListView1 )
    $h_ListView1 = GUICtrlCreateListView("Rang|Name|Punkte|Durchschnitt|Datum", 8, 16, 329, 361)
    _direkt_mysql_akt()
    EndSwitch
    $nMsg = GUIGetMsg()
    WEnd
    GUIDelete( $h_Form1 )
    Opt( 'GUIOnEventMode', 1 )
    EndFunc
    Func _direkt_mysql_akt($mark=-1)
    Local $listviewindex
    $connect = _MySQLConnect( 'unzensiert', '********', 'unzensiert', 'FRESHSQL.COM')
    If @error Then
    MsgBox( 16, 'Error', 'Verbindung zur Highscore-Liste fehlgeschlagen.~error:' & @error )
    Return
    Else
    $h_qu4list = 'SELECT * FROM highscore ORDER BY durchschnitt DESC'
    $h_result = $connect.execute( $h_qu4list )
    Local $h_ind = 1
    With $h_result
    While Not .EOF
    $b = GUICtrlCreateListViewItem( $h_ind & '|' & .Fields(1).value & '|' & .Fields(2).value & '|' & .Fields(3).value & '|' & .Fields(4).value, $h_ListView1 )
    If $mark <> -1 Then
    If $mark = .Fields(0).value Then
    $listviewindex = $b;$h_ind
    EndIf
    EndIf
    .MoveNext
    $h_ind += 1
    WEnd
    EndWith
    EndIf
    _MySqlEnd( $connect )
    Return $listviewindex
    EndFunc
    #EndRegion

    [/autoit]

    Sehr schöne Realisierung. Aufgabe sehr ausführlich und mit vielen originellen Details. Die realisierung der Playlist und das Design sind sehr gelungen.


    Gewinner im August ist:
    Oscar
    Grund dafür ist die ausführliche Bearbeitung der Aufgabe. Grafisch überzeugend und auch funktionell. Ein Programm welches man wirklich gut, einfach mal zwischendurch, nutzen kann. Die Probleme mit dem Leerzeichen im Pfad find ich nicht so tragisch denn Hauptsache ist ja das das Programm an sich funktioniert.

    Danke an alle Andere - butte nicht enttäuscht sein und aufgeben, vlt. klappts das nächste mal
    Walle

  • µit - August

    • Waluev
    • 27. August 2008 um 20:18

    sry Leute wird heute nix...ich habs zeitlich nicht geschafft. Morgen bin ich ab um 3 zu Hause, da wert ich es aus, versprochen!!!

    Walle

  • µit - August

    • Waluev
    • 22. August 2008 um 23:41

    So hiermit ist µIt August ofiziell beendet. Auswertung bis spätestens Mittwoch.

    Walle

  • µit - August

    • Waluev
    • 22. August 2008 um 18:17

    auf auf, noch sind es paar Minuten *gg*

    Walle

  • µit - August

    • Waluev
    • 19. August 2008 um 10:31

    schau dir einfach mal von den anderen µ-It Aufgaben die Auswertungen an.


    WAlle

  • µit - August

    • Waluev
    • 18. August 2008 um 15:09

    Also die Aufgabe für nächsten Monat steht schon...sie wird extremn anspruchsvoll und fverlangt absolut keine grafischen spielerei sondern knallharte strukturierung und optimierung von daten...sie wird so schwer, dass es für diese Aufgabe einen zweiten Orga geben wird, der mehr ahnung hat als ich ;)

    Also seit gespannt, aber erstmal august beenden...sieht ja bisher garnich so schlecht aus, was abgeliefert wurde.


    walle

  • µit - August

    • Waluev
    • 17. August 2008 um 22:27

    bin ich ja mal gespannt^^

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™