Помогите допилить...
все что работает и не нужное удалил - по коду все и так будет понятно
все что работает и не нужное удалил - по коду все и так будет понятно
Код:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <File.au3>
Global $Profile[9] = [0, 0, 0, 0, 0, 0, 0, 0, 0]
Global $Instance[9] = [0, 0, 0, 0, 0, 0, 0, 0, 0]
Global $Launch[9] = [0, 0, 0, 0, 0, 0, 0, 0, 0]
Global $ProfileSelect[9] = [0, 0, 0, 0, 0, 0, 0, 0, 0]
Global $Emulator = "EMU"
Global $ManagerConfig = @ScriptDir & "\ManagerConfig.ini"
; ================================================== GUI PART ================================================== ;
GUICreate("Test", 540, 553, 192, 124)
GUISetIcon(@ScriptDir & "\images\Launcher.ico")
GUICtrlCreateGroup("", 5, 70, 530, 255)
$ProfileSelect[1] = GUICtrlCreateCheckbox ("", 11, 85, 15, 20)
$ProfileSelect[2] = GUICtrlCreateCheckbox ("", 11, 115, 15, 20)
$ProfileSelect[3] = GUICtrlCreateCheckbox ("", 11, 145, 15, 20)
$ProfileSelect[4] = GUICtrlCreateCheckbox ("", 11, 175, 15, 20)
$ProfileSelect[5] = GUICtrlCreateCheckbox ("", 11, 205, 15, 20)
$ProfileSelect[6] = GUICtrlCreateCheckbox ("", 11, 235, 15, 20)
$ProfileSelect[7] = GUICtrlCreateCheckbox ("", 11, 265, 15, 20)
$ProfileSelect[8] = GUICtrlCreateCheckbox ("", 11, 295, 15, 20)
$Instance[1] = GUICtrlCreateInput("Instance_1", 30, 85, 200, 20)
$Instance[2] = GUICtrlCreateInput("Instance_2", 30, 115, 200, 20)
$Instance[3] = GUICtrlCreateInput("Instance_3", 30, 145, 200, 20)
$Instance[4] = GUICtrlCreateInput("Instance_4", 30, 175, 200, 20)
$Instance[5] = GUICtrlCreateInput("Instance_5", 30, 205, 200, 20)
$Instance[6] = GUICtrlCreateInput("Instance_6", 30, 235, 200, 20)
$Instance[7] = GUICtrlCreateInput("Instance_7", 30, 265, 200, 20)
$Instance[8] = GUICtrlCreateInput("Instance_8", 30, 295, 200, 20)
$Profile[1] = GUICtrlCreateInput("Profile_1", 240, 85, 210, 20)
$Profile[2] = GUICtrlCreateInput("Profile_2", 240, 115, 210, 20)
$Profile[3] = GUICtrlCreateInput("Profile_3", 240, 145, 210, 20)
$Profile[4] = GUICtrlCreateInput("Profile_4", 240, 175, 210, 20)
$Profile[5] = GUICtrlCreateInput("Profile_5", 240, 205, 210, 20)
$Profile[6] = GUICtrlCreateInput("Profile_6", 240, 235, 210, 20)
$Profile[7] = GUICtrlCreateInput("Profile_7", 240, 265, 210, 20)
$Profile[8] = GUICtrlCreateInput("Profile_8", 240, 295, 210, 20)
$Launch[1] = GUICtrlCreateButton("Launch !", 460, 85, 70, 20)
$Launch[2] = GUICtrlCreateButton("Launch !", 460, 115, 70, 20)
$Launch[3] = GUICtrlCreateButton("Launch !", 460, 145, 70, 20)
$Launch[4] = GUICtrlCreateButton("Launch !", 460, 175, 71, 20)
$Launch[5] = GUICtrlCreateButton("Launch !", 460, 205, 70, 20)
$Launch[6] = GUICtrlCreateButton("Launch !", 460, 235, 70, 20)
$Launch[7] = GUICtrlCreateButton("Launch !", 460, 265, 70, 20)
$Launch[8] = GUICtrlCreateButton("Launch !", 460, 295, 70, 20)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$SelAll = GUICtrlCreateButton ("Select All", 5, 330, 170, 25)
$SelNone = GUICtrlCreateButton ("Select None", 185, 330, 170, 25)
$SelRun = GUICtrlCreateButton ("Launch Selected", 365, 330, 170, 25)
;================================================================================
;$OpenMultiMEmu = GUICtrlCreateButton("Open Multi MEmu", 5, 380, 126, 26)
;$OpenMultiDroid4X = GUICtrlCreateButton("Open Multi Droid4X", 140, 380, 126, 26)
;$OpenMultiNox = GUICtrlCreateButton("Open Multi Nox", 275, 380, 126, 26)
;$OpenMultiLeapDroid = GUICtrlCreateButton("Open Multi LeapDroid", 410, 380, 126, 26)
;================================================================================
ReadnApplyConfig()
GUISetState(@SW_SHOW)
; ================================================== FUNCTIONS PART ================================================== ;
Func SaveConfig()
IniWrite($ManagerConfig, "ProfileNames", "ProfileName[1]", GUICtrlRead($Profile[1]))
IniWrite($ManagerConfig, "ProfileNames", "ProfileName[2]", GUICtrlRead($Profile[2]))
IniWrite($ManagerConfig, "ProfileNames", "ProfileName[3]", GUICtrlRead($Profile[3]))
IniWrite($ManagerConfig, "ProfileNames", "ProfileName[4]", GUICtrlRead($Profile[4]))
IniWrite($ManagerConfig, "ProfileNames", "ProfileName[5]", GUICtrlRead($Profile[5]))
IniWrite($ManagerConfig, "ProfileNames", "ProfileName[6]", GUICtrlRead($Profile[6]))
IniWrite($ManagerConfig, "ProfileNames", "ProfileName[7]", GUICtrlRead($Profile[7]))
IniWrite($ManagerConfig, "ProfileNames", "ProfileName[8]", GUICtrlRead($Profile[8]))
IniWrite($ManagerConfig, "InstanceNames", "InstanceName[1]", GUICtrlRead($Instance[1]))
IniWrite($ManagerConfig, "InstanceNames", "InstanceName[2]", GUICtrlRead($Instance[2]))
IniWrite($ManagerConfig, "InstanceNames", "InstanceName[3]", GUICtrlRead($Instance[3]))
IniWrite($ManagerConfig, "InstanceNames", "InstanceName[4]", GUICtrlRead($Instance[4]))
IniWrite($ManagerConfig, "InstanceNames", "InstanceName[5]", GUICtrlRead($Instance[5]))
IniWrite($ManagerConfig, "InstanceNames", "InstanceName[6]", GUICtrlRead($Instance[6]))
IniWrite($ManagerConfig, "InstanceNames", "InstanceName[7]", GUICtrlRead($Instance[7]))
IniWrite($ManagerConfig, "InstanceNames", "InstanceName[8]", GUICtrlRead($Instance[8]))
If GUICtrlRead($ProfileSelect[1]) = $GUI_CHECKED Then
IniWrite($ManagerConfig, "SelectedProfiles", "ProfileSelect[1]", 1)
Else
IniWrite($ManagerConfig, "SelectedProfiles", "ProfileSelect[1]", 0)
EndIf
If GUICtrlRead($ProfileSelect[2]) = $GUI_CHECKED Then
IniWrite($ManagerConfig, "SelectedProfiles", "ProfileSelect[2]", 1)
Else
IniWrite($ManagerConfig, "SelectedProfiles", "ProfileSelect[2]", 0)
EndIf
If GUICtrlRead($ProfileSelect[3]) = $GUI_CHECKED Then
IniWrite($ManagerConfig, "SelectedProfiles", "ProfileSelect[3]", 1)
Else
IniWrite($ManagerConfig, "SelectedProfiles", "ProfileSelect[3]", 0)
EndIf
If GUICtrlRead($ProfileSelect[4]) = $GUI_CHECKED Then
IniWrite($ManagerConfig, "SelectedProfiles", "ProfileSelect[4]", 1)
Else
IniWrite($ManagerConfig, "SelectedProfiles", "ProfileSelect[4]", 0)
EndIf
If GUICtrlRead($ProfileSelect[5]) = $GUI_CHECKED Then
IniWrite($ManagerConfig, "SelectedProfiles", "ProfileSelect[5]", 1)
Else
IniWrite($ManagerConfig, "SelectedProfiles", "ProfileSelect[5]", 0)
EndIf
If GUICtrlRead($ProfileSelect[6]) = $GUI_CHECKED Then
IniWrite($ManagerConfig, "SelectedProfiles", "ProfileSelect[6]", 1)
Else
IniWrite($ManagerConfig, "SelectedProfiles", "ProfileSelect[6]", 0)
EndIf
If GUICtrlRead($ProfileSelect[7]) = $GUI_CHECKED Then
IniWrite($ManagerConfig, "SelectedProfiles", "ProfileSelect[7]", 1)
Else
IniWrite($ManagerConfig, "SelectedProfiles", "ProfileSelect[7]", 0)
EndIf
If GUICtrlRead($ProfileSelect[8]) = $GUI_CHECKED Then
IniWrite($ManagerConfig, "SelectedProfiles", "ProfileSelect[8]", 1)
Else
IniWrite($ManagerConfig, "SelectedProfiles", "ProfileSelect[8]", 0)
EndIf
EndFunc ;==>SaveConfig
Func ReadnApplyConfig()
GUICtrlSetData($Profile[1], IniRead($ManagerConfig, "ProfileNames", "Profile[1]", "Profile_1"))
GUICtrlSetData($Profile[2], IniRead($ManagerConfig, "ProfileNames", "Profile[2]", "Profile_2"))
GUICtrlSetData($Profile[3], IniRead($ManagerConfig, "ProfileNames", "Profile[3]", "Profile_3"))
GUICtrlSetData($Profile[4], IniRead($ManagerConfig, "ProfileNames", "Profile[4]", "Profile_4"))
GUICtrlSetData($Profile[5], IniRead($ManagerConfig, "ProfileNames", "Profile[5]", "Profile_5"))
GUICtrlSetData($Profile[6], IniRead($ManagerConfig, "ProfileNames", "Profile[6]", "Profile_6"))
GUICtrlSetData($Profile[7], IniRead($ManagerConfig, "ProfileNames", "Profile[7]", "Profile_7"))
GUICtrlSetData($Profile[8], IniRead($ManagerConfig, "ProfileNames", "Profile[8]", "Profile_8"))
GUICtrlSetData($Instance[1], IniRead($ManagerConfig, "InstanceNames", "Instance[1]", "Instance_1"))
GUICtrlSetData($Instance[2], IniRead($ManagerConfig, "InstanceNames", "Instance[2]", "Instance_2"))
GUICtrlSetData($Instance[3], IniRead($ManagerConfig, "InstanceNames", "Instance[3]", "Instance_3"))
GUICtrlSetData($Instance[4], IniRead($ManagerConfig, "InstanceNames", "Instance[4]", "Instance_4"))
GUICtrlSetData($Instance[5], IniRead($ManagerConfig, "InstanceNames", "Instance[5]", "Instance_5"))
GUICtrlSetData($Instance[6], IniRead($ManagerConfig, "InstanceNames", "Instance[6]", "Instance_6"))
GUICtrlSetData($Instance[7], IniRead($ManagerConfig, "InstanceNames", "Instance[7]", "Instance_7"))
GUICtrlSetData($Instance[8], IniRead($ManagerConfig, "InstanceNames", "Instance[8]", "Instance_8"))
$iSel1 = IniRead($ManagerConfig, "SelectedProfiles", "ProfileSelect[1]", "0")
$iSel2 = IniRead($ManagerConfig, "SelectedProfiles", "ProfileSelect[2]", "0")
$iSel3 = IniRead($ManagerConfig, "SelectedProfiles", "ProfileSelect[3]", "0")
$iSel4 = IniRead($ManagerConfig, "SelectedProfiles", "ProfileSelect[4]", "0")
$iSel5 = IniRead($ManagerConfig, "SelectedProfiles", "ProfileSelect[5]", "0")
$iSel6 = IniRead($ManagerConfig, "SelectedProfiles", "ProfileSelect[6]", "0")
$iSel7 = IniRead($ManagerConfig, "SelectedProfiles", "ProfileSelect[7]", "0")
$iSel8 = IniRead($ManagerConfig, "SelectedProfiles", "ProfileSelect[8]", "0")
If $iSel1 = 1 Then
GUICtrlSetState($ProfileSelect[1], $GUI_CHECKED)
Else
GUICtrlSetState($ProfileSelect[1], $GUI_UNCHECKED)
EndIf
If $iSel2 = 1 Then
GUICtrlSetState($ProfileSelect[2], $GUI_CHECKED)
Else
GUICtrlSetState($ProfileSelect[2], $GUI_UNCHECKED)
EndIf
If $iSel3 = 1 Then
GUICtrlSetState($ProfileSelect[3], $GUI_CHECKED)
Else
GUICtrlSetState($ProfileSelect[3], $GUI_UNCHECKED)
EndIf
If $iSel4 = 1 Then
GUICtrlSetState($ProfileSelect[4], $GUI_CHECKED)
Else
GUICtrlSetState($ProfileSelect[4], $GUI_UNCHECKED)
EndIf
If $iSel5 = 1 Then
GUICtrlSetState($ProfileSelect[5], $GUI_CHECKED)
Else
GUICtrlSetState($ProfileSelect[5], $GUI_UNCHECKED)
EndIf
If $iSel6 = 1 Then
GUICtrlSetState($ProfileSelect[6], $GUI_CHECKED)
Else
GUICtrlSetState($ProfileSelect[6], $GUI_UNCHECKED)
EndIf
If $iSel7 = 1 Then
GUICtrlSetState($ProfileSelect[7], $GUI_CHECKED)
Else
GUICtrlSetState($ProfileSelect[7], $GUI_UNCHECKED)
EndIf
If $iSel8 = 1 Then
GUICtrlSetState($ProfileSelect[8], $GUI_CHECKED)
Else
GUICtrlSetState($ProfileSelect[8], $GUI_UNCHECKED)
EndIf
EndFunc ;==>ReadnApplyConfig
Func SelectAll()
GUICtrlSetState($ProfileSelect[1], $GUI_CHECKED)
GUICtrlSetState($ProfileSelect[2], $GUI_CHECKED)
GUICtrlSetState($ProfileSelect[3], $GUI_CHECKED)
GUICtrlSetState($ProfileSelect[4], $GUI_CHECKED)
GUICtrlSetState($ProfileSelect[5], $GUI_CHECKED)
GUICtrlSetState($ProfileSelect[6], $GUI_CHECKED)
GUICtrlSetState($ProfileSelect[7], $GUI_CHECKED)
GUICtrlSetState($ProfileSelect[8], $GUI_CHECKED)
EndFunc
Func SelectNone()
GUICtrlSetState($ProfileSelect[1], $GUI_UNCHECKED)
GUICtrlSetState($ProfileSelect[2], $GUI_UNCHECKED)
GUICtrlSetState($ProfileSelect[3], $GUI_UNCHECKED)
GUICtrlSetState($ProfileSelect[4], $GUI_UNCHECKED)
GUICtrlSetState($ProfileSelect[5], $GUI_UNCHECKED)
GUICtrlSetState($ProfileSelect[6], $GUI_UNCHECKED)
GUICtrlSetState($ProfileSelect[7], $GUI_UNCHECKED)
GUICtrlSetState($ProfileSelect[8], $GUI_UNCHECKED)
EndFunc
Func RunSelected()
If GUICtrlRead($ProfileSelect[1]) = $GUI_CHECKED Then $Launch[1]
If GUICtrlRead($ProfileSelect[2]) = $GUI_CHECKED Then $Launch[2]
If GUICtrlRead($ProfileSelect[3]) = $GUI_CHECKED Then $Launch[3]
If GUICtrlRead($ProfileSelect[4]) = $GUI_CHECKED Then $Launch[4]
If GUICtrlRead($ProfileSelect[5]) = $GUI_CHECKED Then $Launch[5]
If GUICtrlRead($ProfileSelect[6]) = $GUI_CHECKED Then $Launch[6]
If GUICtrlRead($ProfileSelect[7]) = $GUI_CHECKED Then $Launch[7]
If GUICtrlRead($ProfileSelect[8]) = $GUI_CHECKED Then $Launch[8]
EndFunc
; ================================================== USER ACTIONS PART ================================================== ;
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
SaveConfig()
ExitLoop
Case $Launch[1]
ShellExecute(@ScriptDir & "\Bot.exe", """" & GUICtrlRead($Profile[1]) & """" & " " & $Emulator & " " & """" & GUICtrlRead($Instance[1]) & """")
Case $Launch[2]
ShellExecute(@ScriptDir & "\Bot.exe", """" & GUICtrlRead($Profile[2]) & """" & " " & $Emulator & " " & """" & GUICtrlRead($Instance[2]) & """")
Case $Launch[3]
ShellExecute(@ScriptDir & "\Bot.exe", """" & GUICtrlRead($Profile[3]) & """" & " " & $Emulator & " " & """" & GUICtrlRead($Instance[3]) & """")
Case $Launch[4]
ShellExecute(@ScriptDir & "\Bot.exe", """" & GUICtrlRead($Profile[4]) & """" & " " & $Emulator & " " & """" & GUICtrlRead($Instance[4]) & """")
Case $Launch[5]
ShellExecute(@ScriptDir & "\Bot.exe", """" & GUICtrlRead($Profile[5]) & """" & " " & $Emulator & " " & """" & GUICtrlRead($Instance[5]) & """")
Case $Launch[6]
ShellExecute(@ScriptDir & "\Bot.exe", """" & GUICtrlRead($Profile[6]) & """" & " " & $Emulator & " " & """" & GUICtrlRead($Instance[6]) & """")
Case $Launch[7]
ShellExecute(@ScriptDir & "\Bot.exe", """" & GUICtrlRead($Profile[7]) & """" & " " & $Emulator & " " & """" & GUICtrlRead($Instance[7]) & """")
Case $Launch[8]
ShellExecute(@ScriptDir & "\Bot.exe", """" & GUICtrlRead($Profile[8]) & """" & " " & $Emulator & " " & """" & GUICtrlRead($Instance[8]) & """")
Case $SelAll
SelectAll()
Case $SelNone
SelectNone()
Case $SelRun()
RunSelected()
EndSwitch
WEnd