HighlyUnlikely Posted August 15, 2008 Posted August 15, 2008 Hi all I have a main command I want auto it to do. Its fairly simple and I can get auto it to do this. But while it is doing this: I have a series of pictures I need auto it to click when they appear on my screen. How do I ask auto it to look for these saved images and click them in the appropriate locations? For example: i want auto it to search for a red button with an x on it so I save the pic for it to look for on my desktop. It appears and I want auto it to move the mouse to (690, 726) and click down with the left button. or maybe a different picture appears, and I want auto it to go to (640, 502) [because that is where it is on screen] and left click once and then, if these pictures do not appear, i want auto it to continue the main command I have the main part downpat but Im thinking the conditions are screwing with my head!
HighlyUnlikely Posted August 15, 2008 Author Posted August 15, 2008 ok after researching, I have learned this isnt possible however pixel search is how do I ask auto it to do the main command, sleep for 20 seconds, then repeat the main command but while it is sleeping, to search for a colour and click it if found?
Brickoneer Posted August 15, 2008 Posted August 15, 2008 it is quite possible to do what you want... there are several methods for finding "pictures" on the screen. (One that I wrote myself... although its probably not the best out there) Try searching around for it. As for your looping problem, you'd simply want to try something like this: while 1 ;main command $timer_start = timerinit() do ; look for pic sleep(10) until timerdiff($timer_start) > 20000 ; It will look for your pic for 20 seconds (20,000 ms) and then start your main command again. wend
davecollinsnz Posted August 16, 2008 Posted August 16, 2008 The sleep and look code: For $i=1 to 200 ;200*100=20000ms=20sec ;look for pixel code goes here Sleep(100) Next Trust me to make SkyNet with AutoIt...
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