Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 16:49

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Does anybody have _imagesearch working?

Discussion on Does anybody have _imagesearch working? within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Mar 2012
Posts: 6
Received Thanks: 0
Does anybody have _imagesearch working?

I've got a pretty decent bot planned and mostly written, but it hinges on _imagesearch or even better _imagesearcharea working. Unfortunately the copy of _imagesearch i have doesn't seem to work with the current version of AutoIt.

To check this, I finally made a 10x10 bmp of white pixels and tried to find it in a white desktop. It failed every time. This makes me pretty sure it's not my code that's failing, but the _imagesearch.

Does anybody have a version of _imagesearch that they know for sure works with the current version of AutoIt? _imagesearch doens't seem to have an official repository or site. I found a thread on the official autoit forums for it, but the links are dead, and the autoit forum community wont help me at all. They dont seem to like _imagesearch, because "it's only used for botting", which is now against their forum rules.

I'm more than willing to post my code/bot once it works. Not many people play the game i'm writing it for, but who knows, maybe it will help someone.
seanbrockest is offline  
Old 06/14/2014, 17:04   #2
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
Isolate your problem to a new script with the 10x10 white image.
Probably it's just a small error. Otherwise you can try to use PixelPattern which is slower but finds your image.
alpines is offline  
Old 06/14/2014, 18:19   #3
 
elite*gold: 0
Join Date: Mar 2012
Posts: 6
Received Thanks: 0
Quote:
Originally Posted by alpines View Post
Isolate your problem to a new script with the 10x10 white image.
Probably it's just a small error. Otherwise you can try to use PixelPattern which is slower but finds your image.

I have

Code:
#include <ImageSearch.au3>

Global $running = 0, $testx=0, $testy=0, $whitesquare=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 $whitesquare=0
    $whitesquare = _ImageSearch("white.bmp", 1, $testx,$testy,200)
    if $whitesquare = 1 Then
        TrayTip("", "Image Found!", 3)
    ElseIf $whitesquare = 0 Then
        TrayTip("", "FAILED", 3)
    EndIf
    $running=0

WEnd

WEnd
To test my code yourself, just make a little bmp with whatever color you have on your desktop, and call it white.bmp . It fails every time

If this code works for you, please send me your ImageSearch.au3 and ImageSearchDLL.dll

As far as your second suggestion, did you mean this?



Thanks!
seanbrockest is offline  
Old 06/15/2014, 19:42   #4
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
Actually the script crashed on my computer. Probably I was just using the wrong DLL, I don't know.
There are several methods to find Pixels specified by patterns / images on your screen, try them all out.
alpines is offline  
Old 06/16/2014, 06:04   #5
 
flumio's Avatar
 
elite*gold: 50
Join Date: Feb 2009
Posts: 765
Received Thanks: 927
flumio is offline  
Reply


Similar Threads Similar Threads
_ImageSearch
04/25/2012 - AutoIt - 4 Replies
ImageSearch is searshing all pixels, but i want this searsh only my, selected area, how do this?
[Problem] _Imagesearch will nich :(
11/12/2010 - AutoIt - 7 Replies
Ich wollte mich ein wenig mit der Imagesearch Funktion anfreunden :) Sie klappt soweit auch gut... aber nur wenn ich das Bild öffne :( hier das Script: #include <ImageSearch.au3> #RequireAdmin $x1=0 $y1=0
_ImageSearch
11/02/2010 - AutoIt - 1 Replies
Heyy leute.. Ich bin jettz schon längere zeit dran und versuche Imagesearch zum laufen zu bringen doch irgendwie klappt es nicht.. Ich verwende die version von diesem Post hier : Link Hier mein Code (aus nem beispiel raus kopiert und daran rum probiert): #include <ImageSearch.au3> HotKeySet( "{F1}", "Staaaart" ) HotKeySet( "{F2}", "eeeend" )



All times are GMT +1. The time now is 16:49.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.