Что нового

Вводить текст в логин и пасс из inputbox

scanfail

Знающий
Сообщения
244
Репутация
17
Здравствуйте! Решил написать авлогин, столкнулся с проблемой. Нужно чтобы я открывал этот автологин, вводил свой логин и пасс, запускал её, далее она делала вход и разделе Login & Pass вводила текст взятые с inputbox. Прошу помочь.

Вот код:
Код:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("AutoLogin by Disturbed", 202, 178, 192, 124)
$Start2 = GUICtrlCreateButton("Start 2", 104, 8, 91, 25)
$Start1 = GUICtrlCreateButton("Start 1", 8, 8, 91, 25)
$Exit = GUICtrlCreateButton("Exit", 8, 144, 187, 25)
$Login1 = GUICtrlCreateInput("Login", 8, 40, 89, 21)
$Password1 = GUICtrlCreateInput("Password", 8, 72, 89, 21)
$Login2 = GUICtrlCreateInput("Login", 104, 40, 89, 21)
$Password2 = GUICtrlCreateInput("Password", 104, 72, 89, 21)
$Prinuditelno1 = GUICtrlCreateLabel("Принуд.", 25, 105, 71, 17)
GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
$ChekPrinuditelno1 = GUICtrlCreateCheckbox("ChekPrinuditelno1", 8, 105, 17, 17)
$Prinuditelno2 = GUICtrlCreateLabel("Принуд.", 121, 105, 71, 17)
GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
$CheckPrinuditelno2 = GUICtrlCreateCheckbox("ChekPrinuditelno1", 104, 105, 17, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
  $msg = GUIGetMsg()

  Select
  Case $msg = $Start1
	 

    Case $msg = $Exit
        Send("{Esc}")

    Case $msg = $GUI_EVENT_CLOSE

        ExitLoop
  EndSelect
WEnd
 

kaster

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

scanfail

Знающий
Сообщения
244
Репутация
17
В игре вводил. Но это не важно, мне главное узнать, как послать текст введенный в inputbox через Send?
 

Yuri

AutoIT Гуру
Сообщения
737
Репутация
282
scanfail
Попробуйте так.
Код:
While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit

		Case $Start1 ;при нажатии на кнопку Start1
			$Log1 = GUICtrlRead($Login1);считываем в переменную $Log1 логин1
			$Pass1 = GUICtrlRead($Password1);считываем в переменную $Pass1 пароль1		
			MsgBox(0, "Login1", $Log1)
			MsgBox(0, "Password1", $Pass1)
		Case $Start2
			$Log2 = GUICtrlRead($Login2)
			$Pass2 = GUICtrlRead($Password2)			
			MsgBox(0, "Login2", $Log2)
			MsgBox(0, "Password2", $Pass2)
		Case $Exit
			Exit
		
	EndSwitch
WEnd
 
Автор
S

scanfail

Знающий
Сообщения
244
Репутация
17
Спасибо большое Юрий, вы мне очень помогли!)
Вот пример чего я хотел:
Код:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("AutoLogin by Disturbed", 202, 178, 192, 124)
$Start2 = GUICtrlCreateButton("Start 2", 104, 8, 91, 25)
$Start1 = GUICtrlCreateButton("Start 1", 8, 8, 91, 25)
$Exit = GUICtrlCreateButton("Exit", 8, 144, 187, 25)
$Login1 = GUICtrlCreateInput("Login", 8, 40, 89, 21)
$Password1 = GUICtrlCreateInput("Password", 8, 72, 89, 21)
$Login2 = GUICtrlCreateInput("Login", 104, 40, 89, 21)
$Password2 = GUICtrlCreateInput("Password", 104, 72, 89, 21)
$Prinuditelno1 = GUICtrlCreateLabel("Принуд.", 25, 105, 71, 17)
GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
$ChekPrinuditelno1 = GUICtrlCreateCheckbox("ChekPrinuditelno1", 8, 105, 17, 17)
$Prinuditelno2 = GUICtrlCreateLabel("Принуд.", 121, 105, 71, 17)
GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
$CheckPrinuditelno2 = GUICtrlCreateCheckbox("ChekPrinuditelno1", 104, 105, 17, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $Start1 ;при нажатии на кнопку Start1
		   Run("notepad.exe")
		   Sleep(1500)
            $Log1 = GUICtrlRead($Login1)
            $Pass1 = GUICtrlRead($Password1)        
            Send($Log1)
			Send($Pass1)
			
        Case $Start2
         
			
        Case $Exit
            Exit
        
    EndSwitch
WEnd
 
Верх