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:
Code: Select all
InputBox, times, Enter number of loops,,,280,100
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?ahk_class
ahk_exe
*its WinTitle info is:
Code: Select all
Hearthstone ahk_class UnityWndClass ahk_exe Hearthstone.exe