Что нового

Вызов функции FileOpenDialog без нажатия на кнопку

lexaSF

Новичок
Сообщения
182
Репутация
3
Подскажите,вот код, точнее часть.
Код:
Case $Button5
	$FoD = FileOpenDialog('Choose a file of options',@ScriptDir,'Udobot settings (*.udb)' ,4)
	$ar = StringSplit($FoD,'\')
	ControlSetText('Avtobiobot v 1.24(Login)','','[CLASS:Edit; INSTANCE:5]',$ar[$ar[0]])
		EndSwitch

У меня почему то хотя я и не нажимаю на кнопку, как только создается окно программы вылазиет окошко выбора файла, но не всегда, в большинстве случаев.Подскажите что можно сделать
 

kaster

Мой Аватар, он лучший самый
Команда форума
Глобальный модератор
Сообщения
4,020
Репутация
626
lexaSF
приведи полный код, или хотя бы более менее осмысленный его участок
 

Yashied

Модератор
Команда форума
Глобальный модератор
Сообщения
5,379
Репутация
2,724
А я попробую догадаться. Это происходит потому, что на момент входа в основной цикл, $Button5 = 0.
 

CreatoR

Must AutoIt!
Команда форума
Администратор
Сообщения
8,673
Репутация
2,486
Yashied [?]
Это происходит потому, что на момент входа в основной цикл, $Button5 = 0.
Или $Button5 = одно из значений событий GUIGetMsg ;D.
 

`p r o x y

«Улыбайтесь, господа!»
Команда форума
Глобальный модератор
Сообщения
596
Репутация
157
Поддерживаю, скорее всего $Button5 = 0
 

Yashied

Модератор
Команда форума
Глобальный модератор
Сообщения
5,379
Репутация
2,724
Еще неизвестно, чего он там сравнивает. Почему тогда диалог вызывается не всегда...

Код:
Switch ???
 

`p r o x y

«Улыбайтесь, господа!»
Команда форума
Глобальный модератор
Сообщения
596
Репутация
157
Yashied
Про Switch это не телепато-корректно, там EndSwitch виден ;D
 
Автор
L

lexaSF

Новичок
Сообщения
182
Репутация
3
Вот еще код
Код:
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $Button5
	$FoD = FileOpenDialog('Choose a file of options',@ScriptDir,'Udobot settings (*.udb)' ,4)
	$ar = StringSplit($FoD,'\')
	ControlSetText('Avtobiobot v 1.24(Login)','','[CLASS:Edit; INSTANCE:5]',$ar[$ar[0]])
		EndSwitch
Wend

Так понятнее?
 

Yashied

Модератор
Команда форума
Глобальный модератор
Сообщения
5,379
Репутация
2,724
Что есть $Button5? Где она определяется в коде?
 

madmasles

Модератор
Глобальный модератор
Сообщения
7,790
Репутация
2,322
Yashied [?]
А я попробую догадаться. Это происходит потому, что на момент входа в основной цикл, $Button5 = 0.
Вроде так работает и с $Button5 = 0:
Код:
#include <GUIConstantsEx.au3>

$i = Random(-1, 1, 1)

$Form1 = GUICreate("Form1", 350, 200)
$Button1 = GUICtrlCreateButton("Button1", 50, 20, 100, 50)
$Button2 = GUICtrlCreateButton("Button2", 200, 20, 100, 50)
If $i Then
	$Button5 = GUICtrlCreateButton("Button5", 50, 100, 250, 50)
Else
	$Button5 = 0
EndIf
ToolTip('Button5=' & $Button5, 0, 0, '5', 1, 1)
GUISetState()

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case 0
			ContinueLoop
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Button1
			ToolTip('Button1', 0, 0, '1', 1, 1)
		Case $Button2
			ToolTip('Button2', 0, 0, '2', 1, 1)
		Case $Button5
			ToolTip('Button5', 0, 0, '5', 1, 1)
	EndSwitch
WEnd
 

Yashied

Модератор
Команда форума
Глобальный модератор
Сообщения
5,379
Репутация
2,724
Я думаю, что хватит нам уже играть в догадалки. Если он в следующий раз не прояснит ситуацию, я закрою эту тему и подумаю о целесообразности его прибывания на нашем форуме, т.к. это уже не в первый раз... Нет смысла засорять форум бесполезными сообщениями.
 
Автор
L

lexaSF

Новичок
Сообщения
182
Репутация
3
Код:
#include <GUIConstants.au3>
#Include <GuiComboBox.au3>
#Include <GuiListBox.au3>
#Include <File.au3>
#Include <Array.au3>
$mac = 0
Opt('GUICloseOnESC',0)
$Dir = @ScriptDir & '\Setting.ini'
$FileList=_FileListToArray(@ScriptDir & '\settings')
$read = IniReadSectionNames($Dir)
TraySetIcon(@ScriptDir & '\Icon.ico')
$Form1_1_1 = GUICreate("Avtobiobot v 1.24(SID)", 376, 322, 370, 266)
GUISetIcon("C:\Users\Lexa\Desktop\heroic_autobots.ico")
GUISetBkColor(0xB9D1EA)
$Label1 = GUICtrlCreateLabel("SID:", 16, 128, 35, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Input1 = GUICtrlCreateInput("", 16, 56, 169, 21)
$Label2 = GUICtrlCreateLabel("Name:", 16, 32, 50, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Input2 = GUICtrlCreateInput("", 16, 152, 169, 21)
$Label3 = GUICtrlCreateLabel("ID:", 16, 80, 23, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Input3 = GUICtrlCreateInput("", 16, 104, 169, 21)
$Label4 = GUICtrlCreateLabel("Server:", 16, 176, 56, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Input4 = GUICtrlCreateInput("", 16, 200, 169, 21)
$Button1 = GUICtrlCreateButton("Save", 16, 288, 73, 25)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Button2 = GUICtrlCreateButton("Delete", 208, 288, 73, 25)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$List1 = GUICtrlCreateList("", 208, 160, 153, 110)
GUICtrlSetData(-1, "")
$Button3 = GUICtrlCreateButton("Clear", 112, 288, 73, 25)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Button4 = GUICtrlCreateButton("Edit", 289, 288, 73, 25)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Label5 = GUICtrlCreateLabel("  Load Settings", 224, 104, 122, 26)
GUICtrlSetFont(-1, 12, 800, 0, "Minion")
$Combo1 = GUICtrlCreateCombo("None", 208, 128, 153, 25)
If IsArray($FileList) = 1 Then
For $K=1 To $FileList[0]
	_GUICtrlComboBox_AddString($Combo1,$FileList[$k])
Next
EndIf
GUICtrlSetFont(-1, 8, 800, 0, "Palatino Linotype")
$Combo2 = 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 = GUICtrlCreateLabel("Account", 72, 10, 66, 21)
GUICtrlSetFont(-1, 12, 800, 0, "Minion")
$Label7 = GUICtrlCreateLabel("Map:", 16, 224, 36, 22)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Label8 = GUICtrlCreateLabel("Bot Version:", 208, 32, 80, 22)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Combo3 = GUICtrlCreateCombo("Enter SID", 208, 56, 153, 25)
GUICtrlSetData(-1, "Enter Login")
GUICtrlSetFont(-1, 8, 800, 0, "Palatino Linotype")
GUISetState(@SW_SHOW)
If $read <> 1 Then
For $i = 1 To $read[0]
	_GUICtrlListBox_AddString($List1, $read[$i])
Next
EndIf


While 1
	Opt('WinTitleMatchMode',2)
	If WinExists('Avtobiobot v 1.24(Login)','') = 0 Then 
		$LoginWin = 0
	Else
		$LoginWin = 1
	EndIf
	If WinExists('Avtobiobot v 1.24(SID)','') = 0 Then 
		$SidWin = 0
	Else
		$SidWin = 1
	EndIf
		;~~~~~~~~~SID WINDOW~~~~~~~~~
	If ControlGetText('Avtobiobot v 1.24','',$Combo3) = 'Enter SID' Then
		If $SidWin = 0 Then
			If $LoginWin = 1 Then
			GUIDelete()
			EndIf
			$Form1_1_1 = GUICreate("Avtobiobot v 1.24(SID)", 376, 322, 370, 266)
GUISetIcon("C:\Users\Lexa\Desktop\heroic_autobots.ico")
GUISetBkColor(0xB9D1EA)
$Label1 = GUICtrlCreateLabel("SID:", 16, 128, 35, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Input1 = GUICtrlCreateInput("", 16, 56, 169, 21)
$Label2 = GUICtrlCreateLabel("Name:", 16, 32, 50, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Input2 = GUICtrlCreateInput("", 16, 152, 169, 21)
$Label3 = GUICtrlCreateLabel("ID:", 16, 80, 23, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Input3 = GUICtrlCreateInput("", 16, 104, 169, 21)
$Label4 = GUICtrlCreateLabel("Server:", 16, 176, 56, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Input4 = GUICtrlCreateInput("", 16, 200, 169, 21)
$Button1 = GUICtrlCreateButton("Save", 16, 288, 73, 25)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Button2 = GUICtrlCreateButton("Delete", 208, 288, 73, 25)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$List1 = GUICtrlCreateList("", 208, 160, 153, 110)
GUICtrlSetData(-1, "")
$Button3 = GUICtrlCreateButton("Clear", 112, 288, 73, 25)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Button4 = GUICtrlCreateButton("Edit", 289, 288, 73, 25)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Label5 = GUICtrlCreateLabel("  Load Settings", 224, 104, 122, 26)
GUICtrlSetFont(-1, 12, 800, 0, "Minion")
$Combo1 = GUICtrlCreateCombo("None", 208, 128, 153, 25)
If IsArray($FileList) = 1 Then
For $K=1 To $FileList[0]
	_GUICtrlComboBox_AddString($Combo1,$FileList[$k])
Next
EndIf
GUICtrlSetFont(-1, 8, 800, 0, "Palatino Linotype")
$Combo2 = 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 = GUICtrlCreateLabel("Account", 72, 10, 66, 21)
GUICtrlSetFont(-1, 12, 800, 0, "Minion")
$Label7 = GUICtrlCreateLabel("Map:", 16, 224, 36, 22)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Label8 = GUICtrlCreateLabel("Bot Version:", 208, 32, 80, 22)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Combo3 = GUICtrlCreateCombo("Enter SID", 208, 56, 153, 25)
GUICtrlSetData(-1, "Enter Login")
GUICtrlSetFont(-1, 8, 800, 0, "Palatino Linotype")
GUISetState(@SW_SHOW)
If $read <> 1 Then
For $i = 1 To $read[0]
	_GUICtrlListBox_AddString($List1, $read[$i])
Next
EndIf
EndIf

	$name = GUICtrlRead($Input1)
	$read = IniReadSectionNames($Dir)
	_GUICtrlComboBox_LimitText($Combo1,0)
	_GUICtrlComboBox_LimitText($Combo2,0)
$sid = GUICtrlRead($Input2)
$id = GUICtrlRead($Input3)
$serv = GUICtrlRead($Input4)
$map = GUICtrlRead($Combo2)
$lang = GUICtrlRead($Combo3)
$Setting = ControlGetText('Avtobot','','[CLASS:Edit; INSTANCE:5]')
$Findname = _GUICtrlListBox_FindString($List1,$name)
$FindTextname = _GUICtrlListBox_GetText($List1,$Findname)
	$nMsg = GUIGetMsg()
	Switch $nMsg
	Case $GUI_EVENT_CLOSE
			Exit
		Case $Button1
		$CtrlRead = GUICtrlRead($Input1)
		$CtrlReadId = GUICtrlRead($Input3)
		$CtrlReadSid = GUICtrlRead($Input2)
		$CtrlReadServ = GUICtrlRead($Input4)
		$StringLen = StringLen($CtrlReadId)
		$seaTxt = ControlGetText("Avtobot", "Account", '[CLASS:Edit; INSTANCE:6]')
		$seaTxtset = ControlGetText ("Avtobot", "Account", '[CLASS:Edit; INSTANCE:5]') 
		If $CtrlRead = '' Then
				MsgBox(0,'ERROR','Error!' & @LF & 'Enter an account name!' & $CtrlRead)
				$err = 1
			Else
				$err = 0
			EndIf
				If StringIsDigit($CtrlReadId) = 1 And StringLen($CtrlReadId) = 8 Then
						$ide = 0
					Else
						MsgBox(0,'ERROR!','Error!' & @LF & 'Enter an correct ID!')
						$ide = 1
					EndIf
					If StringIsAlNum($CtrlReadSid) = 1 And StringLen($CtrlReadSid) = 32 Then
						$side = 0
					Else
						MsgBox(0,'ERROR!','Error!' & @LF & 'Enter correct SID!')
						$side = 1
					EndIf
					If StringLen($CtrlReadServ) = 0 Or StringLen($CtrlReadServ) > 5  Then
						MsgBox(0,'ERROR!','Error!' & @LF & 'Enter correct Server!')
						$serve = 1
					Else
						$serve = 0
					EndIf
					If $seaTxt = 'None' Then
						MsgBox(0,'ERROR!','Error!' & @LF & 'Enter an correct Map!')
						$mape = 1
					Else
						$mape = 0
					EndIf
					If $err = 0 And $ide = 0 And $side = 0 And $mape = 0 And $serve = 0 Then
						IniWrite( $Dir,$name, "ID",$id)
						IniWrite( $Dir,$name, "SID",$sid)
						IniWrite( $Dir,$name, "SERVER",$servv)
						IniWrite( $Dir,$name, "MAP",_GUICtrlComboBox_GetCurSel($Combo2))
						IniWrite( $Dir,$name,'SETTING',$Setting)
						If $lang = 'UDOBot v 4.0.1 (Rus)' Then
						IniWrite( $Dir,$name,'LANG','RUS')
					Else
						IniWrite( $Dir,$name,'LANG','ENG')
					EndIf
					EndIf
			If $name = $FindTextname And $err = 0 And $ide = 0 And $side = 0 And $mape = 0 And $serve = 0 And $read <> 1 Then
				For $ed=1 To $read[0]
						$regedit = StringRegExp($read[$ed],$name,0)
						If $regedit = 1 Then $edit = 1
					Next
					If $edit = 1 Then
				MsgBox(0,'OK!','Account Edit!')
			EndIf
			If $Findname = -1 And $err = 0 And $ide = 0 And $side = 0 And $mape = 0 And $serve = 0 And $read <> 1 Then
					For $r=1 To $read[0]
						$regsave = StringRegExp( $read[$r],$name,0)
					Next
					If $regsave = 0 Then
					MsgBox(0,'OK!','Account Save!')
				EndIf
			EndIf
		EndIf
		If $read = 1 And $err = 0 And $ide = 0 And $side = 0 And $mape = 0 And $serve = 0 Then MsgBox(0,'OK!','Account Save!')
			 If $read <> 1 Then
For $i=1 To $read[0]
    $FindStr = _GUICtrlListBox_FindString($List1,$read[$i])
    $FindText = _GUICtrlListBox_GetText($List1,$FindStr) 
	$Findname = _GUICtrlListBox_FindString($List1,$name)
	$FindTextname = _GUICtrlListBox_GetText($List1,$Findname)
	$regeditlist = StringRegExp($FindText,$name,0)
	$searchname = StringRegExp($FindTextname,$name,0)
    If $regeditlist = 0 And $searchname = 0 And $err = 0 And $ide = 0 And $side = 0 And $mape = 0 And $serve = 0 Then
_GUICtrlListBox_AddString($List1, $name)
EndIf
Next
EndIf
If $read = 1 And $err = 0 And $ide = 0 And $side = 0 And $mape = 0 And $serve = 0 Then
	_GUICtrlListBox_AddString($List1, $name)
	EndIf
			Case $Button2
			$Marker = _GUICtrlListBox_GetAnchorIndex($List1)
			$StrText = _GUICtrlListBox_GetText($List1,$Marker)
			If $Marker <> -1 Then
			_GUICtrlListBox_DeleteString($List1, $Marker)
			IniDelete($Dir,$StrText)
		Else
			MsgBox(0,'ERROR!','Error!' & @LF & 'The account for removal isn"t chosen!')
		EndIf
	Case $Button3
			ControlSetText('Avtobot','','[CLASS:Edit; INSTANCE:1]','')
			ControlSetText('Avtobot','','[CLASS:Edit; INSTANCE:3]','')
			ControlSetText('Avtobot','','[CLASS:Edit; INSTANCE:2]','')
			ControlSetText('Avtobot','','[CLASS:Edit; INSTANCE:4]','')
			_GUICtrlComboBox_SetCurSel($Combo2,'0')
            _GUICtrlComboBox_SetCurSel($Combo1,'0')
		Case $Button4
			$Nameindex = _GUICtrlListBox_GetAnchorIndex($List1)
			$NameIni = _GUICtrlListBox_GetText($List1, $Nameindex)
			If $Nameindex <> -1 Then
			$IniSid = IniRead($Dir,$NameIni,'SID','')
			$IniId = IniRead($Dir,$NameIni,'ID','')
			$IniServer = IniRead($Dir,$NameIni,'SERVER','')
			$IniMap = IniRead($Dir,$NameIni,'MAP','')
			$IniSetting = IniRead($Dir,$NameIni,'SETTING','')
			ControlSetText('Avtobot','','[CLASS:Edit; INSTANCE:1]',$NameIni)
			ControlSetText('Avtobot','','[CLASS:Edit; INSTANCE:3]',$IniId)
			ControlSetText('Avtobot','','[CLASS:Edit; INSTANCE:2]',$IniSid)
			ControlSetText('Avtobot','','[CLASS:Edit; INSTANCE:4]',$IniServer)
			$Indx = _GUICtrlComboBox_FindString($Combo1,$IniSetting)
			_GUICtrlComboBox_SetCurSel($Combo2,$IniMap)
            _GUICtrlComboBox_SetCurSel($Combo1,$Indx)
		Else
			MsgBox(0,'ERROR!','The account for removal isn"t chosen!')
		EndIf	
	EndSwitch
	$edit = 0
	;~~~~~~~~~Login WINDOW~~~~~~~
ElseIf ControlGetText('Avtobiobot v 1.24','',$Combo3) = 'Enter Login' Then
		If $LoginWin = 0 Then
			If $SidWin = 1 Then
			GUIDelete()
		EndIf
		$Fin = FileFindFirstFile(@ScriptDir & '\*.bat')
$Form1_1_1 = GUICreate("Avtobiobot v 1.24(Login)", 353, 277, 351, 273)
GUISetIcon("C:\Users\Lexa\Desktop\heroic_autobots.ico")
GUISetBkColor(0xB9D1EA)
$Input1 = GUICtrlCreateInput("", 8, 64, 153, 21)
$Label2 = GUICtrlCreateLabel("Name:", 8, 40, 50, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Label4 = GUICtrlCreateLabel("Server:", 8, 136, 56, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Input4 = GUICtrlCreateInput("", 8, 160, 153, 21)
$Button1 = GUICtrlCreateButton("Save", 8, 240, 73, 25)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Button2 = GUICtrlCreateButton("Delete", 184, 240, 73, 25)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Listlog1 = GUICtrlCreateList("", 184, 120, 153, 84)
GUICtrlSetData(-1, "")
$Button3 = GUICtrlCreateButton("Clear", 88, 240, 73, 25)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Button4 = GUICtrlCreateButton("Edit", 265, 240, 73, 25)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Label8 = GUICtrlCreateLabel("Start type:", 184, 40, 65, 22)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Combo3 = GUICtrlCreateCombo("Enter Login", 184, 64, 153, 25)
GUICtrlSetData(-1, "Enter SID")
GUICtrlSetFont(-1, 8, 800, 0, "Palatino Linotype")
$Label1 = GUICtrlCreateLabel("Password:", 8, 88, 64, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Input2 = GUICtrlCreateInput("", 8, 112, 153, 21)
$Label3 = GUICtrlCreateLabel("Edit .bat", 48, 8, 80, 28)
GUICtrlSetFont(-1, 14, 800, 0, "Franklin Gothic Medium")
$Label5 = GUICtrlCreateLabel("Starting .bat", 208, 8, 117, 28)
GUICtrlSetFont(-1, 14, 800, 0, "Franklin Gothic Medium")
$Label6 = GUICtrlCreateLabel("Started accoutns:", 184, 96, 107, 22)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Checkbox1 = GUICtrlCreateCheckbox("Automatic start BoT", 184, 208, 153, 25)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Label7 = GUICtrlCreateLabel("Setting File:", 8, 184, 80, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Input3 = GUICtrlCreateInput("", 8, 208, 137, 21)
$Button5 = GUICtrlCreateButton("...", 148, 208, 17, 21, 0)
GUISetState(@SW_SHOW)
Do
	$adds = 0
	$rol = FileFindNextFile($Fin)
    $fila = StringSplit($rol,'.')	
	If $rol = '' Then $adds = 1
		If $adds <> 1 Then
				_GUICtrlListBox_AddString($ListLog1, $fila[1])
			EndIf
	Until $adds = 1 
EndIf
$nMsg = GUIGetMsg()
$nameLog = GUICtrlRead($Input1)
$namePass = GUICtrlRead($Input2)
$nameServ = GUICtrlRead($Input4)
$nameSett = GUICtrlRead($Input3)
		Switch $nMsg
		Case $GUI_EVENT_CLOSE
		Exit
	Case $Button1
		If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then
		$check = 1
	Else
		$check = 0
	EndIf
	If StringLen(GUICtrlRead($Input4)) > 5 Or StringLen(GUICtrlRead($Input4)) = 0 Then
		MsgBox(0,'ERROR','Error!'&@LF&'Enter a correct server')
		$strlen = 1
	Else
		$strlen = 0
	EndIf
	If StringLen(GUICtrlRead($Input1)) = 0 Then
		MsgBox(0,'ERROR','Error!'&@LF&'Enter a correct Login')
		$errLogin = 1
	Else
		$errLogin = 0
	EndIf
		If StringLen(GUICtrlRead($Input2)) = 0 Then
		MsgBox(0,'ERROR','Error!'&@LF&'Enter a correct Password')
		$errLoginpass = 1
	Else
		$errLoginpass = 0
	EndIf
	If StringLen(GUICtrlRead($Input3)) = 0 Then
		MsgBox(0,'ERROR','Error!'&@LF&'Enter a correct Setting File')
		$strsett = 1
	Else
		$strsett = 0
	EndIf
	;~~~Create String~~~;
$Findname2 = _GUICtrlListBox_FindString($Listlog1,$nameLog)
$FindTextname2 = _GUICtrlListBox_GetText($Listlog1,$Findname2)
				If $nameLog = $FindTextname2 And IsNumber($FindTextname2) <> 1 Then
					$Fin2 = FileFindFirstFile(@ScriptDir & '\*.bat')
				Do
					$ReadFile = FileFindNextFile($Fin2)
						$regedit = StringRegExp($ReadFile,$nameLog,0)
						If $regedit = 1 Then $edit = 1
						Until $regedit = 1 Or $ReadFile = ''
						EndIf
					If $edit = 1 Then
					FileOpen(@ScriptDir & '\' & $ReadFile,2 )
					FileWrite(@ScriptDir & '\' & $nameLog & '.bat','Start' & ' ' & 'bioBot.exe' & ' ' & '-quickstart' & ' ' & $nameLog & ' ' & $namePass & ' ' & $nameServ & ' ' & $nameSett) 
				MsgBox(0,'OK!','Account Edit!')
			EndIf
			If $Findname2 = -1 And $check = 0 And $strLen = 0 Then
				$Fin3 = FileFindFirstFile(@ScriptDir & '\*.bat')
					Do
						$ReadFile = FileFindNextFile($Fin3)
					$regsave = StringRegExp( $ReadFile,$nameLog,0)
					Until $ReadFile <> ''
					If $regsave = 0 Then
					MsgBox(0,'OK!','Account Save!')
				EndIf
			EndIf
			 If $Fin <> -1 Then			
Do
	$Nameindex2 = _GUICtrlListBox_GetAnchorIndex($ListLog1)
	$ReadFile = FileFindNextFile($Fin)
	$While = StringIsSpace($ReadFile)
    $FindStr = _GUICtrlListBox_FindString($ListLog1,$ReadFile)
    $FindText = _GUICtrlListBox_GetText($ListLog1,$FindStr)
	$Findname = _GUICtrlListBox_FindString($ListLog1,$nameLog)
	$FindTextname = _GUICtrlListBox_GetText($ListLog1,$Findname)
	$regeditlist2 = StringRegExp($FindText,$nameLog,0)
	$searchname2 = StringRegExp($FindTextname,$nameLog,0)
    If $regeditlist2 = 0 And $searchname2 = 0 And $errLogin = 0 And $errLoginpass = 0 And $strlen = 0 Then
_GUICtrlListBox_AddString($ListLog1, $nameLog)
_FileCreate(@ScriptDir & '\' & $nameLog & '.bat')
FileWrite(@ScriptDir & '\' & $nameLog & '.bat','Start' & ' ' & 'bioBot.exe' & ' ' & '-quickstart' & ' ' & $nameLog & ' ' & $namePass & ' ' & $nameServ & ' ' & $nameSett)
EndIf
Until $While <> 1
EndIf
If $Fin = -1 Then
	If $errLogin = 0 And $errLoginpass = 0 And $strlen = 0 And $strsett = 0 Then
		_GUICtrlListBox_AddString($ListLog1, $nameLog)
_FileCreate(@ScriptDir & '\' & $nameLog & '.bat')
		FileWrite(@ScriptDir & '\' & $nameLog & '.bat','Start' & ' ' & 'bioBot.exe' & ' ' & '-quickstart' & ' ' & $nameLog & ' ' & $namePass & ' ' & $nameServ & ' ' & $nameSett)
	EndIf
EndIf
Case $Button2
	$Markerlog = _GUICtrlListBox_GetAnchorIndex($ListLog1)
			$StrTextLog = _GUICtrlListBox_GetText($ListLog1,$MarkerLog)
			If $Markerlog <> -1 Then
			_GUICtrlListBox_DeleteString($ListLog1, $MarkerLog)
			FileDelete(@ScriptDir & '\' & $StrTextLog & '.bat' )
		Else
			MsgBox(0,'ERROR!','Error!' & @LF & 'The account for removal isn"t chosen!')
		EndIf
	Case $Button3
		ControlSetText('Avtobiobot v 1.24(Login)','','[CLASS:Edit; INSTANCE:1]','')
		ControlSetText('Avtobiobot v 1.24(Login)','','[CLASS:Edit; INSTANCE:4]','')
		ControlSetText('Avtobiobot v 1.24(Login)','','[CLASS:Edit; INSTANCE:2]','')
		ControlSetText('Avtobiobot v 1.24(Login)','','[CLASS:Edit; INSTANCE:5]','')
		GUICtrlSetState($Checkbox1,$GUI_UNCHECKED)
	Case $Button4
		$MarkerlogB4 = _GUICtrlListBox_GetAnchorIndex($ListLog1)
		If $MarkerlogB4 <> -1 Then
			$StrTextLogB4 = _GUICtrlListBox_GetText($ListLog1,$MarkerlogB4)
		$StrOpen = FileOpen(@ScriptDir & '\' & $StrTextLogB4 & '.bat',0)
		$StrRead = FileRead($StrOpen)		
		$StrSplit = StringSplit($StrRead,' ')
		ControlSetText('Avtobiobot v 1.24(Login)','','[CLASS:Edit; INSTANCE:1]',$StrSplit[4])
		ControlSetText('Avtobiobot v 1.24(Login)','','[CLASS:Edit; INSTANCE:4]',$StrSplit[5])
		ControlSetText('Avtobiobot v 1.24(Login)','','[CLASS:Edit; INSTANCE:2]',$StrSplit[6])
		ControlSetText('Avtobiobot v 1.24(Login)','','[CLASS:Edit; INSTANCE:5]',$StrSplit[7])
	Else
		MsgBox(0,'ERROR!','Error!' & @LF & 'The account for removal isn"t chosen!')
	EndIf
Case $Button5
	$FoD = FileOpenDialog('Choose a file of options',@ScriptDir,'Udobot settings (*.udb)' ,4)
	$ar = StringSplit($FoD,'\')
	ControlSetText('Avtobiobot v 1.24(Login)','','[CLASS:Edit; INSTANCE:5]',$ar[$ar[0]])
		EndSwitch
	EndIf
WEnd
 

Yashied

Модератор
Команда форума
Глобальный модератор
Сообщения
5,379
Репутация
2,724
lexaSF, ты можешь привести полностью весь код? По этому куску все равно ничего сказать нельзя. Только не нужно создавать новый ответ, просто отредактируй предыдущий.
 

Yashied

Модератор
Команда форума
Глобальный модератор
Сообщения
5,379
Репутация
2,724
Да уж...

:suicide:
 

Suppir

Продвинутый
Сообщения
967
Репутация
62
У меня при запуске программы окно выбора файла не появляется.
 
Верх