I will explain how I would like it to work.
this is the image of the game:
https://imgur.com/a/nkfLkrb
these are the images i want checked:
Hotkey_Spell Go check this image
https://imgur.com/a/U2M0XuQ
Hotkey_Item Go check this image
https://imgur.com/a/03Y78CU
I'm having difficulty defining correctly the coordinates that are marked by the red square, as I could do to define the search in these certain areas,
this is the code i'm trying to fix:
Code: Select all
#SingleInstance, Force
#IfWinActive, Pokemon
;==============================CONFIGURAÇÕES/CONFIGS==============================
;[Stage 1]
Hotkey_Spell = {f4}
;[Stage 2]
Hotkey_Item = {NumpadMult}
;==============================!!!!!NAO EDITE NADA DAQUI PRA BAIXO!!!!!!==============================
;==============================!!!!!NAO EDITE NADA DAQUI PRA BAIXO!!!!!!==============================
;==============================!!!!!NAO EDITE NADA DAQUI PRA BAIXO!!!!!!==============================
;==============================!!!!!NAO EDITE NADA DAQUI PRA BAIXO!!!!!!==============================
;==============================!!!!!NAO EDITE NADA DAQUI PRA BAIXO!!!!!!==============================
;==============================!!!!!NAO EDITE NADA DAQUI PRA BAIXO!!!!!!==============================
#NoEnv
#Warn
#SingleInstance Force
#MaxHotkeysPerInterval 99000000
#HotkeyInterval 99000000
#KeyHistory 0
CoordMode, Pixel, Screen
CoordMode, Mouse, Screen
SendMode Input
SetKeyDelay, -1, -1
SetMouseDelay, -1
SetDefaultMouseSpeed, 0
SetWinDelay, -1
SetControlDelay, -1
SetTimer, AutoScript, 200 ;ler a cada 0,2 segundos
;===================AUTO HEALING SCRIPT=================
AutoScript:
If WinActive("ahk_class Qt5QWindowOwnDCIcon")
{
ImageSearch, FirstStageX, FirstStageY, A_ScreenWidth - 368, 0, A_ScreenWidth, A_ScreenHeight + 470, *15, Imagens\manashield.png ;% Stage 1 [HOTKEY SPELL]
if (ErrorLevel = 1)
{
ImageSearch, SecondStageX, SecondStageY, A_ScreenWidth - 368, 0, A_ScreenWidth, A_ScreenHeight + 470, *15, Imagens\utamo.png ;% Stage 2 [Hotkey Item]
if (ErrorLevel = 1)
{
ControlSend,, %Hotkey_Item%, Pokemon ;Hotkey Second Stage [Hotkey Item]
Sleep 50
goto AutoScript
}
ControlSend,, %Hotkey_Spell%, Pokemon ;Hotkey Primeiro Estagio [Hotkey Spell]
Sleep 50
goto AutoScript
}
}
return
;=============HOTKEYS===========
F20::
Pause
return
now I'm going to explain how I need this code to work:
first i would like it to check the top part looking for the purple color bar.
if you find the image:
https://imgur.com/a/U2M0XuQ
go look for the second image :
https://imgur.com/a/03Y78CU
if the second image is found, press the hotkey inside the Hotkey_Item variable
and if it is not found, press the hotkey inside the Hotkey_Spell variable
Can someone help me fix this code?
my monitor resolution is 1360x768