@boiler
Perfect, I did the test here, and it worked just fine.
Now a continuity, after finding the image, I needed him to move the mouse and click on it, the move stop is working, but the click does not, it does not click.
This same click scheme works in the game because I created a script to move the mouse and click to walk, and it's ok, but in the inventory clicking on the item will not work.
Here's my current code.
Code: Select all
#NoEnv
#SingleInstance Force
#InstallKeybdHook
#InstallMouseHook
#MaxHotkeysPerInterval 99000000
#HotkeyInterval 99000000
#KeyHistory 0
#WinActivateForce
Process, Priority, , A
SetBatchLines, -1
SetKeyDelay, 30, 30
SetMouseDelay, -1
SetDefaultMouseSpeed, 0
SetWinDelay, -1
SetControlDelay, 500
F5::
; captura uma imagem da tela inteira
CoordMode, Mouse, Pixel, Screen
; captura uma imagem da tela inteira
ImageSearch, foundX, foundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *5 images\testesd.png
; verifica se a imagem foi encontrada
if ErrorLevel = 2
{
MsgBox Could not conduct the search.
}
else if ErrorLevel = 1
{
MsgBox Image could not be found on the screen.
}
else
{
; move o mouse para a posição da imagem
MouseMove, foundX, foundY, 0
; adiciona um pequeno atraso antes de clicar
Sleep, 200
; clica na posição da imagem
ControlClick, 50 100, , , , Left, 1, D
}
Return