npenfold Posted December 8, 2017 Share Posted December 8, 2017 Hello AutoIt Community, I want to create a script and I'd like to ask for some help. Here's what I'd like it to do: 1. Search for an image then click on it. 2. Wait for 1 of 7 images to appear and click on whichever one it is out of the 7. 3. Repeat the whole process Here's the code I have so far: Quote #include <ImageSearch.au3> $x1=0 $y1=0 $result = _ImageSearch("find1.bmp",0,$x1,$y1,0) if $result=1 Then MouseMove($x1,$y1,3) MouseClick("Left") EndIf Dim $anArray[10] $anArray[0]=7 ; 7 images to wait to appear $anArray[1]="x1.bmp" ; image 1 to wait for $anArray[2]="x2.bmp" ; image 2 to wait for $anArray[2]="x3.bmp" ; image 3 to wait for $anArray[2]="x4.bmp" ; image 4 to wait for $anArray[2]="x5.bmp" ; image 5 to wait for $anArray[2]="x6.bmp" ; image 6 to wait for $result = _WaitForImagesSearch($anArray,15,1,$x1,$y1,0) if $result=1 Then MouseMove($x1,$y1,3) MouseClick("Left") EndIf if $result=2 Then MouseMove($x1,$y1,3) MouseClick("Left") EndIf if $result=3 Then MouseMove($x1,$y1,3) MouseClick("Left") EndIf if $result=4 Then MouseMove($x1,$y1,3) MouseClick("Left") EndIf if $result=5 Then MouseMove($x1,$y1,3) MouseClick("Left") EndIf if $result=6 Then MouseMove($x1,$y1,3) MouseClick("Left") EndIf if $result=0 Then MouseMove($x1,$y1,3) MouseClick("Left") EndIf Thank you in advance for your help. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted December 8, 2017 Moderators Share Posted December 8, 2017 @npenfold what kind of images are you searching for, or what kind of application (desktop, web, game, etc.). The application will often determine how you go about it. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
npenfold Posted December 8, 2017 Author Share Posted December 8, 2017 @JLogan3o13 it is a desktop application Link to comment Share on other sites More sharing options...
npenfold Posted December 9, 2017 Author Share Posted December 9, 2017 Within bluestacks Link to comment Share on other sites More sharing options...
Developers Jos Posted December 9, 2017 Developers Share Posted December 9, 2017 Sam as the other thread! -click- 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. Link to comment Share on other sites More sharing options...
Recommended Posts