Jump to content

neither _imagesearch _imageseracharea can find any images


Recommended Posts

#include <ImageSearch.au3>

Global $running = 0, $testx=0, $testy=0, $butts=0

HotKeySet("{ESC}", "Terminate")
HotKeySet("{SPACE}", "togglerun")

Func Terminate()
    Exit 0
EndFunc   ;==>Terminate

Func togglerun()
    If $running = 0 Then
        $running = 1
        TrayTip("", "Program Started", 3)
    ElseIf $running = 1 Then
        $running = 0
        TrayTip("", "Program Paused", 3)
EndIf


    EndFunc   ;==>togglerun

While 1 = 1

While $running = 0
    sleep(500)
WEnd

while $running = 1
    local $butts=0
    $butts = _ImageSearch("ait.bmp", 1, $testx,$testy,200)
    if $butts = 1 Then
        TrayTip("", "Image Found!", 3)
    ElseIf $butts = 0 Then
        TrayTip("", "FAILED", 3)
    EndIf
    $running=0

WEnd

WEnd

I'm kinda getting sad at this. I've been trying for hours now, literally. I'm actually wondering if I've got an outdated version of _imagesearch. I've read many other help threads, and in a couple of them the answer was "Get the newest version of _imagesearch" but i've looked, and cannot find an official link. Is there one? A couple of the links i've found were even dead links.

This program works wonderfully, except for one thing. It never finds the image. I get a traytip of "FAILED" every time.

As you can see i've even turned up the tolerance really high, it still cant find it.

I've included my version of _imagesearch. Hopefully it's just outdated and that's why it cant find it.

Is there anything else I can tell you to help you help me?

Thanks.

imagesearch.zip

Link to comment
Share on other sites

Yeah, that's probably like... way over my head. Until yesterday i was still writing scripts that basically said "Click, sleep, click, sleep"

But i'm always learning, and i'm gonna give it a shot.

In the meantime, if anyone else knows how to get imagesearch to work....

Link to comment
Share on other sites

Yeah, that's probably like... way over my head. Until yesterday i was still writing scripts that basically said "Click, sleep, click, sleep"

But i'm always learning, and i'm gonna give it a shot.

In the meantime, if anyone else knows how to get imagesearch to work....

Why not do it right? Your saying "yea, I know I'm doing it the hard way that is unstable and is buggy as hell and I COULD do it easier but I rather keep doing it the hard way."

Give it a try. You will be glad you did.

Link to comment
Share on other sites

But i'm always learning, and i'm gonna give it a shot.

 

 

Thanks, I already said I would. I've read over the code you linked and I'm working to understand it. In the meantime I've already written a program that does exactly what I need, with one exception. Once it works I'l have lots of time to devote to learning something new.

 

You need to specify the path to your image better, try @scriptdir & "ait.bmp"

 

Yeah, that didn't work either. I'm starting to think there's something seriously wrong with the copy of imagesearch i'm using. Going to work on another method.

Thank you both.

Link to comment
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
 Share

  • Recently Browsing   0 members

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