Jump to content
npenfold

Find, Click, Find Click, Repeat in Bluestacks

Recommended Posts

npenfold

Hello AutoIt Community,

I want to create a script for a game in Bluestacks 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.

Share this post


Link to post
Share on other sites
Nunos

 

 

Share this post


Link to post
Share on other sites
Jos

@npenfold,

Welcome to the AutoIt forum. :)

Unfortunately you appear to have missed the Forum rules on your way in. (there is also a link in my signature) 
Please read them now particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. :naughty:

See you soon with a legitimate question I hope. :)

Jos

ps: @Nunos, please click the report button to report instead.... thanks.

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×