Answer the question
In order to leave comments, you need to log in
Programmatically emulate a click
Hello.
There is some software, namely the game. And it has a proprietary anti-cheat.
There is such a thing in WinAPI as mouse_event() or its modern counterpart SendInput().
In the game, I need to programmatically make a click, or a lot of clicks, but not in a short period of time, but on the occurrence of a certain event.
Until recently everything was fine. But now the anti-cheat has learned to block program input after a few clicks. The number could not be established, always in different ways.
Long tests with various options did not lead to anything. Those. anti-cheat does not matter, 10 clicks pass with an interval of 20ms or 1000ms each, after 5-6 clicks the input will be blocked.
By blocking, I mean this behavior: we drove a few clicks, the anti-cheat blocked. Now, if we try to call a click (mouse_event, for example), then nothing will happen in the game window. It's in the game window. You can keep sending clicks and minimize the game to find that clicks are actually being made, but when you expand the game - again, nothing.
After a while (again, it was not possible to install), the lock "releases" and you can run a couple more clicks. And you can also not wait and restart the program that sends clicks (it does not always work).
Google licked all over, I did not find any solutions.
There is an interesting feature. I have a keyboard on which you can write macros on additional buttons. If you do something like:
Click
Goto 1
Answer the question
In order to leave comments, you need to log in
And after blocking program clicks - do clicks work from the mouse?
If yes, then you need to understand how the events that you send to the program differ from the events that the system generates. I don't know much about WinAPI, but it seems to me that somewhere in the event there must be a device identifier. There is another option that the anti-cheat compares the incoming events with some GetMouseState - in which nothing really changes and, by these signs, determines that something is not clean here (by the way, this can also explain the fact that not always after the same number of clicks input is blocked and that restarting sometimes helps). Then you need to look for the opportunity to change this state as well.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question