Ich will also dass wenn ich einen Button drücke, dass dann das Input selektiert wird also mit selektieren mein ich so wie wenn ich auf den Input drücke!
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$i = 0
$Form1 = GUICreate("SpeedWriteGame", 615, 129, 192, 124)
$Input1 = GUICtrlCreateInput("", 56, 8, 545, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
$Label1 = GUICtrlCreateLabel("Eingabe:", 8, 8, 46, 17)
$Label2 = GUICtrlCreateLabel("", 8, 40, 596, 36)
GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")
GUICtrlSetState(-1, $GUI_DISABLE)
$Button1 = GUICtrlCreateButton("Pro", 8, 88, 83, 33)
GUICtrlSetFont(-1, 16, 400, 0, "MS Sans Serif")
$Button2 = GUICtrlCreateButton("Noob", 96, 88, 75, 33)
GUICtrlSetFont(-1, 16, 400, 0, "MS Sans Serif")
$Label3 = GUICtrlCreateLabel("Status:", 496, 104, 37, 17)
$Label4 = GUICtrlCreateLabel("", 536, 104, 70, 17)
$Label5 = GUICtrlCreateLabel("Punkte: " & $i ,546, 64, 70, 17)
$Progress1 = GUICtrlCreateProgress(176, 88, 313, 33)
AdlibRegister("_Status",250)
AdlibRegister("_Wort",100)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$Zufall = Random(1,44,1)
$Wort = ""
Func _Wort()
$Zufall = Random(1,44,1)
If $Zufall = 1 Then
$Wort = "Ausgezeichnet"
ElseIf $Zufall = 2 Then
$Wort = "Autofahrer"
ElseIf $Zufall = 3 Then
$Wort = "Elektrizität"
ElseIf $Zufall = 4 Then
$Wort = "Wanduhr"
ElseIf $Zufall = 5 Then
$Wort = "Silvester"
ElseIf $Zufall = 6 Then
$Wort = "Haustelefon"
ElseIf $Zufall = 7 Then
$Wort = "Mobiltelefon"
ElseIf $Zufall = 8 Then
$Wort = "Computer"
ElseIf $Zufall = 9 Then
$Wort = "Fernseher"
ElseIf $Zufall = 10 Then
$Wort = "Brille"
ElseIf $Zufall = 11 Then
$Wort = "Rakete"
ElseIf $Zufall = 12 Then
$Wort = "Bombe"
ElseIf $Zufall = 13 Then
$Wort = "Benzin"
ElseIf $Zufall = 14 Then
$Wort = "Greenscreen"
ElseIf $Zufall = 15 Then
$Wort = "Gewicht"
ElseIf $Zufall = 16 Then
$Wort = "Haus"
ElseIf $Zufall = 17 Then
$Wort = "Tisch"
ElseIf $Zufall = 18 Then
$Wort = "Stuhl"
ElseIf $Zufall = 19 Then
$Wort = "Wand"
ElseIf $Zufall = 20 Then
$Wort = "Fahrrad"
ElseIf $Zufall = 21 Then
$Wort = "Boxer"
ElseIf $Zufall = 22 Then
$Wort = "Hund"
ElseIf $Zufall = 23 Then
$Wort = "Katze"
ElseIf $Zufall = 24 Then
$Wort = "Radio"
ElseIf $Zufall = 25 Then
$Wort = "Antenne"
ElseIf $Zufall = 26 Then
$Wort = "Bugatti"
ElseIf $Zufall = 27 Then
$Wort = "UASFNUI"
ElseIf $Zufall = 28 Then
$Wort = "INASFIN"
ElseIf $Zufall = 29 Then
$Wort = "ASFINUE"
ElseIf $Zufall = 30 Then
$Wort = "IANVASI"
ElseIf $Zufall = 31 Then
$Wort = "YKXCNA"
ElseIf $Zufall = 32 Then
$Wort = "OJFNEU"
ElseIf $Zufall = 33 Then
$Wort = "OAJSNA"
ElseIf $Zufall = 34 Then
$Wort = "ASNCIAS"
ElseIf $Zufall = 35 Then
$Wort = "KBOSAN"
ElseIf $Zufall = 36 Then
$Wort = "AIXNIANS"
ElseIf $Zufall = 37 Then
$Wort = "IOSJGFAF"
ElseIf $Zufall = 38 Then
$Wort = "INSADASC"
ElseIf $Zufall = 39 Then
$Wort = "UIENFAS"
ElseIf $Zufall = 40 Then
$Wort = "ICNAISN"
ElseIf $Zufall = 41 Then
$Wort = "ASINAIE"
ElseIf $Zufall = 42 Then
$Wort = "IASNVAI"
ElseIf $Zufall = 43 Then
$Wort = "IENFIAS"
ElseIf $Zufall = 44 Then
$Wort = "VNAISVA"
EndIf
EndFunc
$Status = 0
[/autoit] [autoit][/autoit] [autoit]While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
AdlibUnRegister("_ZeitN")
GUICtrlSetData($Progress1,100)
GUICtrlSetData($Input1,"")
$Status = 1
GUICtrlSetData($Label2, $Wort)
GUICtrlSetState($Input1, $GUI_ENABLE)
AdlibRegister("_Zeit",25)
Case $Button2
AdlibUnRegister("_Zeit")
GUICtrlSetData($Progress1,100)
GUICtrlSetData($Input1,"")
$Status = 1
GUICtrlSetData($Label2, $Wort)
GUICtrlSetState($Input1, $GUI_ENABLE)
AdlibRegister("_ZeitN",100)
EndSwitch
WEnd
Func _ZeitN()
GUICtrlSetData($Progress1,GUICtrlRead($Progress1) - 1)
If GUICtrlRead($Progress1) = 0 And $Status = 1 And GUICtrlRead($Input1) = GUICtrlRead($Label2) Then
GUICtrlSetData($Label2, $Wort)
GUICtrlSetData($Progress1,100)
GUICtrlSetData($Input1,"")
$i = $i + 1
GUICtrlSetData($Label5,"Punkte: " & $i)
ElseIf GUICtrlRead($Progress1) = 0 And $Status = 1 Then
$Status = 0
$i = 0
GUICtrlSetData($Label5,"Punkte: " & $i)
EndIf
EndFunc
Func _Zeit()
GUICtrlSetData($Progress1,GUICtrlRead($Progress1) - 1)
If GUICtrlRead($Progress1) = 0 And $Status = 1 And GUICtrlRead($Input1) = GUICtrlRead($Label2) Then
GUICtrlSetData($Label2, $Wort)
GUICtrlSetData($Progress1,100)
GUICtrlSetData($Input1,"")
$i = $i + Random(1,3,1)
GUICtrlSetData($Label5,"Punkte: " & $i)
ElseIf GUICtrlRead($Progress1) = 0 And $Status = 1 Then
$Status = 0
$i = 0
GUICtrlSetData($Label5,"Punkte: " & $i)
EndIf
EndFunc
Func _Status()
If $Status = 0 Then
GUICtrlSetData($Label4, "Nicht aktiv!")
ElseIf $Status = 1 And GUICtrlRead($Input1) = GUICtrlRead($Label2) Then
GUICtrlSetData($Label4, "Korrekt!")
ElseIf $Status = 1 Then
GUICtrlSetData($Label4, "Falsch!")
EndIf
EndFunc