;--- AutoIt Macro Generator V 0.21 beta --- #include <File.au3> Opt("WinTitleMatchMode", 4) Opt("WinWaitDelay", 100) Dim $aPasswords Local $hWnd, $iTime = 0 _FileReadToArray("c:\pass.txt", $aPasswords) For $i = 1 To $aPasswords[0] $hWnd = WinWait("Connect to PBX", "Enter System Password :", 5) If Not $hWnd Then MsgBox(4096, @ScriptName, "Окно не найдено, завершаем работу скрипта") Exit EndIf ;ControlClick($hWnd, "", "Edit1") ControlSend($hWnd, "", "Edit1", $aPasswords[$i], 1) ControlClick($hWnd, "", "Button6") While 1 If WinExists("KX-TE Maintenance Console", "The system password is wrong.") Then ControlClick("KX-TE Maintenance Console", "The system password is wrong.", "Button1") $iTime = 0 ContinueLoop 2 EndIf If $iTime = 5000 Then ExitLoop $iTime += 200 Sleep(200) WEnd ;Если нажать "Да", то пароль будет скопирован в буфер обмена, иначе продолжится проверка If MsgBox(4 + 4096, @ScriptName, 'Похоже, пароль "' & $aPasswords[$i] & '".') = 6 Then ClipPut($aPasswords[$i]) ExitLoop Else ContinueLoop EndIf Next ;--- End --- |