Jump to content

Jonboy

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by Jonboy

  1. Updated code and got the following error.
  2. Remove the unnecessary part, again thanks for the help completely new to AutoIT. Global Const $CLIENT_EXECUTABLE = "filepath\qws3270s.exe" ; CHANGE_ME - change if installed in different path Global Const $DISPATCHER_NAME = "QWS_Dispatcher" Global $TargetUsername = "UserID" Global $TargetPassword = "SuperSecretPassword" Global $sleep = 100 AutoItSetOption("WinTitleMatchMode", 3) ; Run exe and activate Local $ConnectionClientPID = Run($CLIENT_EXECUTABLE, "", @SW_MAXIMIZE) if ($ConnectionClientPID == 0) Then ;Error(StringFormat("Failed to execute process [%s]", $CLIENT_EXECUTABLE, @error)) EndIf local $hWnd = WinWaitActive("[TITLE:New Session Wizard; CLASS:#32770]") If(WinGetTitle($hWnd)=="New Session Wizard") Then SessionWizzard() Else Sleep(100) send("{ENTER}") EndIf ;#Acutal Login process============================================================================================================= $hWnD = WinWaitActive("[TITLE:1.1.1.1; CLASS:QWS3270S;]") if(WinGetTitle($hWnD) == "1.1.1.1")Then Sleep(1000) ;Username Sleep(1000) Send($TargetUsername) ;Password sleep(100) Send($TargetPassword) ;send Enter sleep(100) Send("{ENTER}") EndIf Func SessionWizzard() Sleep(100) Send("{tab}") Send("{tab}") Sleep(100) Send("{ENTER}") Sleep(100) send($address) sleep(100) Send("{TAB}") Send("{TAB}") sleep(100) send("{ENTER}") Send("{TAB}") Send("{TAB}") sleep(100) send("{ENTER}") Send("{TAB}") Send("{TAB}") sleep(100) send("{ENTER}") Send($address) Send("{TAB}") Send("{TAB}") send("{ENTER}") send("{ENTER}") Local $hWnD = WinWaitActive("[TITLE:Connect; CLASS:#32770]") If(WinGetTitle($hWnd)=="Connect") Then Sleep(100) send("{ENTER}") EndIf EndFunc
  3. Can someone help me out with this. I for the life of me don't have any idea why this if then else statement won't work. local $hWnd $hWnd = WinWaitActive("[TITLE:New Session Wizard; CLASS:#32770;]") If (WinGetTitle($hWnd) == "New Session Wizard")Then SessionWizzard() ; functions that go through the new session wizard this is define elsewhere in my script. Else ; Thing is this will run correctly the 1st time but after the 1st time it will not switch over to the else statement. $hWnD = WinWaitActive("[TITLE:Connect; CLASS:#32770;]") If(WinGetTitle($hWnd)=="Connect") Then Sleep(100) send("{ENTER}") EndIf EndIf
×
×
  • Create New...