I have created a small loop script for the videogame Hearthstone*, to automate the purchase of multiple card packs.
I have set the script to only work while the game is active and in windowed mode.
The script asks to set the number of loops, with the below command:
When the input box appears, the game's window doesnt minimize, it simply stays in the background of the screen while the input box is in focus in front.
so far so good.
Here is the problem though:
After I insert the number and the input box closes, the game's window does not regain focus. Because of that, the script doesnt continue.
I tried to activate the game's window, with Send !Esc, Send !TAB, WinActivate ..., but none of that works. The game's window will stay inactive, or it will get minimized and some other background app will gain focus.
When the input box closes, AHK Spy gives me these values:
Does anyone know what causes this and how to fix it? to make the game active after the input box closes?
*its WinTitle info is:
Hearthstone ahk_class UnityWndClass ahk_exe Hearthstone.exe
OS: Windows 10 Pro x64