Jump to content
Sign in to follow this  
Unweighted

Click Until

Recommended Posts

Do
   $Search1 = _ImageSearch('img1.bmp', 0, $X, $Y, 0)
    Sleep(100)
 Until $Search1 = 1
   Sleep(100)
   MouseClick("LEFT",$X,$Y,1,1)

Hi guys, I have this code and I would like it to keep left clicking on the image until another one is found. Any ideas on what I need to do? Help is appreciated, thank you

Edited by Unweighted

Share this post


Link to post
Share on other sites

What about a little if statement.

If image found then MouseClick else ... put that in the loop.


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

What about a little if statement.

If image found then MouseClick else ... put that in the loop.

Do
   If $Search1 = _ImageSearch('img1.bmp', 0, $X, $Y, 0) Then
    Sleep(100)
   MouseClick("LEFT",$X,$Y,1,1)
   Until $Search2

Something like this or? :S sorry very new to AutoIt

Share this post


Link to post
Share on other sites

You say keep clicking on the image until another one is found. What triggers the other image to appear, or what does the window look like? There may be a much easier way to announce the appearance of the second image than an ImageSearch.

Share this post


Link to post
Share on other sites

Do
$Search4 = _ImageSearch('img1.bmp', 0, $X, $Y, 0)
Sleep(100)
Until $Search4 = 1
Sleep(1000)
MouseMove($X, $Y, 1)
MouseClick("left")
popup()
$xx = 0
$yy = 0
Do
$Search5 = _ImageSearch('img2.bmp',1,$xx, $yy,0)
MouseMove($X, $Y, 1)
Sleep(700)
MouseClick("left")
until $Search5 = 1
Sleep(7000)
MouseMove($xx, $yy, 1)
Sleep(7000)
MouseClick("left")

Someone suggested that I use something like this, but it doesn't seem to be working...

Edited by Unweighted

Share this post


Link to post
Share on other sites
Do
$Search4 = _ImageSearch('img1.bmp', 0, $X, $Y, 0)
Sleep(100)
Until $Search4 = 1
Sleep(1000)
MouseMove($X, $Y, 1)
MouseClick("left")
popup()
$xx = 0
$yy = 0
Do
$Search5 = _ImageSearch('img2.bmp',1,$xx, $yy,0)
MouseMove($X, $Y, 1)
Sleep(700)
MouseClick("left")
until $Search5 = 1
Sleep(7000)
MouseMove($xx, $yy, 1)
Sleep(7000)
MouseClick("left")

Someone suggested that I use something like this, but it doesn't seem to be working...

Hi there,

I think you didnt post everything. I don't see any code error of this snippet.

Try to share a little more and your goal.

Cheers.


Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...