redfive19 Posted April 27, 2005 Posted April 27, 2005 All, As always I've come here as a last resort. I would like to know if I could use multiple AdLibEnables....apparently I cannot. I've tried setting (2) different adlib functions but when I enable the second one, neither one works. Basically, there are two windows I want it to look for. can I set this all in one function? I am still a newbie so any help would be much appreciated. I was thinking something like this: AdlibEnable("GetRidOfMemo2", 1000) Exit Func GetRidOfMemo2() If WinExists("Confirm", "&Accept") Then ControlClick("Confirm", "&Accept", "Button1") EndIf If WinExists("Conflict Resolution", "") Then ControlClick("Conflict Resolution", "", "Button12") EndIf EndFunc Would this work or am I dreaming??
Developers Jos Posted April 27, 2005 Developers Posted April 27, 2005 AdlibEnable("GetRidOfMemo2", 1000) While 1 sleep(100) Wend Exit Func GetRidOfMemo2() If WinExists("Confirm", "&Accept") Then ControlClick("Confirm", "&Accept", "Button1") EndIf If WinExists("Conflict Resolution", "") Then ControlClick("Conflict Resolution", "", "Button12") EndIf EndFunc SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
redfive19 Posted April 27, 2005 Author Posted April 27, 2005 Why would I need the While 1 sleep(100) Wend ??? Thanks for being patient!!!
Developers Jos Posted April 27, 2005 Developers Posted April 27, 2005 Why would I need theWhile 1 sleep(100)Wend??? Thanks for being patient!!!<{POST_SNAPBACK}>An Adlib is executed at the interval defined during the execution of the script.Since your script ends right after the AdlibEnable() nothing happened.So putting in an While 1...Wend keeps the script active.You could ofcourse also put your test for the windows in the While...wend loop and forget about the adlib..... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
redfive19 Posted April 28, 2005 Author Posted April 28, 2005 oh sorry, I cut out all of the script after the adlibenable for brevity's sake. It's working thanks to your help!!! THANK YOU THANK YOU THANK YOU!!! -redfive
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