scubieman Posted June 26, 2019 Posted June 26, 2019 Trying to code this so it will wait for either of these screens to show up. It will wait 3600 seconds before failing and hitting the "Else" statement. Not 100% sure where I need to go with this. Also if @Result = 1 that means true correct? func step5() ; wait for complete prompt. This will wait up to 60 minutes before sending failed report Local $Result = WinWaitActive("mrp", "mrp", "3600") Local $Result222 = WinWaitActive("Continue","complete screeen", "3600") If ($Result = 0) or ($Result222 = 0) Then ConsoleWrite ( "Failedhere Step5" ) $Subject = "MRP Failed" $Body = "Failed to See MRP start running. Step 5 Fail" sendemail() Exit ElseIf ($Result222 = 1) Then step8() Else Sleep(3000) Send("{ENTER}") ConsoleWrite ( "Step5 Complete" ) Step6() EndIf EndFunc
FrancescoDiMuro Posted June 26, 2019 Posted June 26, 2019 (edited) Hi @scubieman, and welcome to the AutoIt forums There are a few things you should pay more attention: The function WinWaitActive() takes "special" texts as the first parameter; did you check them with AutoItWindowInfoTool to be sure that the text you entered is a valid text? The second parameter of thr same function is the title of the Window you want to wait for to be active; remember that it is case sensitive, so just an uppercase letter would let the function fails. As third parameter, WinWaitActive() takes an integer value, and not a string; this means that you have to remove double quotes around the value, and you should be done. If you look closely in the Help file, WinWaitActive() returns an handle in case of success, and 0 in case of error, so you can check its success with IsHWnd() function, passing the return value of WinWaitActive() to this function. If you could be more specific about your endgoal, we have more information to try to help you Edited June 26, 2019 by FrancescoDiMuro Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
scubieman Posted July 2, 2019 Author Posted July 2, 2019 (edited) Not sure why i didnt get your email. 1 and 2: I did copy all data from AutoItWindowInfoTool So it should be good to go. 3: I will change this up. 4:I will look into this. I did more testing it appears it returns with the result of " 0x0000000000020508" . Currently I am only testing with chrome. I am searching for the " true" statement. My goal here is to have it go through a much of automated screens in the middle of the night(similar to a program install). The only difference is sometimes the screens could be slightly different or one is no longer needed. So I need to figure out what screen is up. Then I know how to handle it. Could be 1 of 2 or 3 screens. Edited July 2, 2019 by scubieman
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now