Ich möchte ein Script erstellen, wo einfach ein Fenster mit einer Überschrift (der Frage) und 4 Radiobuttons (die Antworten) erscheint.
Klingt sehr einfach, dennoch krieg ichs nich hin(obwohl ich mit AutoIT Bots scripte, derbst peinlich).
Hinzu kommt das ich nichtmal den Fehler finde.
Zusätzlich ist zu beachten, dass ich mit dem #include Befehl eine Datei "includen" will, die die Fragen enthält. Die Variablen für Frage / Antworten werden dort definiert.
Hauptproblem:
Wie gesagt, das mit den Radiobuttons will nicht so wirklich hinhaun.
Script (Quiz, Hauptscript):
PHP Code:
; Script Start - Add your code below here
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <fragen.au3>
$counter=0
While $counter <> 50
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Frage", 703, 170, 193, 125)
$fragegui = GUICtrlCreateLabel($frage[$counter], 24, 8)
GUICtrlSetFont(-1, 16, 400, 0, "MS Sans Serif")
$antwort1 = GUICtrlCreateRadio($mantwort1[$counter], 24, 72)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$antwort2 = GUICtrlCreateRadio($mantwort2[$counter], 24, 96)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$antwort3 = GUICtrlCreateRadio($mantwort3[$counter], 24, 120)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$antwort4 = GUICtrlCreateRadio($mantwort4[$counter], 24, 144)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Button1 = GUICtrlCreateButton("Absenden", 584, 8, 113, 153)
GUICtrlSetFont(-1, 17, 400, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$msg=GuiGetMsg()
Switch $msg
Case $msg == $Button1
If GuictrlRead($antwort1) == $GUI_CHECKED Then
If $a == "richtig" Then
MsgBox(0, "Richtig!", "Das war richtig, Glückwunsch!")
ExitLoop
ElseIf $a == "falsch" Then
MsgBox(0, "Falsch!", "Das war leider falsch")
Exit
EndIf
EndIf
If GuictrlRead($antwort2) == $GUI_CHECKED Then
If $b == "richtig" Then
MsgBox(0, "Richtig!", "Das war richtig, Glückwunsch!")
ExitLoop
ElseIf $b == "falsch" Then
MsgBox(0, "Falsch!", "Das war leider falsch")
Exit
EndIf
EndIf
If GuictrlRead($antwort3) == $GUI_CHECKED Then
If $c == "richtig" Then
MsgBox(0, "Richtig!", "Das war richtig, Glückwunsch!")
ExitLoop
ElseIf $c == "falsch" Then
MsgBox(0, "Falsch!", "Das war leider falsch")
Exit
EndIf
EndIf
If GuictrlRead($antwort4) == $GUI_CHECKED Then
If $d == "richtig" Then
MsgBox(0, "Richtig!", "Das war richtig, Glückwunsch!")
ExitLoop
ElseIf $d == "falsch" Then
MsgBox(0, "Falsch!", "Das war leider falsch")
Exit
EndIf
EndIf
EndSwitch
WEnd
$counter=$counter+1
WEnd
MsgBox(0, "Winner", "Nice one")
PHP Code:
; Script Start - Add your code below here
Global $frage[50], $mantwort1[50], $mantwort2[50], $mantwort3[50], $mantwort4[50], $a[50], $b[50], $c[50], $d[50]
$frage[0]="Mal gucken ob es geht, tut es das?"
$mantwort1[0]="Nene net wirklich"
$mantwort2[0]="Jojo fix"
$mantwort3[0]="Nein"
$mantwort4[0]="Nope2"
$a[0]="falsch"
$b[0]="richtig"
$c[0]="falsch"
$d[0]="falsch"
$frage[1]="Mal gucken ob es geht, tut es das, zweimal?!?"
$mantwort1[1]="Nene net wirklich"
$mantwort2[1]="Jojo fix"
$mantwort3[1]="Nein"
$mantwort4[1]="Nope"
$a[1]="falsch"
$b[1]="richtig"
$c[1]="falsch"
$d[1]="falsch"
Hoffe mir kann jemand helfen, so schwer kann das doch nicht sein.
Achja, der Absenden Button muss nicht miteingebaut werden ( das haut sowieso überhaupt nicht hin )
MfG Zim






