#include <GUIConstants.au3>
#include <GuiComboBox.au3>
#include <GuiListBox.au3>
#include <File.au3>
#include <Array.au3>
Opt('GUICloseOnESC', 0)
Opt('WinTitleMatchMode', 2)
TraySetIcon(@ScriptDir & '\Icon.ico')
Global $mac = 0, $Fin
Global $Button1_Login, $Button2_Login, $Button3_Login, $Button4_Login, $Combo3_Login
Global $Button1_SID, $Button2_SID, $Button3_SID, $Button4_SID, $Combo3_SID
Global $Dir = @ScriptDir & '\Setting.ini'
Global $FileList = _FileListToArray(@ScriptDir & '\settings')
Global $read = IniReadSectionNames($Dir)
Global $hLogin_GUI = _Login_GUI()
Global $hSID_GUI = _SID_GUI()
GUISetState(@SW_SHOW, $hSID_GUI)
While 1
$nMsg = GUIGetMsg(1)
Switch $nMsg[0]
Case 0
ContinueLoop
Case $GUI_EVENT_CLOSE
Exit
Case $Button1_Login, $Button1_SID
;Тут действие при нажатий $Button1
Switch $nMsg[1] ;Это Hwnd текущего окна
Case $hSID_GUI ;Текущее окно это "Avtobiobot v 1.24(SID)"
;Действуем
Case $hLogin_GUI ;Текущее окно это "Avtobiobot v 1.24(Login)"
;Действуем
EndSwitch
Case $Button2_Login, $Button2_SID
;и т.д.
Case $Button3_Login, $Button3_SID
;и т.д.
Case $Button4_Login, $Button4_SID
;и т.д.
Case $Combo3_Login, $Combo3_SID
;Тут мы меняем окна
Switch GUICtrlRead($nMsg[0])
Case 'Enter SID'
GUISetState(@SW_HIDE, $hLogin_GUI)
GUISetState(@SW_SHOW, $hSID_GUI)
GUISwitch($hSID_GUI)
Case 'Enter Login'
GUISetState(@SW_HIDE, $hSID_GUI)
GUISetState(@SW_SHOW, $hLogin_GUI)
GUISwitch($hLogin_GUI)
EndSwitch
EndSwitch
WEnd
Func _SID_GUI()
$hSID_GUI = GUICreate("Avtobiobot v 1.24(SID)", 376, 322, 370, 266)
GUISetIcon("C:\Users\Lexa\Desktop\heroic_autobots.ico")
GUISetBkColor(0xB9D1EA)
$Label1_SID = GUICtrlCreateLabel("SID:", 16, 128, 35, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Input1_SID = GUICtrlCreateInput("", 16, 56, 169, 21)
$Label2_SID = GUICtrlCreateLabel("Name:", 16, 32, 50, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Input2_SID = GUICtrlCreateInput("", 16, 152, 169, 21)
$Label3_SID = GUICtrlCreateLabel("ID:", 16, 80, 23, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Input3_SID = GUICtrlCreateInput("", 16, 104, 169, 21)
$Label4_SID = GUICtrlCreateLabel("Server:", 16, 176, 56, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Input4_SID = GUICtrlCreateInput("", 16, 200, 169, 21)
$Button1_SID = GUICtrlCreateButton("Save", 16, 288, 73, 25)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Button2_SID = GUICtrlCreateButton("Delete", 208, 288, 73, 25)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$List1_SID = GUICtrlCreateList("", 208, 160, 153, 110)
GUICtrlSetData(-1, "")
$Button3_SID = GUICtrlCreateButton("Clear", 112, 288, 73, 25)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Button4_SID = GUICtrlCreateButton("Edit", 289, 288, 73, 25)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Label5_SID = GUICtrlCreateLabel(" Load Settings", 224, 104, 122, 26)
GUICtrlSetFont(-1, 12, 800, 0, "Minion")
$Combo1_SID = GUICtrlCreateCombo("None", 208, 128, 153, 25)
For $K = 1 To UBound($FileList)-1
_GUICtrlComboBox_AddString($Combo1_SID, $FileList[$K])
Next
GUICtrlSetFont(-1, 8, 800, 0, "Palatino Linotype")
$Combo2_SID = GUICtrlCreateCombo("None", 16, 248, 169, 25)
GUICtrlSetData(-1, "1-1|1-2|1-3|1-4|1-5|1-6|1-7|1-8|2-1|2-2|2-3|2-4|2-5|2-6|2-7|2-8|3-1|3-2|3-3|3-4|3-5|3-6|3-7|3-8|4-1|4-2|4-3|4-5")
GUICtrlSetFont(-1, 8, 800, 0, "Palatino Linotype")
$Label6_SID = GUICtrlCreateLabel("Account", 72, 10, 66, 21)
GUICtrlSetFont(-1, 12, 800, 0, "Minion")
$Label7_SID = GUICtrlCreateLabel("Map:", 16, 224, 36, 22)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Label8_SID = GUICtrlCreateLabel("Bot Version:", 208, 32, 80, 22)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Combo3_SID = GUICtrlCreateCombo("Enter SID", 208, 56, 153, 25)
GUICtrlSetData(-1, "Enter Login")
GUICtrlSetFont(-1, 8, 800, 0, "Palatino Linotype")
For $i = 1 To UBound($read)-1
_GUICtrlListBox_AddString($List1_SID, $read[$i])
Next
Return $hSID_GUI
EndFunc
Func _Login_GUI()
$hLogin_GUI = GUICreate("Avtobiobot v 1.24(Login)", 353, 277, 351, 273)
GUISetIcon("C:\Users\Lexa\Desktop\heroic_autobots.ico")
GUISetBkColor(0xB9D1EA)
$Input1_Login = GUICtrlCreateInput("", 8, 64, 153, 21)
$Label2_Login = GUICtrlCreateLabel("Name:", 8, 40, 50, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Label4_Login = GUICtrlCreateLabel("Server:", 8, 136, 56, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Input4_Login = GUICtrlCreateInput("", 8, 160, 153, 21)
$Button1_Login = GUICtrlCreateButton("Save", 8, 240, 73, 25)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Button2_Login = GUICtrlCreateButton("Delete", 184, 240, 73, 25)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Listlog1_Login = GUICtrlCreateList("", 184, 120, 153, 84)
GUICtrlSetData(-1, "")
$Button3_Login = GUICtrlCreateButton("Clear", 88, 240, 73, 25)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Button4_Login = GUICtrlCreateButton("Edit", 265, 240, 73, 25)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Label8_Login = GUICtrlCreateLabel("Start type:", 184, 40, 65, 22)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Combo3_Login = GUICtrlCreateCombo("Enter Login", 184, 64, 153, 25)
GUICtrlSetData(-1, "Enter SID")
GUICtrlSetFont(-1, 8, 800, 0, "Palatino Linotype")
$Label1_Login = GUICtrlCreateLabel("Password:", 8, 88, 64, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Input2_Login = GUICtrlCreateInput("", 8, 112, 153, 21)
$Label3_Login = GUICtrlCreateLabel("Edit .bat", 48, 8, 80, 28)
GUICtrlSetFont(-1, 14, 800, 0, "Franklin Gothic Medium")
$Label5_Login = GUICtrlCreateLabel("Starting .bat", 208, 8, 117, 28)
GUICtrlSetFont(-1, 14, 800, 0, "Franklin Gothic Medium")
$Label6_Login = GUICtrlCreateLabel("Started accoutns:", 184, 96, 107, 22)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Checkbox1_Login = GUICtrlCreateCheckbox("Automatic start BoT", 184, 208, 153, 25)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Label7_Login = GUICtrlCreateLabel("Setting File:", 8, 184, 80, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Input3_Login = GUICtrlCreateInput("", 8, 208, 137, 21)
$Button5_Login = GUICtrlCreateButton("...", 148, 208, 17, 21, 0)
Do
$adds = 0
$rol = FileFindNextFile($Fin)
$fila = StringSplit($rol, '.')
If $rol = '' Then $adds = 1
If $adds <> 1 Then
_GUICtrlListBox_AddString($Listlog1_Login, $fila[1])
EndIf
Until $adds = 1
Return $hLogin_GUI
EndFunc