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
-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"
This is the image i use to search for:
any ideas why it does not always recognize the image?