Hi Guys,I am still new in AHK and I successfully write my own auto-heal script for a game( Pirate King Online) with the info provided in the forum. The script works very well until I minimized the window. I tried the scripts with WinExist() and ControlSend but still failed. Basically, my script is commanding my healer to heal my attacker when the attacker's HP falls below. I want my script to works on the minimized healer's window. Can anyone help me with this? Thank you in advance for your kind assistance.
Code: Select all
Sleep, 5000
DetectHiddenWindows, On
SetTitleMatchMode, 2
SetKeyDelay, 250
50HP:= 142
HealthY:= 54
if WinExist("Pirate King Online"){
Loop
{
PixelGetColor, Current_HP, %50HP%, %HealthY%, RGB
If (Current_HP != 0xE5898C)
{
ControlSend,, {F5}, "Pirate King Online"
}
}
}