Jump to content

Recommended Posts

Posted (edited)

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
Posted

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

  • Moderators
Posted

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.

"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!

Posted (edited)

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
Posted
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]

Posted

What website or program are you trying to automate?  What you're doing sounds very suspicious and you're talking around the questions.

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...