Hallo Autoit freunde
Ich habe ein Problem mit meinem Minecraft tool ,
nämlich wenn ich verzeichniss ausgewählt habe , und dann auf Start drücke ,
Erstellt es eine .bat , die Minecraft startet... funktioniert soweit noch ,
doch wenn es dann die .bat löscht ,
kommt die "Case $McDir" funktion ... wieso?
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <String.au3>
#include <GuiEdit.au3>
$McChoosen = 0
[/autoit] [autoit][/autoit] [autoit]#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 972, 558, 192, 164)
$Changes = GUICtrlCreateEdit("", 312, 8, 345, 369)
GUICtrlSetData(-1, StringFormat("Welcome to Njahs´s Multitool for Minecraft!\r\nHave fun..."))
$Clear = GUICtrlCreateButton("Clear", 440, 376, 75, 25, 0)
$Minecraftg = GUICtrlCreateGroup("Minecraft", 8, 8, 289, 529)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$McDir = GUICtrlCreateButton("Choose Directory", 184, 24, 105, 25, 0)
$Label1 = GUICtrlCreateLabel("Acc Name:", 24, 80, 66, 17)
$Label2 = GUICtrlCreateLabel("Acc Password:", 24, 120, 88, 17)
$NameInput = GUICtrlCreateInput("", 120, 78, 105, 21)
$PasswordInput = GUICtrlCreateInput("", 120, 117, 105, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
$Start = GUICtrlCreateButton("Start!", 16, 24, 81, 25, 0)
$Label3 = GUICtrlCreateLabel("Skinsteal:", 24, 168, 60, 17)
$Skinstealinput = GUICtrlCreateInput("Playername", 120, 166, 105, 21)
$Steal = GUICtrlCreateButton("Steal", 232, 164, 41, 25, 0)
$Savename = GUICtrlCreateButton("Save!", 232, 74, 41, 25, 0)
$Savepassword = GUICtrlCreateButton("Save!", 232, 115, 41, 25, 0)
$Mcoptions = GUICtrlCreateButton("Options", 112, 24, 57, 25, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
If FileExists (@Scriptdir &"\config.ini") Then
$AccName = Iniread (@Scriptdir &"\config.ini","Account","Name","")
$AccPassword = Iniread (@Scriptdir &"\config.ini","Account","Password","")
GuiCtrlSetData ($NameInput,$Accname)
GuiCtrlSetdata ($PasswordInput,$AccPassword)
Endif
If NOT Iniread (@Scriptdir &"\config.ini","Verzeichnisse","Minecraft.exe","") = "" Then
_GUICtrlEdit_AppendText($Changes,"Minecraft Directory Gefunden!")
$McChoosen += 1
Endif
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $McDir
$McOpen = FileOpenDialog("Wähle Minecraft.exe aus!", @Scriptdir, " (Minecraft.exe)", 1 + 4 )
If NOT @Error Then
$McOpens = StringRegExpReplace ($McOpen,"Minecraft.exe","")
_GUICtrlEdit_SetText ($Changes, "")
Sleep (500)
_GUICtrlEdit_AppendText($Changes,"Minecraft Directory ausgewählt: " & $McOpens)
Iniwrite (@Scriptdir &"\config.ini","Verzeichnisse","Minecraft.exe",$McOpen)
Iniwrite (@Scriptdir &"\config.ini","Verzeichnisse","Minecraft",$McOpens)
$McChoosen += 1
Endif
Case $Clear
_GUICtrlEdit_SetText ($Changes, "Erfolgreich gecleant!")
Sleep (2000)
_GUICtrlEdit_SetText ($Changes, "")
Case $Savename
$Savenameread = GuiCtrlRead ($NameInput)
Iniwrite (@ScriptDir&"\config.ini","Account","NAme",$Savenameread)
Case $Savepassword
$Savepasswordread = GuiCtrlRead ($PasswordInput)
Iniwrite (@ScriptDir&"\config.ini","Account","Password",$Savepasswordread)
Case $Start
If $McChoosen = 1 Then
If NOT Fileexists (@Scriptdir &"\startmc.bat") Then
$Savenameread = GuiCtrlRead ($NameInput)
$Savepasswordread = GuiCtrlRead ($PasswordInput)
$MCDIR = Iniread (@Scriptdir &"\config.ini","Verzeichnisse","Minecraft.exe","")
FileWrite (@Scriptdir &"\startmc.bat",$MCDIR &" "& $Savenameread &" "& $Savepasswordread &" "& "127.0.0.1")
Endif
Shellexecute (@ScriptDir &"\startmc.bat")
Sleep (2000)
FileDelete (@Scriptdir &"\startmc.bat")
Endif
EndSwitch
WEnd