alejo9010

trying to make this loop works

4 posts in this topic

#1 ·  Posted (edited)

trying to find 2 image as soon as they appear and click them and continue do so everytime their appear, i have this so far

#include <ImageSearch.au3>

$x1 = 0
$y1 = 0

$x2 = 0
$y2 = 0

MsgBox(0, "start", "start")

while 1
    $result = _ImageSearch("image1.png", 1, $x1, $y1, 0)
    $result2 = _ImageSearch("image2.png", 1, $x2, $y2, 0)
    
Sleep(1000)
If $result = 1 Then
    MouseMove($x1, $y1, 3)
    MouseClick("left", $x1, $y1, 1)

elseif $result2 =1 Then
    MouseMove($x2, $y2, 3)
    MouseClick("left", $x1, $y1, 1)
 EndIf

WEnd

 

it works if i only have 1 image but as soon as i add the second elseif and add the second image it stop working

Edited by alejo9010

Share this post


Link to post
Share on other sites



My guess: such persistence ... won't last, ironically.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

@alejo9010 this is the second time I have locked a thread of yours for this line of questioning. A third and you will earn a holiday from this forum.

@alejo9010 I just took a spin through your posting history, and see that literally every thread you have started has been locked. You obviously have no intention of following the rules, and are therefore not anyone we want on this forum. Account banned.

Edited by JLogan3o13
1 person likes this

√-1 2^3 ∑ π, and it was delicious!

Share this post


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