- Offizieller Beitrag
Hi,
der Befehl müsste ungefähr so sein :
Case $msg[0] = $deinControl And $msg[1] = $deine_GUI
So long,
Mega
Hi,
der Befehl müsste ungefähr so sein :
Case $msg[0] = $deinControl And $msg[1] = $deine_GUI
So long,
Mega
irgendwie versteh ich das nicht so ganz ich poste mal ein stück aus dem code
hier die maingui:
[autoit]
GUICreate("moDMove 3.0 by lev",269,200)
GUISetState(@sw_show)
GUISetIcon(@TempDir & "\modmove.ico")
$logo=GUICtrlCreatePic("F:\Call of Duty 2\main\modmove.jpg",0,0,269,64,-1,-1)
$menu_options=GUICtrlCreateMenu("Options",-1,0)
$menu_help=GUICtrlCreateMenu("Help",-1,0)
$help_about=GUICtrlCreateMenuItem("About",$menu_help,10)
$help_stats=GUICtrlCreateMenuItem("Stats",$menu_help,00)
$moveembutton=GUICtrlCreateButton("Move 'Em",5,75,100,20,-1,-1)
$moveembackbutton=GUICtrlCreateButton("Move 'Em back",5,110,100,20,-1,-1)
$clearmainbutton=GUICtrlCreateButton("Clear mainfolder",140,75,100,20,-1,-1)
$nomovelistbutton=GUICtrlCreateButton("NoMove-List",140,110,100,20,-1,-1)
$nomoveshowlabel=GUICtrlCreateLabel("NoMove:",5,166,62,14,-1,-1)
$madebylabel=GUICtrlCreateLabel("made by Leviathan",141,166,113,12,-1,-1)
$nomovegroupcounting=GUICtrlCreateGroup("",-6,159,285,31,-1,-1)
$warnungslabel=GUICtrlCreateLabel("Be sure that u did config under options",22,144,228,14,-1,-1)
While 1
$msg=GUIGetMsg()
If $msg=$GUI_EVENT_CLOSE Then ExitLoop
If $msg=$moveembackbutton Then _movemodsback()
If $msg=$moveembutton Then _movemods()
If $msg=$help_about Then _about()
If $msg=$help_stats Then _stats()
WEnd
und hier die funktion _stats()
[autoit]
Func _stats()
;Hier werden die jeweilige Anzahl aus der ini-file geladen:
$counterback = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "countermoveback", "0")
$counter = Iniread(@ScriptDir & "\modmove.ini", "Programminfo", "counter" ,"0")
$counterextra = Iniread(@ScriptDir & "\modmove.ini", "Programminfo", "counterextra", "0")
$counterclear = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "counterclear", "0")
GUICreate("Stats",184,177)
GUISetState(@sw_show)
GUISetIcon(@TempDir & "\modmove.ico")
$imoveemstats=GUICtrlCreateLabel("Move 'Em:",5,30,85,14,-1,-1)
$statsheader=GUICtrlCreateLabel("Stats:",6,6,67,14,-1,-1)
$moveemback=GUICtrlCreateLabel("Move 'Em back:",5,50,85,14,-1,-1)
$clearstatslabel=GUICtrlCreateLabel("Clear mainfolder:",5,70,85,14,-1,-1)
$moveemwithjumper=GUICtrlCreateLabel("Move 'Em with jumperoption on:",5,90,85,32,-1,-1)
$movemamountlabel=GUICtrlCreateLabel($counter,100,30,40,14,-1,-1)
$moveembackamountlabel=GUICtrlCreateLabel($counterback,100,50,40,14,-1,-1)
$clearmainfolderamountlabel=GUICtrlCreateLabel($counterclear,100,70,40,14,-1,-1)
$moveemwithjoamountlabel=GUICtrlCreateLabel($counterextra,100,105,40,14,-1,-1)
$statsinfolabel=GUICtrlCreateLabel("Gives you the amount of each operation ;-)",16,141,144,25,-1,-1)
$statsgroup=GUICtrlCreateGroup("",3,22,163,103,-1,-1)
While 1
$msgstats=GUIGetMsg()
If $msgstats=$GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc
Zeile 25 neu:
If $msgstats=$GUI_EVENT_CLOSE Then GUIDelete($gui_stats)
Zeile 9 neu:
$gui_stats = GUICreate("Stats",184,177)
peethebee
mh das komische ist nur wenn ich jetzt während die maingui weiterläuft wieder auf stats klicke um das fenster wieder zu erzeugen kommt nichts mehr?
edit: ach ja und wenn ich dann das eine nun schließen geht ohne dass das andere sich mitschließt kann ich das andere nicht mehr schließen also ich kann mit ExitLoop und der anderen Methode nicht mehr herraus (taskmanager)
Ja, sorry, hatte noch was vergessen.
So wie du deinen Code aufgebaut hast, musst du wohl nach dem GUIDelete noch ein GUiSwitch($gui_modmove) einbauen.
Außerdem muss du
$gui_modmove = GUICreate("moDMove 3.0 by lev",269,200)
machen.
Ich hoffe, das reicht dann schon,
peethebee
mh nein funktioniert trotzdem nicht
wie kann ich denn das besser aufbauen?
Hi!
Beide GUIs am Anfang aufbauen und nur eine sichtbar machen.
Danach jeweils die Sichtbarkeit mit GUISetState umschalten (@SW_SHOW, @SW_HIDE).
peethebee
ja daran hab ich auch gedacht jedoch hab ich bei meinen ersten versuchen, dann das statsfenster nur einmal bekommen naja ich werde es nochmal probieren
edit: irgendwie funktioniert das auch nicht
Zeig mal Code, bitte!
Es funktioniert definitiv, ich habe es in Galenda auch so umgesetzt
peethebee
code:
#include <GUIConstants.au3>
#include-once <file.au3>
#NoTrayIcon
;Variablen werden gelesen:
$firstrun = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "firstrun", "no")
$counterback = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "countermoveback", "0")
$counter = Iniread(@ScriptDir & "\modmove.ini", "Programminfo", "counter" ,"0")
$counterextra = Iniread(@ScriptDir & "\modmove.ini", "Programminfo", "counterextra", "0")
$counterclear = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "counterclear", "0")
$devmapsaveposmod = IniRead(@ScriptDir & "\modmove.ini", "Extra", "devmapsavemod", "no")
$filepath=IniRead(@ScriptDir & "\modmove.ini", "Folder", "filepath", "notset")
$languagefilename = "english"
$language=IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "language", "eng")
_language()
Dim $INIPfad = @ScriptDir & "\modmove.ini"
Dim $QuellPfad = $filepath
Dim $ZielPfad = $filepath & "modmove\"
$arNoMove = IniReadSection($INIPfad, "NoMove")
;first run Anfang
If $firstrun="no" Then
SplashTextOn("First Run of moDMove 4s", "Be sure that u have read moDMove.txt and change all values under options",200,60)
sleep(4000)
SplashOff()
IniWrite(@ScriptDir & "\modmove.ini", "Programminfo", "firstrun", "yes")
ENDIf
;first run Ende
; Gui wird erzeugt
FileInstall("F:\Call of Duty 2\main\modmove.jpg", @TempDir & "\modmove.jpg", 1)
FileInstall("F:\Call of Duty 2\main\modmove.ico", @TempDir & "\modmove.ico", 1)
$gui_main = GUICreate("moDMove 3.0 by lev",269,200)
GUISetState(@sw_show)
GUISetIcon(@TempDir & "\modmove.ico")
$logo=GUICtrlCreatePic("F:\Call of Duty 2\main\modmove.jpg",0,0,269,64,-1,-1)
$menu_options=GUICtrlCreateMenu("Options",-1,0)
$menu_help=GUICtrlCreateMenu("Help",-1,0)
$help_about=GUICtrlCreateMenuItem("About",$menu_help,10)
$help_stats=GUICtrlCreateMenuItem("Stats",$menu_help,00)
$moveembutton=GUICtrlCreateButton("Move 'Em",5,75,100,20,-1,-1)
$moveembackbutton=GUICtrlCreateButton("Move 'Em back",5,110,100,20,-1,-1)
$clearmainbutton=GUICtrlCreateButton("Clear mainfolder",140,75,100,20,-1,-1)
$nomovelistbutton=GUICtrlCreateButton("NoMove-List",140,110,100,20,-1,-1)
$nomoveshowlabel=GUICtrlCreateLabel("NoMove:",5,166,62,14,-1,-1)
$madebylabel=GUICtrlCreateLabel("made by Leviathan",141,166,113,12,-1,-1)
$nomovegroupcounting=GUICtrlCreateGroup("",-6,159,285,31,-1,-1)
$warnungslabel=GUICtrlCreateLabel("Be sure that u did config under options",22,144,228,14,-1,-1)
;gui stats:
$gui_stats = GUICreate("Stats",184,177)
GUISetState(@sw_hide,$gui_stats)
GUISetIcon(@TempDir & "\modmove.ico")
$imoveemstats=GUICtrlCreateLabel("Move 'Em:",5,30,85,14,-1,-1)
$statsheader=GUICtrlCreateLabel("Stats:",6,6,67,14,-1,-1)
$moveemback=GUICtrlCreateLabel("Move 'Em back:",5,50,85,14,-1,-1)
$clearstatslabel=GUICtrlCreateLabel("Clear mainfolder:",5,70,85,14,-1,-1)
$moveemwithjumper=GUICtrlCreateLabel("Move 'Em with jumperoption on:",5,90,85,32,-1,-1)
$movemamountlabel=GUICtrlCreateLabel($counter,100,30,40,14,-1,-1)
$moveembackamountlabel=GUICtrlCreateLabel($counterback,100,50,40,14,-1,-1)
$clearmainfolderamountlabel=GUICtrlCreateLabel($counterclear,100,70,40,14,-1,-1)
$moveemwithjoamountlabel=GUICtrlCreateLabel($counterextra,100,105,40,14,-1,-1)
$statsinfolabel=GUICtrlCreateLabel("Gives you the amount of each operation ;-)",16,141,144,25,-1,-1)
$statsgroup=GUICtrlCreateGroup("",3,22,163,103,-1,-1)
;gui stats ende
While 1
$msg=GUIGetMsg()
If $msg=$GUI_EVENT_CLOSE Then ExitLoop
If $msg=$moveembackbutton Then _movemodsback()
If $msg=$moveembutton Then _movemods()
If $msg=$help_about Then _about()
If $msg=$help_stats Then _stats()
WEnd
; Funktionen (eigene) ====================================================================================================================================
[/autoit] [autoit][/autoit] [autoit];Sprache Anfang
Func _language()
If $language="eng" Then
$languagefilename = "english"
_cod2fileslanguageset()
Else
If $language="ger" Then
$languagefilename = "german"
_cod2fileslanguageset()
Else
Exit
EndIf
EndIf
EndFunc
Func _cod2fileslanguageset()
IniWrite(@ScriptDir &"\modmove.ini", "NoMove", "wert1", "localized_" & $languagefilename & "_iw00.iwd")
IniWrite(@ScriptDir &"\modmove.ini", "NoMove", "wert2", "localized_" & $languagefilename & "_iw01.iwd")
IniWrite(@ScriptDir &"\modmove.ini", "NoMove", "wert3", "localized_" & $languagefilename & "_iw02.iwd")
IniWrite(@ScriptDir &"\modmove.ini", "NoMove", "wert4", "localized_" & $languagefilename & "_iw03.iwd")
IniWrite(@ScriptDir &"\modmove.ini", "NoMove", "wert5", "localized_" & $languagefilename & "_iw04.iwd")
IniWrite(@ScriptDir &"\modmove.ini", "NoMove", "wert6", "localized_" & $languagefilename & "_iw05.iwd")
IniWrite(@ScriptDir &"\modmove.ini", "NoMove", "wert7", "localized_" & $languagefilename & "_iw06.iwd")
IniWrite(@ScriptDir &"\modmove.ini", "NoMove", "wert8", "localized_" & $languagefilename & "_iw07.iwd")
IniWrite(@ScriptDir &"\modmove.ini", "NoMove", "wert9", "localized_" & $languagefilename & "_iw08.iwd")
IniWrite(@ScriptDir &"\modmove.ini", "NoMove", "wert10", "localized_" & $languagefilename & "_iw09.iwd")
IniWrite(@ScriptDir &"\modmove.ini", "NoMove", "wert11", "localized_" & $languagefilename & "_iw10.iwd")
IniWrite(@ScriptDir &"\modmove.ini", "NoMove", "wert12", "localized_" & $languagefilename & "_iw11.iwd")
ENDFunc
; Sprache Ende
; Moveback Anfang
Func _movemodsback()
FileMove($ZielPfad & "*.iwd", $QuellPfad, 1)
$icounterback = $counterback +1
IniWrite(@ScriptDir & "\modmove.ini", "Programminfo", "countermoveback", $icounterback)
ENDFunc
; Moveback Ende
; Move Anfang
Func _movemods()
$AllModFiles = _FileListToArray($QuellPfad, "*.iwd")
For $i = 1 To $AllModFiles[0]
For $k = 1 To $arNoMove[0][0]
; Dateien markieren, die nicht verschoben werden sollen
If $AllModFiles[$i] = $arNoMove[$k][1] Then $AllModFiles[$i] &= "|"
Next
Next
For $i = 1 To $AllModFiles[0]
; nicht markierte Dateien verschieben
If StringRight($AllModFiles[$i], 1) <> "|" Then FileMove($QuellPfad & $AllModFiles[$i], $ZielPfad)
Next
;counter
Select
case $devmapsaveposmod = "yes"
FileMove($filepath & "modmove\zzz_Save_position_mod_V1.0.iwd", $filepath)
FileMove($filepath & "modmove\zzz_999_nades.iwd", $filepath)
$iextra = $counterextra +1
IniWrite(@ScriptDir & "\modmove.ini", "Programminfo", "counterextra", $iextra)
case Else
;counting the amount of movements
$icounter = $counter + 1
IniWrite(@ScriptDir & "\modmove.ini", "Programminfo", "counter", $icounter)
EndSelect
EndFunc
;Move Ende
;Clear Anfang
;Clear Ende
; About Anfang
Func _about()
GUICreate("About moDMove3.0",246,170)
GUISetState(@sw_show)
GUISetIcon(@TempDir & "\modmove.ico")
$aboutext1=GUICtrlCreateLabel("moDMove 3.0 made by Leviathan NOTE: I'm not responsible for any damage caused by this programme",8,5,230,54,-1,-1)
$abouttext2=GUICtrlCreateLabel("Thanks to:",8,64,55,14,-1,-1)
$aboutthanks=GUICtrlCreateLabel("bug bear; autoit.de and codjumper.com",69,81,169,29,-1,-1)
$levwww=GUICtrlCreateLabel("www.leviathan-design.de",20,116,130,14,-1,-1)
$autoitwww=GUICtrlCreateLabel("www.autoit.de",20,130,101,14,-1,-1)
$cjwww=GUICtrlCreateLabel("www.codjumper.com",20,144,108,14,-1,-1)
$grpthanks=GUICtrlCreateGroup("",62,68,122,44,-1,-1)
$grpnote=GUICtrlCreateGroup("READ",6,18,204,46,-1,-1)
$muhbutton=GUICtrlCreateButton("muh",173,141,59,19,-1,-1)
While 1
$msgabout=GUIGetMsg()
If $msgabout=$GUI_EVENT_CLOSE Then ExitLoop
If $msgabout=$muhbutton Then
MsgBox(64, "Report bugs", "Report bugs to [email='geil.sandra@web.de'][/email] close in:4 secs", 3)
Exitloop
EndIF
WEnd
EndFunc
; About Ende
; Stats Anfang
Func _stats()
;Hier werden die jeweilige Anzahl aus der ini-file geladen:
$counterback = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "countermoveback", "0")
$counter = Iniread(@ScriptDir & "\modmove.ini", "Programminfo", "counter" ,"0")
$counterextra = Iniread(@ScriptDir & "\modmove.ini", "Programminfo", "counterextra", "0")
$counterclear = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "counterclear", "0")
GUISetState(@sw_show,$gui_stats)
[/autoit] [autoit][/autoit] [autoit]While 1
$msgstats=GUIGetMsg()
If $msgstats=$GUI_EVENT_CLOSE Then
GUISetState(@sw_hide,$gui_stats)
GUISwitch($gui_main)
WinActivate("moDMove 3.0 by lev")
EndIf
WEnd
EndFunc
; Stats Ende
+ini
; Please edit the rigth Filepath to your Call of Duty 2 main folder
; Be sure to put a \ behind the last Foldername
[Programminfo]
firstrun=yes
pversion=1.0
OS=XP
counter=1
; counter gives u the amount of movements
counterextra=0
; counterextra gives u the amount of movements with devmaosavemod=yes
countermoveback=1
; countermoveback gives u the amount of backmovments
counterclear=0
;gives u the amount of clearings
language=eng
; language = is really important to be set /for german pls set it to "ger" without "" for english set it to eng(default)
[Folder]
filepath=F:\Call of Duty 2\main\
; edit only the line above dont forget the \ at the end
; example: F:\Call of Duty 2\main\
[Extra]
devmapsavemod=no
; if u set devmapsavemod=yes then it will move the savepositionmod1.0, 999-nademod back to your mainfolder // set to yes to enable it
; be sure that the modsname are : zzz_999_nades.iwd / zzz_Save_position_mod_V1.0.iwd
#cs /----------------------------------------------------------------/
; NoMove-Section
;
;Ok here are the files that wont be moved; you can add here your own files below
;but dont change wert1-wert28 you must change the language above not here the script will define the right filenames for the language
#ce/----------------------------------------------------------------/
[NoMove]
wert1=localized_english_iw00.iwd
wert2=localized_english_iw01.iwd
wert3=localized_english_iw02.iwd
wert4=localized_english_iw03.iwd
wert5=localized_english_iw04.iwd
wert6=localized_english_iw05.iwd
wert7=localized_english_iw06.iwd
wert8=localized_english_iw07.iwd
wert9=localized_english_iw08.iwd
wert10=localized_english_iw09.iwd
wert11=localized_english_iw10.iwd
wert12=localized_english_iw11.iwd
wert13=iw_01.iwd
wert14=iw_02.iwd
wert15=iw_03.iwd
wert16=iw_04.iwd
wert17=iw_05.iwd
wert18=iw_06.iwd
wert19=iw_07.iwd
wert20=iw_08.iwd
wert21=iw_09.iwd
wert22=iw_10.iwd
wert23=iw_11.iwd
wert24=iw_12.iwd
wert25=iw_13.iwd
wert26=iw_14.iwd
wert27=iw_15.iwd
wert28=iw_00.iwd
; wert29=jm_castle.iwd <-- example
; you can add here more values like maps that u want to keep in your main-folder
;for that u have to write in the next line: wert29=mapname.iwd and so on always in a new line !
;if u are running the Programm while editing u wont see any effect so start it again
Alles anzeigen
bernd670: Spoiler korigiert, verschachtelte Spoiler sind nicht möglich!
Hi,
wieso packst du nicht alles in eine GUi-Schleife? Wie ich es oben beschrieben habe? Na ja, viele Wege führen nach Rom.
So long,
Mega
Hi,
ungefähr so, habe es schnell mal probiert:
#include <GUIConstants.au3>
#include<file.au3>
;#NoTrayIcon
;Variablen werden gelesen:
$firstrun = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "firstrun", "no")
$counterback = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "countermoveback", "0")
$counter = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "counter", "0")
$counterextra = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "counterextra", "0")
$counterclear = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "counterclear", "0")
$devmapsaveposmod = IniRead(@ScriptDir & "\modmove.ini", "Extra", "devmapsavemod", "no")
$filepath = IniRead(@ScriptDir & "\modmove.ini", "Folder", "filepath", "notset")
$languagefilename = "english"
$language = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "language", "eng")
_language()
Dim $INIPfad = @ScriptDir & "\modmove.ini"
Dim $QuellPfad = $filepath
Dim $ZielPfad = $filepath & "modmove\"
$arNoMove = IniReadSection($INIPfad, "NoMove")
;first run Anfang
If $firstrun = "no" Then
SplashTextOn("First Run of moDMove 4s", "Be sure that u have read moDMove.txt and change all values under options", 200, 60)
Sleep(4000)
SplashOff()
IniWrite(@ScriptDir & "\modmove.ini", "Programminfo", "firstrun", "yes")
EndIf
;first run Ende
; Gui wird erzeugt
FileInstall("F:\Call of Duty 2\main\modmove.jpg", @TempDir & "\modmove.jpg", 1)
FileInstall("F:\Call of Duty 2\main\modmove.ico", @TempDir & "\modmove.ico", 1)
$gui_main = GUICreate("moDMove 3.0 by lev", 269, 200)
GUISetState(@SW_SHOW)
GUISetIcon(@TempDir & "\modmove.ico")
$logo = GUICtrlCreatePic("F:\Call of Duty 2\main\modmove.jpg", 0, 0, 269, 64, -1, -1)
$menu_options = GUICtrlCreateMenu("Options", -1, 0)
$menu_help = GUICtrlCreateMenu("Help", -1, 0)
$help_about = GUICtrlCreateMenuitem("About", $menu_help, 10)
$help_stats = GUICtrlCreateMenuitem("Stats", $menu_help, 00)
$moveembutton = GUICtrlCreateButton("Move 'Em", 5, 75, 100, 20, -1, -1)
$moveembackbutton = GUICtrlCreateButton("Move 'Em back", 5, 110, 100, 20, -1, -1)
$clearmainbutton = GUICtrlCreateButton("Clear mainfolder", 140, 75, 100, 20, -1, -1)
$nomovelistbutton = GUICtrlCreateButton("NoMove-List", 140, 110, 100, 20, -1, -1)
$nomoveshowlabel = GUICtrlCreateLabel("NoMove:", 5, 166, 62, 14, -1, -1)
$madebylabel = GUICtrlCreateLabel("made by Leviathan", 141, 166, 113, 12, -1, -1)
$nomovegroupcounting = GUICtrlCreateGroup("", -6, 159, 285, 31, -1, -1)
$warnungslabel = GUICtrlCreateLabel("Be sure that u did config under options", 22, 144, 228, 14, -1, -1)
;gui stats:
$gui_stats = GUICreate("Stats", 184, 177)
GUISetState(@SW_HIDE, $gui_stats)
GUISetIcon(@TempDir & "\modmove.ico")
$imoveemstats = GUICtrlCreateLabel("Move 'Em:", 5, 30, 85, 14, -1, -1)
$statsheader = GUICtrlCreateLabel("Stats:", 6, 6, 67, 14, -1, -1)
$moveemback = GUICtrlCreateLabel("Move 'Em back:", 5, 50, 85, 14, -1, -1)
$clearstatslabel = GUICtrlCreateLabel("Clear mainfolder:", 5, 70, 85, 14, -1, -1)
$moveemwithjumper = GUICtrlCreateLabel("Move 'Em with jumperoption on:", 5, 90, 85, 32, -1, -1)
$movemamountlabel = GUICtrlCreateLabel($counter, 100, 30, 40, 14, -1, -1)
$moveembackamountlabel = GUICtrlCreateLabel($counterback, 100, 50, 40, 14, -1, -1)
$clearmainfolderamountlabel = GUICtrlCreateLabel($counterclear, 100, 70, 40, 14, -1, -1)
$moveemwithjoamountlabel = GUICtrlCreateLabel($counterextra, 100, 105, 40, 14, -1, -1)
$statsinfolabel = GUICtrlCreateLabel("Gives you the amount of each operation ;-)", 16, 141, 144, 25, -1, -1)
$statsgroup = GUICtrlCreateGroup("", 3, 22, 163, 103, -1, -1)
;gui stats ende
$about = GUICreate("About moDMove3.0", 246, 170)
GUISetState(@SW_HIDE)
GUISetIcon(@TempDir & "\modmove.ico")
$aboutext1 = GUICtrlCreateLabel("moDMove 3.0 made by Leviathan NOTE: I'm not responsible for any damage caused by this programme", 8, 5, 230, 54, -1, -1)
$abouttext2 = GUICtrlCreateLabel("Thanks to:", 8, 64, 55, 14, -1, -1)
$aboutthanks = GUICtrlCreateLabel("bug bear; autoit.de and codjumper.com", 69, 81, 169, 29, -1, -1)
$levwww = GUICtrlCreateLabel("www.leviathan-design.de", 20, 116, 130, 14, -1, -1)
$autoitwww = GUICtrlCreateLabel("www.autoit.de", 20, 130, 101, 14, -1, -1)
$cjwww = GUICtrlCreateLabel("www.codjumper.com", 20, 144, 108, 14, -1, -1)
$grpthanks = GUICtrlCreateGroup("", 62, 68, 122, 44, -1, -1)
$grpnote = GUICtrlCreateGroup("READ", 6, 18, 204, 46, -1, -1)
$muhbutton = GUICtrlCreateButton("muh", 173, 141, 59, 19, -1, -1)
While 1
$msg = GUIGetMsg(1)
If $msg[0] = $GUI_EVENT_CLOSE And $msg[1] = $gui_main Then ExitLoop
If $msg[0] = $GUI_EVENT_CLOSE And $msg[1] = $gui_stats Then GUISetState(@SW_HIDE, $gui_stats)
If $msg[0] = $moveembackbutton And $msg[1] = $gui_main Then _movemodsback()
If $msg[0] = $moveembutton And $msg[1] = $gui_main Then _movemods()
If $msg[0] = $help_about And $msg[1] = $gui_main Then _about()
If $msg[0] = $help_stats And $msg[1] = $gui_main Then _stats()
If $msg[0] = $muhbutton And $msg[1] = $about Then MsgBox(0, "", "Muh geclicked")
If $msg[0] = $GUI_EVENT_CLOSE And $msg[1] = $about Then GUISetState(@SW_HIDE, $about)
WEnd
; Funktionen (eigene) ====================================================================================================================================
[/autoit] [autoit][/autoit] [autoit];Sprache Anfang
Func _language()
If $language = "eng" Then
$languagefilename = "english"
_cod2fileslanguageset()
Else
If $language = "ger" Then
$languagefilename = "german"
_cod2fileslanguageset()
Else
Exit
EndIf
EndIf
EndFunc ;==>_language
Func _cod2fileslanguageset()
IniWrite(@ScriptDir & "\modmove.ini", "NoMove", "wert1", "localized_" & $languagefilename & "_iw00.iwd")
IniWrite(@ScriptDir & "\modmove.ini", "NoMove", "wert2", "localized_" & $languagefilename & "_iw01.iwd")
IniWrite(@ScriptDir & "\modmove.ini", "NoMove", "wert3", "localized_" & $languagefilename & "_iw02.iwd")
IniWrite(@ScriptDir & "\modmove.ini", "NoMove", "wert4", "localized_" & $languagefilename & "_iw03.iwd")
IniWrite(@ScriptDir & "\modmove.ini", "NoMove", "wert5", "localized_" & $languagefilename & "_iw04.iwd")
IniWrite(@ScriptDir & "\modmove.ini", "NoMove", "wert6", "localized_" & $languagefilename & "_iw05.iwd")
IniWrite(@ScriptDir & "\modmove.ini", "NoMove", "wert7", "localized_" & $languagefilename & "_iw06.iwd")
IniWrite(@ScriptDir & "\modmove.ini", "NoMove", "wert8", "localized_" & $languagefilename & "_iw07.iwd")
IniWrite(@ScriptDir & "\modmove.ini", "NoMove", "wert9", "localized_" & $languagefilename & "_iw08.iwd")
IniWrite(@ScriptDir & "\modmove.ini", "NoMove", "wert10", "localized_" & $languagefilename & "_iw09.iwd")
IniWrite(@ScriptDir & "\modmove.ini", "NoMove", "wert11", "localized_" & $languagefilename & "_iw10.iwd")
IniWrite(@ScriptDir & "\modmove.ini", "NoMove", "wert12", "localized_" & $languagefilename & "_iw11.iwd")
EndFunc ;==>_cod2fileslanguageset
; Sprache Ende
; Moveback Anfang
Func _movemodsback()
FileMove($ZielPfad & "*.iwd", $QuellPfad, 1)
$icounterback = $counterback + 1
IniWrite(@ScriptDir & "\modmove.ini", "Programminfo", "countermoveback", $icounterback)
EndFunc ;==>_movemodsback
; Moveback Ende
; Move Anfang
Func _movemods()
$AllModFiles = _FileListToArray($QuellPfad, "*.iwd")
For $i = 1 To $AllModFiles[0]
For $k = 1 To $arNoMove[0][0]
; Dateien markieren, die nicht verschoben werden sollen
If $AllModFiles[$i] = $arNoMove[$k][1] Then $AllModFiles[$i] &= "|"
Next
Next
For $i = 1 To $AllModFiles[0]
; nicht markierte Dateien verschieben
If StringRight($AllModFiles[$i], 1) <> "|" Then FileMove($QuellPfad & $AllModFiles[$i], $ZielPfad)
Next
;counter
Select
Case $devmapsaveposmod = "yes"
FileMove($filepath & "modmove\zzz_Save_position_mod_V1.0.iwd", $filepath)
FileMove($filepath & "modmove\zzz_999_nades.iwd", $filepath)
$iextra = $counterextra + 1
IniWrite(@ScriptDir & "\modmove.ini", "Programminfo", "counterextra", $iextra)
Case Else
;counting the amount of movements
$icounter = $counter + 1
IniWrite(@ScriptDir & "\modmove.ini", "Programminfo", "counter", $icounter)
EndSelect
EndFunc ;==>_movemods
;Move Ende
;Clear Anfang
;Clear Ende
; About Anfang
Func _about()
GUISetState(@SW_SHOW)
EndFunc ;==>_about
; About Ende
; Stats Anfang
Func _stats()
;Hier werden die jeweilige Anzahl aus der ini-file geladen:
$counterback = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "countermoveback", "0")
$counter = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "counter", "0")
$counterextra = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "counterextra", "0")
$counterclear = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "counterclear", "0")
GUISetState(@SW_SHOW, $gui_stats)
EndFunc ;==>_stats
; Stats Ende
So long,
Mega
ah ok ich hab das irgendwie noch nicht so ganz verstanden
If $msg[0] = $GUI_EVENT_CLOSE And $msg[1] = $gui_main Then ExitLoop
die null und die 1 sind das dann rückgabewerte?
aber es funktioniert
Das ist die Stelle eines Arrays.
Ein Array, ist eine Variable die mehrere Werte haben kann, welchen Wert du meinst, bekommste mit diesem Index heraus.
Ne Excel-Zeile vorstellen, wo jeder Kasten ein Index (ein Wert) im Array ist.
Dim $Array[3] ;Array hat 3 Stellen.
Dim $Array[3] = ["Wert1", "Wert2", "Wert3"] ;Werte im Array direkt.
$Array[0] wäre dann Wert1
$Array[1] wäre dann Wert2
usw.
Guckst du hier:
ZitatAlles anzeigenFunction Reference
GUIGetMsg
--------------------------------------------------------------------------------Polls the GUI to see if any events have occurred.
GUIGetMsg ( [advanced] )
Parameters
advanced [optional] return extended information in an array.
0 = (default) Returns a single event.
1 = returns an array containing the event and extended information.
Return Value
Returns an event, or an array depending on the "advanced" parameter.
The "event" returned is the control ID of the control sending the message, or it is a special event (like the window is closing, minimizing). Or if there is no message, the event is 0.
Event ID the ID of the control sending the message
0 No event
$GUI_EVENT_CLOSE dialog box being closed (either by defined button or system menu).
$GUI_EVENT_MINIMIZE dialog box minimized with Windows title bar button.
$GUI_EVENT_RESTORE dialog box restored by click on task bar icon.
$GUI_EVENT_MAXIMIZE dialog box maximized with Windows title bar button.
$GUI_EVENT_MOUSEMOVE the mouse cursor has moved.
$GUI_EVENT_PRIMARYDOWN the primary mouse button was pressed.
$GUI_EVENT_PRIMARYUP the primary mouse button was released.
$GUI_EVENT_SECONDARYDOWN the secondary mouse button was pressed.
$GUI_EVENT_SECONDARYUP the secondary mouse button was released.
$GUI_EVENT_RESIZED dialog box has been resized.
$GUI_EVENT_DROPPED End of a Drag&Drop action @GUI_DRAGID, @GUI_DRAGFILE and @GUI_DROPID will be used to retrieve the ID's/file corresponding to the involve control.
When using the "advanced" parameter the information is returned in an array with extended information:
$array[0] = 0 or Event ID or Control ID
$array[1] = The window handle the event is from
$array[2] = The control handle the event is from (if applicable)
$array[3] = The current X position of the mouse cursor (relative to the GUI window)
$array[4] = The current Y position of the mouse cursor (relative to the GUI window)
If the GUIOnEventMode option is set to 1 then the return from GUIGetMsg is always 0 and the @error is set to 1.
If the option GUIEventOptions is set to 1 the minimize, restore and maximize button will not do any action on the window just a simple notification.
Remarks
This function automatically idles the CPU when required so that it can be safely used in tight loops without hogging all the CPU.
Information about the mouse position and the hovering control can be retrieved with GUIGetCursorInfo. No event is fired when the mouse is over a control so GUIGetCursorInfo must be called to retrieve the ControlID.
dazu hätte ich mal eine frage und zwar kann ich ja mit IniReadSection eine Sektion auslesen und er gibt mir das in einem array wieder wie kann ich da die anzahl der werte ermitteln also ich hab 28 feste werte in der ini und möchte dann immer über ein eingabefeld neue hinzufügen, aber dazu muss ich ja immer die anzahl wissen; gibst da auch eine funktion die ich mit der hilfe nicht gefunden habe?
[Folder]
wert1=fasf
wert2=234
....
wert28=3434
wert29=dasf
ah habs selbst gefunden:The number of elements returned will be in $result[0][0]. If an @error occurs, no array is created.
UBound($Array) gibt den Index zurück. Da musst aber -1 machen, wenn du es in eine Schleife einarbeitest, da ein Index bei 0 anfängt!
IniReadSection gibt ein Array das im Index $array[0][0] die Anzahl der Elemente führt.
OK, habe es jetzt irgendwie Allgemein gedacht. Aber meine Aussage stimmt bei Eigendimensionen
mh habe es auch gerade herrausgefunden