Vokabeltrainer

09/07/2010 15:56 mipez#1
Macht damit was ihr wollt, is mir rotzegal.
Die Inis müssen min. 3 Einträge beinhalten und sollten so aussehen:
Code:
[Vok]
Vok=Dump/Dump
Vok2=Deutsch/Übersetzung
Vok3=Deutsch/Übersetzung
...
Ich spar mir an dieser Stelle das Kompilieren und stell einfach den Source rein:
Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Vokabeltrainer 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("Liste anzeigen", 152, 14, 121, 25)
$Button3 = GUICtrlCreateButton("Neue Vokabel", 152, 54, 121, 25)
$Label2 = GUICtrlCreateLabel("", 185, 95,100,20)

$Menu = GUICtrlCreateMenu ("Sprache")
$Item = GUICtrlCreateMenuitem ("Sprache ändern",$Menu)
$Item2 = GUICtrlCreateMenuitem ("Hilfe",$Menu)
$Item3 = GUICtrlCreateMenuitem ("Credits",$Menu)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Global $temparray[1]
Global $tstring

$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",@tempdir,".ini (*.ini)",1)
	Global $fileb = StringReplace($filea,"|","/")
Else
$filea = FileOpenDialog(".ini auswählen",@tempdir,".ini (*.ini)",1)
Global $fileb = StringReplace($filea,"|","/")
EndIf

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $Item
			$filea = FileOpenDialog(".ini auswählen",@tempdir,".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 & "(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

Func _list()
	$hj = IniReadSection($fileb,"Vok")
	_ArrayDisplay($hj)
EndFunc



Func _update()
	$tok = IniReadSection($fileb,"Vok")
	If not @error Then
	$z =Random(2,$tok[0][0],1)
	$tak = IniRead($fileb,"Vok","Vok" & $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,".ini nicht gefunden","Vok.ini konnte nicht gefunden werden")
	Else
		If $r3 = "" Then 
			_update()
		Else
			If $temparray[0] <> 1 Then
				If $r3 = $tstring[1] Then
					GUICtrlSetData($Label2,"Richtig!")
					GUICtrlSetData($Input1,"")
					Sleep(500)
					_update()
				Else
					GUICtrlSetData($Label2,"Falsch!")
				EndIf
			ElseIf $temparray[0] <> 2 Then
				If $r3 = $tstring[2] Then
					GUICtrlSetData($Label2,"Richtig!")
					GUICtrlSetData($Input1,"")
					Sleep(500)
					_update()
				Else
					GUICtrlSetData($Label2,"Falsch!")
				EndIf
			EndIf
		EndIf
	EndIf
EndFunc
Danke an... ach diejenigen wissen dass sie gemeint sind oô
09/07/2010 16:05 HardCore.1337#2
gute Idee.
09/07/2010 16:07 mipez#3
Quote:
Originally Posted by HardCore.1337 View Post
gute Idee.
Hm, aber das Problem mit dem Array konnte ich bis heute nich lösen -.-
09/07/2010 20:11 Mozo_#4
Hab in den Trainer mal einen Counter und Stats reingemacht :D
Code:

PHP Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
$nummer 0
$r 
0
$f 
0
$start 
0
#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("Vokabeltrainer 0.1"298121516135)
$Label1 GUICtrlCreateLabel(""16812425)
$Input1 GUICtrlCreateInput(""164812121)
$Button1 GUICtrlCreateButton("OK/Start"247297250)
$Button2 GUICtrlCreateButton("Liste anzeigen"1520137250)
$Button3 GUICtrlCreateButton("Neue Vokabel"15224137250)
$Label2 GUICtrlCreateLabel(""1525114017)
$Label3 GUICtrlCreateLabel($nummer&"/30"1527214017)

$Menu GUICtrlCreateMenu ("Sprache")
$Item GUICtrlCreateMenuitem ("Sprache ändern",$Menu)
$Item2 GUICtrlCreateMenuitem ("Hilfe",$Menu)
$Item3 GUICtrlCreateMenuitem ("Credits",$Menu)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Global $temparray[1]
Global 
$tstring

$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

Func _list
()
    
$hj IniReadSection($fileb,"Vok")
    
_ArrayDisplay($hj)
EndFunc

Func _update
()
    If 
$nummer <= 29 Then
        
        $tok 
IniReadSection($fileb,"Vok")
        If 
not @error Then
            $z 
=Random(2,$tok[0][0],1)
            
$tak IniRead($fileb,"Vok","Vok" $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])
            
$nummer $nummer +1
            GUICtrlSetData
($Label3,$nummer "/30")
        EndIf
    Else
        
MsgBox(0,"Ergebniss""Ergebniss:" & @crlf "Richtig: " $r "" & @crlf "Falsch: " $f)
        
$r 0
        $f 
0
        $nummer 
0
        $start 
0
        GUICtrlSetData
($Label1"")
        
GUICtrlSetData($Label3"")
    EndIf
EndFunc

Func _check
()
    If 
$start 0 Then
        $start 
1
        _update
()
    Else
        
$r3 GUICtrlRead($Input1)
        
$zt FileExists($fileb)
        If 
NOT $zt True Then 
            MsgBox
(0,".ini nicht gefunden","Vok.ini konnte nicht gefunden werden")
        Else
            If 
$r3 "" Then 
                $f 
$f +1
                _update
()
            Else
                If 
$temparray[0] <> 1 Then
                    
If $r3 $tstring[1Then
                        GUICtrlSetData
($Label2,"Richtig!")
                        
Sleep(1000)
                        
GUICtrlSetData($Label2,"")
                        
GUICtrlSetData($Input1,"")
                        
$r $r +1
                        Sleep
(500)
                        
_update()
                    Else
                        
GUICtrlSetData($Label2,"Falsch!")
                        
Sleep(1000)
                        
GUICtrlSetData($Label2,"")
                        
$f $f +1
                        _update
()
                    EndIf
                ElseIf 
$temparray[0] <> 2 Then
                    
If $r3 $tstring[2Then
                        GUICtrlSetData
($Label2,"Richtig!")
                        
Sleep(1000)
                        
GUICtrlSetData($Label2,"")
                        
GUICtrlSetData($Input1,"")
                        
$r $r +1
                        Sleep
(500)
                        
_update()
                    Else
                        
GUICtrlSetData($Label2,"Falsch!")
                        
Sleep(1000)
                        
GUICtrlSetData($Label2,"")
                        
$f $f +1
                        _update
()
                    EndIf
                EndIf
            EndIf
        EndIf
    EndIf
EndFunc 
09/07/2010 21:52 mipez#5
Quote:
Originally Posted by Mozo_ View Post
Hab in den Trainer mal einen Counter und Stats reingemacht :D
Code:

PHP Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
$nummer 0
$r 
0
$f 
0
$start 
0
#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("Vokabeltrainer 0.1"298121516135)
$Label1 GUICtrlCreateLabel(""16812425)
$Input1 GUICtrlCreateInput(""164812121)
$Button1 GUICtrlCreateButton("OK/Start"247297250)
$Button2 GUICtrlCreateButton("Liste anzeigen"1520137250)
$Button3 GUICtrlCreateButton("Neue Vokabel"15224137250)
$Label2 GUICtrlCreateLabel(""1525114017)
$Label3 GUICtrlCreateLabel($nummer&"/30"1527214017)

$Menu GUICtrlCreateMenu ("Sprache")
$Item GUICtrlCreateMenuitem ("Sprache ändern",$Menu)
$Item2 GUICtrlCreateMenuitem ("Hilfe",$Menu)
$Item3 GUICtrlCreateMenuitem ("Credits",$Menu)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Global $temparray[1]
Global 
$tstring

$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

Func _list
()
    
$hj IniReadSection($fileb,"Vok")
    
_ArrayDisplay($hj)
EndFunc

Func _update
()
    If 
$nummer <= 29 Then
        
        $tok 
IniReadSection($fileb,"Vok")
        If 
not @error Then
            $z 
=Random(2,$tok[0][0],1)
            
$tak IniRead($fileb,"Vok","Vok" $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])
            
$nummer $nummer +1
            GUICtrlSetData
($Label3,$nummer "/30")
        EndIf
    Else
        
MsgBox(0,"Ergebniss""Ergebniss:" & @crlf "Richtig: " $r "" & @crlf "Falsch: " $f)
        
$r 0
        $f 
0
        $nummer 
0
        $start 
0
        GUICtrlSetData
($Label1"")
        
GUICtrlSetData($Label3"")
    EndIf
EndFunc

Func _check
()
    If 
$start 0 Then
        $start 
1
        _update
()
    Else
        
$r3 GUICtrlRead($Input1)
        
$zt FileExists($fileb)
        If 
NOT $zt True Then 
            MsgBox
(0,".ini nicht gefunden","Vok.ini konnte nicht gefunden werden")
        Else
            If 
$r3 "" Then 
                $f 
$f +1
                _update
()
            Else
                If 
$temparray[0] <> 1 Then
                    
If $r3 $tstring[1Then
                        GUICtrlSetData
($Label2,"Richtig!")
                        
Sleep(1000)
                        
GUICtrlSetData($Label2,"")
                        
GUICtrlSetData($Input1,"")
                        
$r $r +1
                        Sleep
(500)
                        
_update()
                    Else
                        
GUICtrlSetData($Label2,"Falsch!")
                        
Sleep(1000)
                        
GUICtrlSetData($Label2,"")
                        
$f $f +1
                        _update
()
                    EndIf
                ElseIf 
$temparray[0] <> 2 Then
                    
If $r3 $tstring[2Then
                        GUICtrlSetData
($Label2,"Richtig!")
                        
Sleep(1000)
                        
GUICtrlSetData($Label2,"")
                        
GUICtrlSetData($Input1,"")
                        
$r $r +1
                        Sleep
(500)
                        
_update()
                    Else
                        
GUICtrlSetData($Label2,"Falsch!")
                        
Sleep(1000)
                        
GUICtrlSetData($Label2,"")
                        
$f $f +1
                        _update
()
                    EndIf
                EndIf
            EndIf
        EndIf
    EndIf
EndFunc 
Ahem, rate mal warum ich die Einträge per Zufall abrufe xD
09/07/2010 22:04 kknb#6
hatte sowas in der art mal schnell für den einen typen da gemacht. sieht von der zeilenanzahl wesentlich kürzer aus wie deiner ;)

[Only registered and activated users can see links. Click Here To Register...]
09/08/2010 00:29 Mozo_#7
@mipez

hatte das auch nur so aus langeweile gemacht... dann kann man 30 vokabeln abarbeiten und gucken wie viel mach richtig bzw falsch hat
11/17/2010 21:06 iJonas#8
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 ?
11/17/2010 22:05 mipez#9
Quote:
Originally Posted by iJonas View Post
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:
Code:
[Voc]
Voc=Dump/Dump
Voc2=hallo/hello
Voc3=allgemein/general
Und die .ini muss im selben Verzeichnis wie das Script sein.