AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Canīt get ImageSearch to work

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Guest2
Guest





PostPosted: Thu Sep 18, 2008 6:24 pm    Post subject: Canīt get ImageSearch to work Reply with quote

I tried to find an icon at the "World Of Warcraft" screen, but ImageSearch everytime comes up whith Errorlevel 1.
    The InGame-Screenshot was made with Hooversnap ScreenShot Tool and was saved as BMP.
    The Icon, what Iīm searching for is 35x35, 96 dpi and 24bit (original size from screenshot)
    Position an size of scan area (upper left and lower right corner) are set right
    I tried *n from 0 up to maximum
    CoordMode is set to Pixel/Screen


...but ImageSearch can not find my 35x35 BMP-Picture

of course .. the name is ImageSearch.
May be, there is an undocumented function called ImageFIND Wink or any recommendation how I can solve this problem.

hopefully,
Guest2 (aka Frank)
Back to top
Sivvy



Joined: 21 Jul 2008
Posts: 726
Location: Calgary, AB, Canada

PostPosted: Thu Sep 18, 2008 6:46 pm    Post subject: Reply with quote

Maybe post your code... What is your variation at?
Back to top
View user's profile Send private message
Rhys



Joined: 17 Apr 2007
Posts: 761
Location: Florida

PostPosted: Thu Sep 18, 2008 7:23 pm    Post subject: Reply with quote

Post the image you're searching for, I have a feeling I know what's wrong.
_________________
[Join IRC!]
Back to top
View user's profile Send private message
Guest2
Guest





PostPosted: Thu Sep 18, 2008 9:27 pm    Post subject: Reply with quote

Sivvy wrote:
Maybe post your code... What is your variation at?

Sivvy, there is no special code, because I tested it with

Code:
ImageSearch, NotUsedX, NotUsedY, X1, Y1, X2, Y2, *n filename.bmp


At the beginning X1, Y1, X2, Y2 was the exact position, where the Image should be at the InGame screen. Since it did not work, I decreased the upper left and increased the lower right values.

*n was almost every value from 0 to 255 (step 10).
At small values ImageSearch found noting and from one point on it found "everything" (because every color was matching).

With ErrorLevel 0,1 & 2 I checked, if my 35x35 Image exists at the right directory and if it was located at the InGame screen.

well .. itīs at the right place at harddisk and readable, but itīs never been found at the screen


Rhys wrote:
Post the image you're searching for, I have a feeling I know what's wrong.


Here are my 2 BMP and TIF Images.


[sorry for that bad english, but I learned only some english at school about 30 years ago]
Back to top
Guest2
Guest





PostPosted: Fri Sep 19, 2008 4:38 pm    Post subject: Reply with quote

I played arround with BMP and TIF for hours and itīs still the same.

PixelGetColor works at the same scan area InGame, but it does not fit the needs. The InGame-Icon can have several states - so I have to check one special state by comparing the whole icon.
Back to top
Guest2
Guest





PostPosted: Fri Sep 19, 2008 10:21 pm    Post subject: SOLVED Reply with quote

Quote:
ImageSearch can be used to detect graphical objects on the screen


At least with World Of Warcraft this statement is definitely wrong.

With World Of Warcraft ImageSearch can be used to detect graphical objects on the screen if WoW is the active window.

window <> screen

ImageSearch does not find viewable graphical objects, if my tiny GUI Script-Menue is the active window.

And CoordMode, Pixel, Screen has no effect in that case.
Back to top
Lemming



Joined: 20 Dec 2005
Posts: 165
Location: Malaysia

PostPosted: Sat Sep 20, 2008 1:50 am    Post subject: Ahk does work in WoW Reply with quote

I used to play WoW till around July this year. I had a simple script, and can confirm that ImageSearch does work here.

sample code:

Code:
ImageSearch, GoldX,GoldY , X1,Y1, X2,Y2, *3 gold.bmp


You may need to recapture your images and play around with the variation (*n) in the code. *3 worked for me, though you may need something higher on your system.

Also, try to minimize the size of the bmps or ImageSearch will have trouble matching them. My bmps are only about 25x20, with some as small as 17x14. Of course, don't make them too small or ImageSearch will just match too many things.
Back to top
View user's profile Send private message
Guest2
Guest





PostPosted: Sat Sep 20, 2008 11:36 am    Post subject: Re: Ahk does work in WoW Reply with quote

Lemming wrote:
I used to play WoW till around July this year. I had a simple script, and can confirm that ImageSearch does work here.


thanks for confirmation. I think this issue is no longer releated to AHK.

If WoW is the active window, and if Iīm not in fight, it works fine without any variation. But while fighting it does not.

It was a lack of knowledge an unterstanding of how AHK exactly behaves in such cases.
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group