Script Works on background program help

Ask gaming related questions (AHK v1.1 and older)
alex1527
Posts: 1
Joined: 03 May 2020, 01:20

Script Works on background program help

Post by alex1527 » 03 May 2020, 02:22

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"
		}
	}
}
Attachments
Capture.PNG
This is the window's detail
Capture.PNG (26.3 KiB) Viewed 337 times

Return to “Gaming Help (v1)”