Wie währe es wenn mal jemand die Vokabeln.txt Postet?
habe ich zwar oben schonmal aber hier für dich
Spoiler anzeigen
[Deutsch]
1=Hallo
2=Welt
3=...
4=...
5=...
...
[Englisch]
1=hello
2=world
3=...
4=...
5=...
...
Wie währe es wenn mal jemand die Vokabeln.txt Postet?
habe ich zwar oben schonmal aber hier für dich
[Deutsch]
1=Hallo
2=Welt
3=...
4=...
5=...
...
[Englisch]
1=hello
2=world
3=...
4=...
5=...
...
Oh, hab ich nicht gesehen!
Ich glaub ich verbesser das mal ein Bischen!
okay ich hab meins etwas weitergeführt..
manchmal (scheinbar zufällig? O.o) kommt dieser Fehler. Keine ahnung woran das liegt..(oder vllt an dem falsch verwendeten random?)
C:\Dokumente und Einstellungen\XXxxxxXXXxxxX\Eigene Dateien\autoit\vokabeln\vokabel_1.au3 (42) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
ToolTip ("Richtig ist: " & $voc[2], 500, 500)
ToolTip ("Richtig ist: " & ^ ERROR
hier die vokabeln:
Hallo;hello
rennen;run
gehen;walk
schauen;look
lügen;lie
kauen;chew
drehen;turn
lippen;lips
augen;eyes
hier das script:
;includes
#include "file.au3"
;include Ende
;Variablen
Dim $arvocs
Dim $allvocs
Dim $voc
;Variablen Ende
;Vokabeln auslesen
_FileReadToArray (@scriptdir & "\vokabeln.txt", $arvocs)
$allvocs = UBound ($arvocs)
;Vokabeln auslesen Ende
;ToolTip
$random = Random (1, $allvocs, 1)
$voc = $arvocs[$random]
$voc = StringSplit ($voc, ";")
ToolTip ($voc[1], 500, 500)
;ToolTip Ende
;GUI
$Form1 = GUICreate("Vokabeltester", 100, 80, 300, 10)
$input = GUICtrlCreateInput ("" , 10, 10, 80, 20)
$ok = GUICtrlCreateButton ("OK", 40, 40)
GUISetState (@sw_show)
;Gui Ende
;Warten aufs ausfüllen
While 1
$bla = GUIGetMsg()
switch $bla
Case $ok
_next()
EndSwitch
WEnd
;Warten Ende
;Schleife, die die nächste Vokabel erstellt
Func _next()
GUISetState (@SW_hide)
GUICtrlSetData ($input, "")
ToolTip ("Richtig ist: " & $voc[2], 500, 500)
Sleep (2000)
$arvocs[$random] = ""
$random = Random (1, $allvocs, 1)
$voc = $arvocs[$random]
$voc = StringSplit ($voc, ";")
If $voc[1] = "" Then
_next()
EndIf
ToolTip ($voc[1], 500, 500)
GUISetState (@SW_show)
EndFunc
;Schleife Ende
PS: vielen dank an den threadersteller, das ist eine echt gute anwendung zum dazulernen! ein paar sachen die ich oben verwende habe ich ebengrade erst erlernt!
Edit: Einen Fehler gefunden und korrigiert.
Ich hab das Alte gerad mal Durchgegeguck!
#include <StaticConstants.au3>
#include <Misc.au3>
Global $Counter = Random (1,100,1), $deutsch , $englisch, $dll = DllOpen("user32.dll"), $test
$Old = ""
While 1
$deutsch = IniReadSection(@ScriptDir & "\Vokabeln.txt","Deutsch")
$englisch = IniReadSection(@ScriptDir & "\Vokabeln.txt","Englisch")
Do
$1 = Random (1,$deutsch[0][0] +1)
Until $1 <> $Old
$Old = $1
ToolTip("Deutsch",500,500,$deutsch[$1][1],"",1)
While 1
IF _IsPressed ("20") Then
While 1
If Not _IsPressed ("20") Then ExitLoop
WEnd
ExitLoop
EndIf
Sleep (100)
WEnd
ToolTip("Englisch",500,500,$englisch[$1][1],"",3)
While 1
IF _IsPressed ("20") Then
While 1
If Not _IsPressed ("20") Then ExitLoop
WEnd
ExitLoop
EndIf
Sleep (100)
WEnd
WEnd
So... hab meins mit hilfe von stringsplit usw jetzt mal geändert
Quellcode:
#include <StaticConstants.au3>
#include <Misc.au3>
#include "file.au3"
#include <Array.au3>
Dim $dll = DllOpen("user32.dll")
Dim $arvocs
Dim $allvocs
Dim $englisch
Dim $deutsch
Dim $test
While 1
_FileReadToArray (@scriptdir & "\vokabeln.txt", $arvocs)
$allvocs = UBound ($arvocs)
$random = Random (1, $allvocs, 1)
$voc = $arvocs[$random]
If $voc == "" Then
Do
$random = Random (1, $allvocs, 1)
$voc = $arvocs[$random]
Until $voc <> ""
EndIf
$i = StringSplit ($voc, "=")
ToolTip("Deutsch",500,500,$i[1],"",1)
While 1
IF _IsPressed ("20") Then
While 1
If Not _IsPressed ("20") Then ExitLoop
WEnd
ExitLoop
EndIf
Sleep (100)
WEnd
ToolTip("Englisch",500,500,$i[2],"",3)
While 1
IF _IsPressed ("20") Then
While 1
If Not _IsPressed ("20") Then ExitLoop
WEnd
ExitLoop
EndIf
Sleep (100)
WEnd
WEnd
Vokabeln.txt:
Hallo=Hello
Welt=World
Richtig=Right
Falsch=Wrong
rennen=run
essen=eat
trinken=drink
Edit: Hmm komisch... manchmal bekomme ich nen error:
$voc = $arvocs[$random]
$voc = ^ ERROR
Keine ahnung warum... kann sich das vielleicht mal einer anschauen ?
So:
#include <StaticConstants.au3>
#include <Misc.au3>
#include "file.au3"
#include <Array.au3>
Dim $dll = DllOpen("user32.dll")
Dim $arvocs
Dim $allvocs
Dim $englisch
Dim $deutsch
Dim $test
While 1
_FileReadToArray (@scriptdir & "\vokabeln.txt", $arvocs)
$allvocs = UBound ($arvocs) -1
$random = Random (1, $allvocs, 1)
$voc = $arvocs[$random]
If $voc == "" Then
Do
$random = Random (1, $allvocs, 1)
$voc = $arvocs[$random]
Until $voc <> ""
EndIf
$i = StringSplit ($voc, "=")
ToolTip("Deutsch",500,500,$i[1],"",1)
While 1
IF _IsPressed ("20") Then
While 1
If Not _IsPressed ("20") Then ExitLoop
WEnd
ExitLoop
EndIf
Sleep (100)
WEnd
ToolTip("Englisch",500,500,$i[2],"",3)
While 1
IF _IsPressed ("20") Then
While 1
If Not _IsPressed ("20") Then ExitLoop
WEnd
ExitLoop
EndIf
Sleep (100)
WEnd
WEnd
Alles anzeigenokay ich hab meins etwas weitergeführt..
manchmal (scheinbar zufällig? O.o) kommt dieser Fehler. Keine ahnung woran das liegt..(oder vllt an dem falsch verwendeten random?)CodeC:\Dokumente und Einstellungen\XXxxxxXXXxxxX\Eigene Dateien\autoit\vokabeln\vokabel_1.au3 (42) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: ToolTip ("Richtig ist: " & $voc[2], 500, 500) ToolTip ("Richtig ist: " & ^ ERROR
hier die vokabeln:
Spoiler anzeigen
Hallo;hello
rennen;run
gehen;walk
schauen;look
lügen;lie
kauen;chew
drehen;turn
lippen;lips
augen;eyeshier das script:
Spoiler anzeigen
[autoit][/autoit] [autoit][/autoit] [autoit]
;includes
#include "file.au3"
;include Ende;Variablen
[/autoit] [autoit][/autoit] [autoit]
Dim $arvocs
Dim $allvocs
Dim $voc
;Variablen Ende;Vokabeln auslesen
[/autoit] [autoit][/autoit] [autoit]
_FileReadToArray (@scriptdir & "\vokabeln.txt", $arvocs)
$allvocs = UBound ($arvocs)
;Vokabeln auslesen Ende;ToolTip
[/autoit] [autoit][/autoit] [autoit]
$random = Random (1, $allvocs, 1)
$voc = $arvocs[$random]
$voc = StringSplit ($voc, ";")
ToolTip ($voc[1], 500, 500)
;ToolTip Ende;GUI
[/autoit] [autoit][/autoit] [autoit]
$Form1 = GUICreate("Vokabeltester", 100, 80, 300, 10)
$input = GUICtrlCreateInput ("" , 10, 10, 80, 20)
$ok = GUICtrlCreateButton ("OK", 40, 40)
GUISetState (@sw_show)
;Gui Ende;Warten aufs ausfüllen
[/autoit] [autoit][/autoit] [autoit]
While 1
$bla = GUIGetMsg()
switch $bla
Case $ok
_next()
EndSwitch
WEnd
;Warten Ende;Schleife, die die nächste Vokabel erstellt
[/autoit] [autoit][/autoit] [autoit][/autoit]
Func _next()
GUISetState (@SW_hide)
GUICtrlSetData ($input, "")
ToolTip ("Richtig ist: " & $voc[2], 500, 500)
Sleep (2000)
$arvocs[$random] = ""
$random = Random (1, $allvocs, 1)
$voc = $arvocs[$random]
$voc = StringSplit ($voc, ";")
If $voc[1] = "" Then
_next()
EndIf
ToolTip ($voc[1], 500, 500)
GUISetState (@SW_show)
EndFunc
;Schleife Ende
PS: vielen dank an den threadersteller, das ist eine echt gute anwendung zum dazulernen! ein paar sachen die ich oben verwende habe ich ebengrade erst erlernt!
Edit: Einen Fehler gefunden und korrigiert.
Np
Hat mir auch geholfen
Gelöscht
Hast du beim Posten irgendwie einen Fehler gemacht, weil das ist ja nur müll
Gelöscht
Um genaueres zu sagen müsstest du mal die Vokabeln.txt uploaden, denn es ist ein Falscher Prameter bei StringSplit denke ich, kannst ja mal so versuchen, sonst poste einfach auch mal die Vokabeln.txt
#comments-start
[/autoit] [autoit][/autoit] [autoit]Vokabeltrainer Version 1
Französisch
#comments-end
[/autoit] [autoit][/autoit] [autoit]#include "file.au3"
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Dim $arvocs
Dim $allvocs
Dim $voc
;Vokabeln auslesen
_FileReadToArray (@scriptdir & "\vokabeln.txt", $arvocs)
$allvocs = UBound ($arvocs) -1
;Vokabeln auslesen Ende
;ToolTip
$random = Random (1, $allvocs, 1)
$voc = $arvocs[$random]
$voc = StringSplit ($voc, "=")
;ToolTip Ende
[/autoit] [autoit][/autoit] [autoit];GUI
[/autoit] [autoit][/autoit] [autoit]$Form1 = GUICreate("Vokabeltester", 633, 454, 192, 124)
$Vokabeleingabe = GUICtrlCreateInput("Vokabeleingabe", 56, 80, 209, 21)
$Fertig = GUICtrlCreateButton("Fertig!!!", 56, 240, 209, 97, $WS_GROUP)
GUISetState (@sw_show)
$Abbrechen = GUICtrlCreateButton("Abbrechen", 423, 383, 145, 57, $WS_GROUP)
$frage= GUICtrlCreateInput($voc[1], 56, 176, 209, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY))
$Leo = GUICtrlCreateButton("Übersetzung", 240, 384, 145, 57, $WS_GROUP)
$Informationen = GUICtrlCreateButton("Informationen", 55, 383, 145, 57, $WS_GROUP)
$Label2 = GUICtrlCreateLabel("Gib hier die Übersetzung ein:", 64, 56, 140, 17)
GUISetState (@sw_show)
;Gui Ende
#include <IE.au3>
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit];Warten aufs ausfüllen
While 1
$bla = GUIGetMsg()
switch $bla
Case $Fertig
_next()
Case $Abbrechen
Exit
Case $Leo
_IECreate("http://dict.leo.org/frde?lang=de&lp=frde", 0, 1, 0 )
Case $Informationen
MsgBox(0,"Informationen","Idee: YYYYYYY" & @CRLF & "Entwickelt: XXXXXX")
EndSwitch
WEnd
;Warten Ende
;Schleife, die die nächste Vokabel erstellt
Func _next()
GUICtrlSetData ($Vokabeleingabe, "")
$Loesung = GUICtrlCreateInput("Richtig ist: " & $voc[2], 56, 130, 209, 21)
Sleep (2000)
$arvocs[$random] = ""
$random = Random (1, $allvocs, 1)
$voc = $arvocs[$random]
$voc = StringSplit ($voc, "=")
If $voc[1] = "" Then
_next()
EndIf
$L = GUICtrlCreateInput($voc[1], 56, 176, 209, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY))
GUICtrlSetData($Loesung,"Lösung")
EndFunc
;Schleife Ende
Edit BugFix: persönliche Angaben entfernt