Fingertrainer

  • hab ein propgramm geschrieben wo man schnell das eintippen soll was in der inputbox steht dazu hat man 30 sekunden zeit ein fehler zählt als 2 minus punkte wen man es ohne fehler schafft werden die punkte verdoppelt

    neues update: [url='http://www.megaupload.com/?d=QF1TAVMC'[/url]

    Einmal editiert, zuletzt von manuel6000 (23. Januar 2011 um 12:32)

  • Eine nette Idee aber ich würde es mit einem TimerInit() Timer machen.
    So gehts ohne externen Timer:

    Spoiler anzeigen
    [autoit]


    $e = 0
    $d = 0
    $c = 1
    $r = 0
    $f = 0
    $iEnde = 0
    $hTimer = TimerInit()
    AdlibRegister("TimerCheck", 50)

    [/autoit]

    While $e < 2
    $e = $e + 0
    $e = 1
    $a = (Chr(Random(97, 122, 1)))
    $b = (Chr(Random(97, 122, 1)))
    $c = 1


    If $a = "w" And $b = "w" Then
    If $d = 0 Then
    $Inputbox = InputBox(" ", "!")
    If $Inputbox = "!" Then
    $r = $r + 1
    Else
    $f = $f + 1
    EndIf
    EndIf

    If $d = 1 Then
    $Inputbox = InputBox(" ", '"')
    If $Inputbox = '"' Then
    $r = $r + 1
    Else
    $f = $f + 1
    EndIf
    EndIf


    If $d = 2 Then
    $Inputbox = InputBox(" ", '§')
    If $Inputbox = "§" Then
    $r = $r + 1
    Else
    $f = $f + 1
    EndIf
    EndIf

    If $d = 3 Then
    $Inputbox = InputBox(" ", '

    [autoit]

    )
    If $Inputbox = "$" Then
    $r = $r + 1
    Else
    $f = $f + 1
    EndIf
    EndIf

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

    If $d = 4 Then
    $Inputbox = InputBox(" ", "%")
    If $Inputbox = "%" Then
    $r = $r + 1
    Else
    $f = $f + 1
    EndIf
    EndIf

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

    If $d = 5 Then
    $Inputbox = InputBox("", "&")
    If $Inputbox = "&" Then
    $r = $r + 1
    Else
    $f = $f + 1
    EndIf
    EndIf

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

    If $d = 6 Then
    $Inputbox = InputBox(" ", "/")
    If $Inputbox = "/" Then
    $r = $r + 1
    Else
    $f = $f + 1
    EndIf
    EndIf
    If $d = 7 Then
    $Inputbox = InputBox(" ", "(")
    If $Inputbox = "(" Then
    $r = $r + 1
    Else
    $f = $f + 1
    EndIf
    EndIf

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

    If $d = 8 Then
    $Inputbox = InputBox(" ", ")")
    If $Inputbox = ")" Then
    $r = $r + 1
    Else
    $f = $f + 1
    EndIf
    EndIf

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

    If $d = 8 Then
    $Inputbox = InputBox(" ", "?")
    If $Inputbox = "?" Then
    $r = $r + 1
    Else
    $f = $f + 1
    EndIf
    EndIf

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

    If $d = 9 Then
    $Inputbox = InputBox(" ", "=")
    If $Inputbox = "=" Then
    $r = $r + 1
    Else
    $f = $f + 1
    EndIf
    EndIf

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

    If $d = 10 Then
    $Inputbox = InputBox(" ", "?")
    If $Inputbox = "?" Then
    $r = $r + 1
    Else
    $f = $f + 1
    EndIf
    EndIf

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

    If $d = 11 Then
    $Inputbox = InputBox(" ", "1")
    If $Inputbox = "1" Then
    $r = $r + 1
    Else
    $f = $f + 1
    EndIf
    EndIf

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

    If $d = 12 Then
    $Inputbox = InputBox(" ", "2")
    If $Inputbox = "2" Then
    $r = $r + 1
    Else
    $f = $f + 1
    EndIf
    EndIf

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

    If $d = 13 Then
    $Inputbox = InputBox(" ", "3")
    If $Inputbox = "3" Then
    $r = $r + 1
    Else
    $f = $f + 1
    EndIf
    EndIf
    If $d = 14 Then
    $Inputbox = InputBox(" ", "4")
    If $Inputbox = "4" Then
    $r = $r + 1
    Else
    $f = $f + 1
    EndIf
    EndIf
    If $d = 15 Then
    $Inputbox = InputBox(" ", "5")
    If $Inputbox = "5" Then
    $r = $r + 1
    Else
    $f = $f + 1
    EndIf
    EndIf
    If $d = 16 Then
    $Inputbox = InputBox(" ", "6")

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

    If $Inputbox = "6" Then
    $r = $r + 1
    Else
    $f = $f + 1
    EndIf
    EndIf

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

    If $d = 17 Then
    $Inputbox = InputBox(" ", "7")
    If $Inputbox = "7" Then
    $r = $r + 1
    Else
    $f = $f + 1
    EndIf
    EndIf

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

    If $d = 18 Then
    $Inputbox = InputBox(" ", "8")
    If $Inputbox = "8" Then
    $r = $r + 1
    Else
    $f = $f + 1
    EndIf
    EndIf

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

    If $d = 19 Then
    $Inputbox = InputBox(" ", "9")
    If $Inputbox = "9" Then
    $r = $r + 1
    Else
    $f = $f + 1
    EndIf
    EndIf
    If $d = 20 Then
    $Inputbox = InputBox(" ", "0")
    If $Inputbox = "0" Then
    $r = $r + 1
    Else
    $f = $f + 1
    EndIf
    EndIf

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

    Else
    If $d = 21 Then
    $d = -1
    EndIf
    $d = $d + $c
    EndIf
    WEnd

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

    Func TimerCheck()
    If TimerDiff($hTimer) > 30000 And Not $iEnde Then
    _Ende()
    Global $iEnde = 1
    EndIf
    EndFunc ;==>TimerCheck

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

    Func _Ende()
    If $e = 1 Then
    $e = 0
    $Grammatik1 = ""
    $Grammatik2 = ""
    $Grammatik3 = ""
    $Grammatik4 = ""
    $Grammatik5 = ""
    $Punkte = $r - $f - $f
    If $f = 0 Then $Punkte = $r + $r
    If $r = 1 Or $r = -1 Then $Grammatik1 = "s"
    If Not ($Punkte = 1) And Not ($Punkte = -1) Then
    $Grammatik2 = "e"
    $Grammatik3 = "sind"
    Else
    $Grammatik3 = "ist"
    EndIf
    If Not ($f = 1) Then
    $Grammatik5 = "e"
    Else
    $Grammatik4 = "s"
    EndIf
    MsgBox(0, "", $r & " Richtige" & $Grammatik1 & " und " & $f & " Falsche" & $Grammatik4 & " Ergebniss" & $Grammatik5 & ". Das " & $Grammatik3 & " " & $Punkte & " Punkt" & $Grammatik2 & ".")
    Exit
    EndIf
    EndFunc ;==>_Ende

    [/autoit]

    [/spoiler]

  • Nette Idee,
    auch wenn die Umsetzung noch nicht optimal ist.
    Das Script lässt sich noch um mindestens 80% kürzen ;-), indem du entweder mit Arrays arbeitest oder alles in eine kleine Schleife packst.
    Außerdem wäre eine Gui ansprechender und du könntest ohne Bestätigung den Tippvorgang mit GuiCtrlRead prüfen, denn so wie's jetzt ist hat ein Nutzer die Möglichkeit seine Eingabe vor der Bestätigung zu Prüfen und zu Korrigieren.
    Wie der Poster vor mir gesagt hat, arbeite mit Timern, um alles in ein Script packen zu können.
    Außerdem sind die Zeichenketten die man eingeben muss, so finde ich, zu kurz.

    Gekürzt
    [autoit]


    $iPunkte = 0
    $Timer = TimerInit()

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

    While TimerDiff($Timer) < 30000
    $sString = Chr(Random(96, 121, 1))
    If InputBox("Eingabe", "Punkte: " & $iPunkte & @CRLF & @CRLF & $sString) = $sString Then
    $iPunkte += 1
    Else
    $iPunkte -= 1
    EndIf
    WEnd
    MsgBox(0, "", "Du hast in 30s " & $iPunkte & " Punkte erlangt!")

    [/autoit]

    Für dein erstes Script, dass du hier postest, bestimmt eine gute kleine Übung mit Abfragen und Schleifen umzugehen;
    ich würde dir jetzt empfehlen dir mal die Gui(funktionen) anzusehen!

    5 Mal editiert, zuletzt von stayawayknight (9. Januar 2011 um 13:16)

  • aber das ist doch praktischer wen man es noch ausbesern kann und immerhin kostet das zeit

  • gibt eine neue version link steht oben schon wer die neue version getestet?

    Einmal editiert, zuletzt von manuel6000 (23. Januar 2011 um 14:47)