ImageSearch not reliable (Diablo 3)

Ask gaming related questions (AHK v1.1 and older)
Baki
Posts: 5
Joined: 23 Jul 2017, 12:50

ImageSearch not reliable (Diablo 3)

23 Jul 2017, 13:06

Hello,

What i want to do:
-search for an Image in the upper left part of the screen
-if image is found press 3
-if image is not found press RButton

Here's the code:

Code: Select all

*space:: 
While GetKeyState("space","P")
{
ImageSearch, outX, outY, 0, 0, 500, 100, C:\rathma\10mages.bmp
if ErrorLevel = 1
{
Send {RButton down}
Send {RButton up}
}

else
{
Send 3
}

}
return
What i want to do:
-Search for an Image in the upper left part of the screen
-If image is found press 3
-If image is not found press RButton

If the image is not present all works as expected - it sends "RButton". If the image is present ahk sends a mix of "RButton" and "3" - in other words: it does not detect the image reliable. I tried adding *n (2-200) but nothing changed. Also tried the .png format.

Ingame Screen: i want to look for the Buff in the upper left corner with the "10"
Image
This is the image i use to search for:
Image

any ideas why it does not always recognize the image?
User avatar
Capn Odin
Posts: 1352
Joined: 23 Feb 2016, 19:45
Location: Denmark
Contact:

Re: ImageSearch not reliable (Diablo 3)

24 Jul 2017, 09:53

try this.
Attachments
img.png
img.png (609 Bytes) Viewed 2226 times
Please excuse my spelling I am dyslexic.
Baki
Posts: 5
Joined: 23 Jul 2017, 12:50

Re: ImageSearch not reliable (Diablo 3)

24 Jul 2017, 14:13

thanks again for your answer, Capn Odin. Ahk does not recognize the modified image at all.

Anybody got another idea what i could try to make this work correctly?
Baki
Posts: 5
Joined: 23 Jul 2017, 12:50

Re: ImageSearch not reliable (Diablo 3)

24 Jul 2017, 15:38

i have experimented a bit:

-if i search a screenshot (not ingame) it works flawlessly
-no matter what image i am searching for while i am ingame, it always gives mixed results. found, found, found, not found, not found, not found etc.

Edit: did some more testing: works while i am in the "lobby". as soon as i enter a game it will always give mixed results
Last edited by Baki on 24 Jul 2017, 15:55, edited 1 time in total.
grant
Posts: 323
Joined: 14 Oct 2015, 17:27

Re: ImageSearch not reliable (Diablo 3)

24 Jul 2017, 15:46

My immediate thought is that there may be shadows passing over and behind the image. This is what makes games pretty to the eye.
You can try work around that by including a variation on the color. Someone built a function that gets the average color for an area and you might be able to use that but the screen looks a bit dark for that to be of much use.
Another potion might be to rather look for a set of unique pixel colors at specific locations.

I had an interesting one where multiple images were needed and they were checked after each other, turns out the images all looked the same but the actual colors were different. A color looks blue because the color next to it is green when it is actually something else.
floowsnaake48

Re: ImageSearch not reliable (Diablo 3)

24 Jul 2017, 16:03

use cheat engine to find the value/flag that changes and read it with ahk
Baki
Posts: 5
Joined: 23 Jul 2017, 12:50

Re: ImageSearch not reliable (Diablo 3)

24 Jul 2017, 16:25

thanks for your advice, grant.

pixelgetcolor gives exactly the same mixed results :(

A cheat engine is not an option for me. ahk is as close to cheating as it gets for me :)
S1lver
Posts: 23
Joined: 07 Nov 2020, 04:14

Re: ImageSearch not reliable (Diablo 3)

23 Jun 2022, 05:22

did you make it work?

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: Shoobis and 106 guests