Few years ago I wrote a simple bot for a game that was using ControlSend for sending controls to the game window.
Recently I tried running it and it seems the developers of the game put some kind of protection that renders my bot useless.
I used Spy++ to see if the game received messages from the keyboard and indeed, whenever I pressed a key Spy++ would pick up a message being sent to the game window.
After messing around for weeks with c++, c# (SendMessage, PostMessage, SendInput, wrappers for input etc.) trying to send the input myself I reached to no result. Spy++ simply doesn't pick up any message I try sending to the game window myself, only those sent from the keyboard.
I decided to take another approach. I checked to see if I can use the osk (virtual keyboard) to send the controls to the game and indeed, using the mouse to click on the virtual keys works. Spy++ picks up the message and the game responds to the controls being sent.
I started writing a quick AutoIt script that will use ControlClick / MouseClick to send clicks to the osk, but it appears that the virtual keyboard is not responding to the clicks.
I'm sure that everything I mentioned was done correctly and my conclusions are justified (meaning I didn't mess up the code or something like that).
I now raise the question:
How would I go about sending clicks to the virtual keyboard in order for it to process them?
This is how I'm currently sending the clicks (either ControlClick or MouseClick):
Code:
Func SendClick($x, $y)
$windowPosition = WinGetPos($window);
;ControlClick($window, "", "left", 1, $x, $y);
MouseClick("left", $windowPosition[0] + $x, $windowPosition[1] + $y, 1, 10);
EndFunc
Thank you in advance!







