(Frage)Priodensystem Lehren mit AutoIt

01/16/2011 20:33 Tmb#1
Hallo Leute Ich Hab ein Problem mit mein Script
also autoit nerft weil was mit den ElseIf nicht stimmt keine anung was
Hier Mein Script
ich wollte ein Programm schreiben wo mit man Das Periodensystem Lehrnen kann wahr bin Nur bist Erste Hauptgrube gekommen
Danke schon mal an alle die mir zu helfen versuchen
01/16/2011 21:01 puzzlr#2
entweder du machst die ganzen Elses zu If oder du schreibst nicht nach jedem If ein EndIf..
01/16/2011 21:17 PenGuin :O#3
Oder du benutzt einfach Switch.
01/16/2011 21:23 Tmb#4
Quote:
Originally Posted by u_failed View Post
entweder du machst die ganzen Elses zu If oder du schreibst nicht nach jedem If ein EndIf..
hab das mit alle Elsesif zu if versucht ding schon aber zeigte alles auser wasserstoff falsche und hab auch mit Endif alle Elseif haben ein Endif bis auf das letzte wie es sein soll naja bin off hoffe das ich morgen one Fehlern weiter schreiben kann Danke an alle die mir zu helfen versuchen
01/17/2011 08:18 .2good4you111#5
PHP Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("P.S.Bot"191112192124)
GUISetBkColor(0xC0C0C0)
$Input1 GUICtrlCreateInput(""323212121)
$Button1 GUICtrlCreateButton("Start"56567525$WS_GROUP)
$Label1 GUICtrlCreateLabel("Deine Antwort ist :"009017)
$Label2 GUICtrlCreateLabel("????"9607028)
GUICtrlSetFont(-1188000"Sixties")
GUICtrlSetColor(-10x0000FF)
$Button2 GUICtrlCreateButton("Exit"56807525$WS_GROUP)
$Label3 GUICtrlCreateLabel("By T.M.B"136885420)
GUICtrlSetFont(-1108004"Myriad Pro")
GUICtrlSetColor(-10x800000)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg 
GUIGetMsg()
Switch 
$nMsg
Case $GUI_EVENT_CLOSE
Exit
Case 
$Button1
_Start1
()
Case 
$Button2
Exit 0
EndSwitch
WEnd
;Notiz:mit Do Schleife ein limet der Fehler einbauen Notiz2:bessere Gui
#cs
ElseIf GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
#ce
Func _Start1()

If 
GUICtrlRead($Input1) = "Wasserstoff" Then
GUICtrlSetData 
($Label2,"Richtig")
ElseIf 
GUICtrlRead($Input1) = "Lithium" Then
GUICtrlSetData 
($Label2,"Richtig")
ElseIf 
GUICtrlRead($Input1) = "Natrium" Then
GUICtrlSetData 
($Label2,"Richtig")
ElseIf 
GUICtrlRead($Input1) = "Kalium" Then
GUICtrlSetData 
($Label2,"Richtig")
ElseIf 
GUICtrlRead($Input1) = "Rubidium" Then
GUICtrlSetData 
($Label2,"Richtig")
ElseIf 
GUICtrlRead($Input1) = "Caesium" Then
GUICtrlSetData 
($Label2,"Richtig")
ElseIf 
GUICtrlRead($Input1) = "Francium" Then
GUICtrlSetData 
($Label2,"Richtig")
Sleep (2000)
MsgBox(0,"Erste HaubGrube Fertig","Erste HaubGrube fertig")
#cs
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
#ce
Else
GUICtrlSetData ($Label2,"Falche")
EndIf
EndFunc 
01/17/2011 12:15 PenGuin :O#6
Habs mal gekürzt:

Code:
Dim $aPS[7] = ["Wasserstoff", "Lithium", "Natrium", "Kalium", "Rubidium", "Caesium", "Francium"]

$Form1 = GUICreate("P.S.Bot", 191, 112, 192, 124)
GUISetBkColor(0xC0C0C0)
$Input1 = GUICtrlCreateInput("", 32, 32, 121, 21)
$Button1 = GUICtrlCreateButton("Start", 56, 56, 75, 25)
$Label1 = GUICtrlCreateLabel("Deine Antwort ist :", 0, 0, 90, 17)
$Label2 = GUICtrlCreateLabel("????", 96, 0, 70, 28)
GUICtrlSetFont(-1, 18, 800, 0, "Sixties")
GUICtrlSetColor(-1, 0x0000FF)
$Button2 = GUICtrlCreateButton("Exit", 56, 80, 75, 25)
$Label3 = GUICtrlCreateLabel("By T.M.B", 136, 88, 54, 20)
GUICtrlSetFont(-1, 10, 800, 4, "Myriad Pro")
GUICtrlSetColor(-1, 0x800000)
GUISetState()


While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case -3
			Exit
		Case $Button1
			_Start1()
		Case $Button2
			Exit
	EndSwitch
WEnd
;Notiz:mit Do Schleife ein limet der Fehler einbauen Notiz2:bessere Gui

Func _Start1()
	For $i = 0 To 6
		If GUICtrlRead($Input1) = $aPS[$i] Then
			GUICtrlSetData($Label2, "Richtig")
			ExitLoop
		Else
			GUICtrlSetData($Label2, "Falsch")
		EndIf
	Next
EndFunc   ;==>_Start1
01/17/2011 16:54 Tmb#7
Quote:
Originally Posted by .2good4you111 View Post
PHP Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("P.S.Bot"191112192124)
GUISetBkColor(0xC0C0C0)
$Input1 GUICtrlCreateInput(""323212121)
$Button1 GUICtrlCreateButton("Start"56567525$WS_GROUP)
$Label1 GUICtrlCreateLabel("Deine Antwort ist :"009017)
$Label2 GUICtrlCreateLabel("????"9607028)
GUICtrlSetFont(-1188000"Sixties")
GUICtrlSetColor(-10x0000FF)
$Button2 GUICtrlCreateButton("Exit"56807525$WS_GROUP)
$Label3 GUICtrlCreateLabel("By T.M.B"136885420)
GUICtrlSetFont(-1108004"Myriad Pro")
GUICtrlSetColor(-10x800000)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg 
GUIGetMsg()
Switch 
$nMsg
Case $GUI_EVENT_CLOSE
Exit
Case 
$Button1
_Start1
()
Case 
$Button2
Exit 0
EndSwitch
WEnd
;Notiz:mit Do Schleife ein limet der Fehler einbauen Notiz2:bessere Gui
#cs
ElseIf GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
#ce
Func _Start1()

If 
GUICtrlRead($Input1) = "Wasserstoff" Then
GUICtrlSetData 
($Label2,"Richtig")
ElseIf 
GUICtrlRead($Input1) = "Lithium" Then
GUICtrlSetData 
($Label2,"Richtig")
ElseIf 
GUICtrlRead($Input1) = "Natrium" Then
GUICtrlSetData 
($Label2,"Richtig")
ElseIf 
GUICtrlRead($Input1) = "Kalium" Then
GUICtrlSetData 
($Label2,"Richtig")
ElseIf 
GUICtrlRead($Input1) = "Rubidium" Then
GUICtrlSetData 
($Label2,"Richtig")
ElseIf 
GUICtrlRead($Input1) = "Caesium" Then
GUICtrlSetData 
($Label2,"Richtig")
ElseIf 
GUICtrlRead($Input1) = "Francium" Then
GUICtrlSetData 
($Label2,"Richtig")
Sleep (2000)
MsgBox(0,"Erste HaubGrube Fertig","Erste HaubGrube fertig")
#cs
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
ElseIf 
GUICtrlRead($Input1) = "" Then
GUICtrlSetData 
($Label2,"Richtig")
EndIf
#ce
Else
GUICtrlSetData ($Label2,"Falche")
EndIf
EndFunc 
ich Danke dir eine frage was hatte ich Falsche gemacht????
jetzt geht es
01/17/2011 17:51 omer36#8
du hast die if abfrage einfach falsch gemacht...

PHP Code:

If $a "a" Then
    
;;;
EndIf
If 
$b "b" Then
    
;;;
EndIf

oder

If $a "a" Then
    
;;
;
du hattest immer noch endif´s hierszwischenda kannst du dann keine "Else"-If´s anwenden
ElseIf $b =  "b" Then
    
;;
EndIf 
01/17/2011 18:57 Tmb#9
Quote:
Originally Posted by omer36 View Post
du hast die if abfrage einfach falsch gemacht...

PHP Code:

If $a "a" Then
    
;;;
EndIf
If 
$b "b" Then
    
;;;
EndIf

oder

If $a "a" Then
    
;;
;
du hattest immer noch endif´s hierszwischenda kannst du dann keine "Else"-If´s anwenden
ElseIf $b =  "b" Then
    
;;
EndIf 
Aso danke
hab jetzt kapiert danke an alle