Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 17:36

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Hilfe von Nöten] Quiz Script

Discussion on [Hilfe von Nöten] Quiz Script within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Mar 2009
Posts: 29
Received Thanks: 3
[Hilfe von Nöten] Quiz Script

Hi Leute.

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"703170193125)
$fragegui GUICtrlCreateLabel($frage[$counter], 248)
GUICtrlSetFont(-1164000"MS Sans Serif")
$antwort1 GUICtrlCreateRadio($mantwort1[$counter], 2472)
GUICtrlSetFont(-1124000"MS Sans Serif")
$antwort2 GUICtrlCreateRadio($mantwort2[$counter], 2496)
GUICtrlSetFont(-1124000"MS Sans Serif")
$antwort3 GUICtrlCreateRadio($mantwort3[$counter], 24120)
GUICtrlSetFont(-1124000"MS Sans Serif")
$antwort4 GUICtrlCreateRadio($mantwort4[$counter], 24144)
GUICtrlSetFont(-1124000"MS Sans Serif")
$Button1 GUICtrlCreateButton("Absenden"5848113153)
GUICtrlSetFont(-1174000"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"
fragen.au3 (Enthält Variablen / Fragen) :

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" 
Ich suche jetzt schon seit 2 Stunden nach einer möglichen Lösung und hab keine gefunden.
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
SuperZim is offline  
Old 06/12/2010, 00:30   #2
 
elite*gold: 0
Join Date: Aug 2009
Posts: 74
Received Thanks: 13
Ähh mach halt einfach

Case $Radio1
Msgbox( Richtig )

oder
if $radio1 = 1 then
MsgBox(Richtig)
Else
Msgbox(Falsch)

stell dir morgen mal ein ganzes Script mit KOda rein
sorry aber bin zu müde um Msgbox Parameter auszuschreibn
sido47 is offline  
Old 06/12/2010, 08:33   #3
 
elite*gold: 100
Join Date: Oct 2007
Posts: 738
Received Thanks: 485
Schau dir mal dein $a / $b / $c / $d in der Msg While Schleife an...
Da fehlt
Code:
[$counter]
und es muss
Code:
Case $Button1
Sonst funktioniert doch alles....
ddl is offline  
Thanks
1 User
Old 06/12/2010, 10:02   #4
 
elite*gold: 0
Join Date: Aug 2009
Posts: 74
Received Thanks: 13
Oh den Fehler mit dem $counter hab ich garned gesehn^^

Hier mal ein Quiz

Quote:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Quiz Window 1/3", 241, 186, 316, 218)
$Label1 = GUICtrlCreateLabel("Wie heisst deine Mutter", 16, 8, 115, 17)
$Radio1 = GUICtrlCreateRadio("Günther", 24, 56, 81, 17)
$Radio2 = GUICtrlCreateRadio("Hildegard", 24, 88, 97, 25)
$Radio3 = GUICtrlCreateRadio("Olaf", 152, 48, 57, 25)
$Radio4 = GUICtrlCreateRadio("Dieter", 152, 88, 73, 25)
$Button1 = GUICtrlCreateButton("LÖSUNG", 80, 136, 81, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

Case $Button1
if GUICtrlRead($Radio2) = 1 then
MsgBox(0,"RICHTIG","Super woher weisst du das blos")
Else
MsgBox(0,"FLASCH","Haha ist deine Mutter ein Mann ?")
EndIf
Exit
EndSwitch
WEnd
sido47 is offline  
Thanks
1 User
Old 06/12/2010, 10:07   #5
 
HardCore.1337's Avatar
 
elite*gold: 1
Join Date: Feb 2009
Posts: 1,726
Received Thanks: 729
naja, ist aber nicht sehr elegant.
Das merkst du vor allem wenn du mehr als eine Frage stellst
HardCore.1337 is offline  
Old 06/20/2010, 13:09   #6
 
elite*gold: 0
Join Date: Mar 2009
Posts: 29
Received Thanks: 3
Vielen Dank für die Antworten.

Ein großes Danke für das Scripten eines neues Scripts und ebenfalls für den finden des Fehlers.

Dass ich in meinem Script nur etwas übersehen habe, aber es doch hinbekommen habe find ich natürlich bombastisch xD

Vielen Dank, hat sich somit alles geklärt

MfG Zim
SuperZim is offline  
Reply


Similar Threads Similar Threads
WoW Lua Script Hilfe
11/20/2010 - World of Warcraft - 3 Replies
Hallo ich habe da mal ne frage und zwar habe ich ein teleporter Npc Und den will ich nun eine funktion hinzufügen das er wen der Spieler dadrauf klickt MaxWeapon skill griegt Es sieht im mom so aus das er nichts macht^^ auser porten und er soll dan den spieler mittels Gm Comando : .char advanceallskills 99999 die waffenfertikeiten auf max setzen blos das macht er nicht^^ (man ist der Faul) Joke^^ davor hatte ich noch das drin
Script Hilfe
07/19/2010 - AutoIt - 4 Replies
Hallo, schreibe grad ein kleines Script: Koda: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3>
PHP Script Hilfe
06/16/2010 - Web Development - 1 Replies
Hi, weiß wer was ich falsch mache? <html> <head> <title>Geschenk</title> </head> <body> <form> <textarea name=Putin rows=1 cols=20></textarea> <p>
Hilfe !!!! (Script)
05/18/2010 - Metin2 - 1 Replies
Hallo, Könnt ihr mir Bitte Helfen ich hab ein script gemacht und hatte ein Problem wurde aber gelöscht jetzt is wieder ein Problem da ich bitte euch mir zu helfen ! -Ich hab ein script und will wiesen wie ich in dieses script was einbauen kann das der oder die denn script startet und dann keine acctionenen mit der maus und mit der Tastatur machen kann so lange der script leuft pls Help me.:confused:
[Hilfe] Log In Script
08/03/2009 - AutoIt - 9 Replies
Hey Ja nochmal ich ^^ Wollte fragen ob sich jemand mal dieses script angucken kann und mir sagen kann warum das ab nem gewissen punkt nicht das macht was es soll ... Hab alles mögliche probiert schon seit 4std -_- Weiß nicht mehr was ich machen soll =X



All times are GMT +1. The time now is 17:38.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.