Noob needing help on _Imagesearch

07/24/2014 04:50 Kardu#1
So i was starting to build a bot for a work on autoit, and i only made this to check if it detects when firefox is opened or not, and it does not work!

Code:
#include <ImageSearch.au3>
$TimeTolerance = 0
$FFOpenPath = "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
$x = 0
$y = 0

ShellExecute($FFOpenPath)
Do
   $search = _ImageSearch('FFOpened.bmp', 0, $x, $y, 0)
   If $search = 1 Then
	  MsgBox(0,"ImageSearch","It worked!")
	  ExitLoop()
   ElseIf $search = 0 Then
      MsgBox(0,"ImageSearch","Can't find image!")
      Sleep(5000)
      $TimeTolerance = $TimeTolerance + 1
   EndIf
Until $TimeTolerance = 3
It does not show neither msg box for "Cant find image" or "It worked!"
The bot simply runs firefox and does nothing more

Can you help me?

Thanks :)
07/24/2014 04:55 Purge75#2
[Only registered and activated users can see links. Click Here To Register...]

The person has a download link for image search that might help you more.
07/24/2014 13:51 alpines#3
Why use ImageSearch for that?
Either use ProcessExists or WinExists.
07/24/2014 16:16 Kardu#4
Quote:
Originally Posted by Purge75 View Post
[Only registered and activated users can see links. Click Here To Register...]

The person has a download link for image search that might help you more.
Is that download link working for you? It shows up as unavailable web page here.

Quote:
Originally Posted by alpines View Post
Why use ImageSearch for that?
Either use ProcessExists or WinExists.
Yeah i think it would be the same thing in this case, but i'll need ImageSearch in other parts of this script for sure..
07/25/2014 01:55 Purge75#5
its on page 4
link below that works
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
07/26/2014 03:58 Moneypulation#6
You don't get any error? For example I forgot to put the Imagesearch.dll in the same folder as the script
07/27/2014 22:42 smsalbania#7
If you want to search image:

Code:
Local $search1 = _ImageSearch("imghere.png", 0, $x, $y, 0) ; don't forget to change image ;)
If $search1 = 1 Then
Msgbox(64, "Hell yeah", "I found it!")
Else
Msgbox(64, "Oh no", "I haven't found it!")
Endif
If you want to se if window is active:

Code:
$win = "Untitled" ;don't forget to change the window
If WinActive($win) Then
    MsgBox(64, "Hell yeah", "I found the active window and it is: " & $win &" .")
 Else
	 Msgbox(64, "Oh no", "I haven't found it!")
EndIf
Try this..