$tmsg = MsgBox(4,"Hilfe anzeigen?","Hilfe anzeigen?")
If $tmsg = 6 Then
MsgBox(0,"Hilfe","Bei jedem Start müssen Sie Ihre .ini mit den Vokabeln laden" & @crlf & "Diese ist wie folgt aufgebaut:" & @crlf & "[Vok]" & @crlf & "Vok=Dump/Dump" & @crlf & "Vok2=Vokabel1/Übersetzung1" & @crlf & "Vok3=Vokabel2/Übersetzung2" & @crlf & "..." & @crlf & @crlf & "<Neue Vokabel> erstellt einen neuen Eintrag in der geladenen .ini oder erstellt eine neue, falls Sie anfangs keine geladen haben")
$filea = FileOpenDialog(".ini auswählen",@ScriptDir,".ini (*.ini)",1)
Global $fileb = StringReplace($filea,"|","/")
Else
$filea = FileOpenDialog(".ini auswählen",@ScriptDir,".ini (*.ini)",1)
Global $fileb = StringReplace($filea,"|","/")
EndIf
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $Item
$filea = FileOpenDialog(".ini auswählen",@ScriptDir,".ini (*.ini)",1)
Global $fileb = StringReplace($filea,"|","/")
_update()
Case $Item2
MsgBox(0,"Hilfe","Bei jedem Start müssen Sie ihre .ini mit den Vokabeln laden" & @crlf & "Diese ist wie folgt aufgebaut:" & @crlf & "[Vok]" & @crlf & "Vok=Dump/Dump" & @crlf & "Vok2=Vokabel1/Übersetzung1" & @crlf & "Vok3=Vokabel2/Übersetzung2" & @crlf & "..." & @crlf & @crlf & "<Neue Vokabel> erstellt einen neuen Eintrag in der geladenen .ini oder erstellt eine neue, falls sie anfangs keine geladen haben")
Case $Item3
MsgBox(0,"Credits","mipez: idea & scripting"& @CRLF & "mozo_: counter & stats" & @CRLF & "(c) mipez, 2010")
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_check()
Case $Button2
_list()
Case $Button3
_new()
EndSwitch
WEnd
Func _new()
$put = InputBox("Vokabel","Bitte die Vokabel in Deutsch eingeben")
$put2 = InputBox("Vokabel","Übersetzung")
$vokread = IniReadSection($fileb,"Vok")
If @error Then
MsgBox(0,"Neue .ini", "Es wird eine neue Vok.ini erstellt, bitte Neueingabe wiederholen")
IniWrite($fileb,"Vok","Vok","Dump/Dump")
Else
IniWrite($fileb,"Vok","Vok" & $vokread[0][0]+1, $put & "/" & $put2)
EndIf
EndFunc
$tmsg = MsgBox(4,"Hilfe anzeigen?","Hilfe anzeigen?")
If $tmsg = 6 Then
MsgBox(0,"Hilfe","Bei jedem Start müssen Sie Ihre .ini mit den Vokabeln laden" & @crlf & "Diese ist wie folgt aufgebaut:" & @crlf & "[Vok]" & @crlf & "Vok=Dump/Dump" & @crlf & "Vok2=Vokabel1/Übersetzung1" & @crlf & "Vok3=Vokabel2/Übersetzung2" & @crlf & "..." & @crlf & @crlf & "<Neue Vokabel> erstellt einen neuen Eintrag in der geladenen .ini oder erstellt eine neue, falls Sie anfangs keine geladen haben")
$filea = FileOpenDialog(".ini auswählen",@ScriptDir,".ini (*.ini)",1)
Global $fileb = StringReplace($filea,"|","/")
Else
$filea = FileOpenDialog(".ini auswählen",@ScriptDir,".ini (*.ini)",1)
Global $fileb = StringReplace($filea,"|","/")
EndIf
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $Item
$filea = FileOpenDialog(".ini auswählen",@ScriptDir,".ini (*.ini)",1)
Global $fileb = StringReplace($filea,"|","/")
_update()
Case $Item2
MsgBox(0,"Hilfe","Bei jedem Start müssen Sie ihre .ini mit den Vokabeln laden" & @crlf & "Diese ist wie folgt aufgebaut:" & @crlf & "[Vok]" & @crlf & "Vok=Dump/Dump" & @crlf & "Vok2=Vokabel1/Übersetzung1" & @crlf & "Vok3=Vokabel2/Übersetzung2" & @crlf & "..." & @crlf & @crlf & "<Neue Vokabel> erstellt einen neuen Eintrag in der geladenen .ini oder erstellt eine neue, falls sie anfangs keine geladen haben")
Case $Item3
MsgBox(0,"Credits","mipez: idea & scripting"& @CRLF & "mozo_: counter & stats" & @CRLF & "(c) mipez, 2010")
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_check()
Case $Button2
_list()
Case $Button3
_new()
EndSwitch
WEnd
Func _new()
$put = InputBox("Vokabel","Bitte die Vokabel in Deutsch eingeben")
$put2 = InputBox("Vokabel","Übersetzung")
$vokread = IniReadSection($fileb,"Vok")
If @error Then
MsgBox(0,"Neue .ini", "Es wird eine neue Vok.ini erstellt, bitte Neueingabe wiederholen")
IniWrite($fileb,"Vok","Vok","Dump/Dump")
Else
IniWrite($fileb,"Vok","Vok" & $vokread[0][0]+1, $put & "/" & $put2)
EndIf
EndFunc
Also habe ein paar Fragen:
Wie kann ich eine normale .ini Datei erstellen?
Wenn ich eine neue Vokabel eingebe und die Übersetzung kommt irgendetwas von Neueingabe oder so was bedeutet das?
Es kommt eine Message, dass eine neue .ini erstellt wurde wo wird die gespeichert ?
Also habe ein paar Fragen:
Wie kann ich eine normale .ini Datei erstellen?
Wenn ich eine neue Vokabel eingebe und die Übersetzung kommt irgendetwas von Neueingabe oder so was bedeutet das?
Es kommt eine Message, dass eine neue .ini erstellt wurde wo wird die gespeichert ?
Hier mal das aktuelle Script:
Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
$Form1 = GUICreate("Vocabtrainer 0.1", 297, 150, 532, 287)
$Label1 = GUICtrlCreateLabel("", 56, 16,100,20)
$Input1 = GUICtrlCreateInput("", 16, 56, 121, 21)
$Button1 = GUICtrlCreateButton("OK/Start", 16, 88, 121, 25)
$Button2 = GUICtrlCreateButton("Show List", 152, 14, 121, 25)
$Button3 = GUICtrlCreateButton("New Entry", 152, 54, 121, 25)
$Label2 = GUICtrlCreateLabel("", 185, 95,100,20)
$Menu = GUICtrlCreateMenu ("Language")
$Item = GUICtrlCreateMenuitem ("Change Language",$Menu)
$Item2 = GUICtrlCreateMenuitem ("Help",$Menu)
$Item3 = GUICtrlCreateMenuitem ("Credits",$Menu)
GUISetState(@SW_SHOW)
Global $temparray[1]
Global $tstring
$tmsg = MsgBox(4,"Show Help?","Show Help?")
If $tmsg = 6 Then
MsgBox(0,"Help","Every time you run this prog, you need to load your vocab .ini" & @crlf & "It's build like this:" & @crlf & "[Voc]" & @crlf & "Voc=Dump/Dump" & @crlf & "Voc2=Vocabel1/Translation1" & @crlf & "Voc3=Vocabel2/Translation2" & @crlf & "..." & @crlf & @crlf & "<New Entry> sets a new entry in your loaded .ini or creates a new one, if you haven't loaded one at the start")
$filea = FileOpenDialog("load .ini",@tempdir,".ini (*.ini)",1)
Global $fileb = StringReplace($filea,"|","/")
Else
$filea = FileOpenDialog("load .ini",@tempdir,".ini (*.ini)",1)
Global $fileb = StringReplace($filea,"|","/")
EndIf
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $Item
$filea = FileOpenDialog("load .ini",@tempdir,".ini (*.ini)",1)
Global $fileb = StringReplace($filea,"|","/")
_update()
Case $Item2
MsgBox(0,"Help","Every time you run this prog, you need to load your vocab .ini" & @crlf & "It's build like this:" & @crlf & "[Voc]" & @crlf & "Voc=Dump/Dump" & @crlf & "Voc2=Vocabel1/Translation1" & @crlf & "Voc3=Vocabel2/Translation2" & @crlf & "..." & @crlf & @crlf & "<New Entry> sets a new entry in your loaded .ini or creates a new one, if you haven't loaded one at the start")
Case $Item3
MsgBox(0,"Credits","mipez: idea & scripting" & @CRLF & "(c) mipez, 2010")
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_check()
Case $Button2
_list()
Case $Button3
_new()
EndSwitch
WEnd
Func _new()
$put = InputBox("Vocabel","Please set your vocabel")
$put2 = InputBox("Vokabel","Translation")
$vokread = IniReadSection($fileb,"Voc")
If @error Then
MsgBox(0,"New .ini", "A new .ini will be created, please set your vocabel/translation again")
IniWrite($fileb,"Voc","Voc","Dump/Dump")
Else
IniWrite($fileb,"Voc","Voc" & $vokread[0][0]+1, $put & "/" & $put2)
EndIf
EndFunc
Func _list()
$hj = IniReadSection($fileb,"Voc")
_ArrayDisplay($hj)
EndFunc
Func _update()
$tok = IniReadSection($fileb,"Voc")
If not @error Then
$z =Random(2,$tok[0][0],1)
$tak = IniRead($fileb,"Voc","Voc" & $z,"")
$tstring = StringSplit($tak,"/")
$z2 = Random(1,2,1)
If $z2 = 1 Then
$temparray[0] = 1
ElseIf $z2 = 2 Then
$temparray[0] = 2
EndIf
GUICtrlSetData($Label1,$tstring[$z2])
EndIf
EndFunc
Func _check()
$r3 = GUICtrlRead($Input1)
$zt = FileExists($fileb)
If NOT $zt = True Then
MsgBox(0,"failed to find .ini","Failed to find .ini")
Else
If $r3 = "" Then
_update()
Else
If $temparray[0] <> 1 Then
If $r3 = $tstring[1] Then
GUICtrlSetData($Label2,"Correct!")
GUICtrlSetData($Input1,"")
Sleep(500)
_update()
Else
GUICtrlSetData($Label2,"Wrong!")
EndIf
ElseIf $temparray[0] <> 2 Then
If $r3 = $tstring[2] Then
GUICtrlSetData($Label2,"Correct!")
GUICtrlSetData($Input1,"")
Sleep(500)
_update()
Else
GUICtrlSetData($Label2,"Wrong!")
EndIf
EndIf
EndIf
EndIf
EndFunc
Allerdings verstehe ich deine 1. Frage nicht so recht oô
Code:
IniWrite("Name.ini","Sektion","Index","Wert")
Ist noch nicht fertig, daher muss man momentan die .ini vorher erstellen:
Vokabeltrainer mit Autoit 11/08/2009 - AutoIt - 5 Replies Wisst ihr wie ich mit Autoit nen Vokabeltrainer scripten kann?
Sry wenn ich in der Falschen Sektion bin Dann verschieben bitte!
Vokabeltrainer 08/30/2009 - AutoIt - 8 Replies Hi
Ich hab mir nen Vokabeltrainer gebastelt. Der Haken ist nur das er halt nur das Abfragt was ich ihm vorher gesagt habe. Ich hätte es gern so das man seine Vokabel mit Übersetzung in ne Datei schreibt und er dann sich zufällig 10 von den ganzen Übersetzungen aussucht die per MsgBox dem User schreibt und man dann die eigentlich Vokabel(z.b. Fahrrad - Bike) eintippen muss.
Weiß einer wie des geht bzw. kann mir da wer helfen?
Grüße
Baaam01