Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

Simulate a Mouse Click on a Video Game

Hi, I am trying to code a Bot on a video game. The thing is they have a "decent" anti cheat that block mouse click. Tho, keyboard key button work fine. Only mouse click doesn't work

I made a lot of research on stackoverflow and reddit and found nothing that work.

I have tried: Pyautogui, Pydirectinput, Autoit


Anyone have tips?
The real loser is the person who's never failing
(Aug 23, 2022 05:20 PM)SurHomme Wrote:  Hi, I am trying to code a Bot on a video game. The thing is they have a "decent" anti cheat that block mouse click. Tho, keyboard key button work fine. Only mouse click doesn't work

I made a lot of research on stackoverflow and reddit and found nothing that work.

I have tried: Pyautogui, Pydirectinput, Autoit


Anyone have tips?

You could try using keyboard/mouse built in macro software.
   [Image: lkp0bxV.jpg]

SneakyBoots Discord or HF convo me.
(Aug 23, 2022 05:23 PM)Blazin Wrote:  You could try using keyboard/mouse built in macro software.

I will look into that. Thank you.
The real loser is the person who's never failing
(Aug 23, 2022 05:28 PM)SurHomme Wrote:  I will look into that. Thank you.

Look into AutoHotkey. Scripts are really easy to write and they work inside games as well.
You have to use the windows API, sendinput, SetCursorPosition, or mouseevents.

Code
def mouse_move_relative(dx, dy):
    win32api.mouse_event(win32con.MOUSEEVENTF_MOVE, int(dx), int(dy), 0, 0)

https://stackoverflow.com/questions/2964...late-click

The game you're trying to automate may block one of these API calls, but not all of them.
(Sep 10, 2022 06:50 PM)еlixir Wrote:  You have to use the windows API, sendinput, SetCursorPosition, or mouseevents.

Code
def mouse_move_relative(dx, dy):
    win32api.mouse_event(win32con.MOUSEEVENTF_MOVE, int(dx), int(dy), 0, 0)

https://stackoverflow.com/questions/2964...late-click

The game you're trying to automate may block one of these API calls, but not all of them.

Yes they blocked win32api also, I ended up using a DLL file that I found online to simulate the click, mostly used for Valorant cheat
The real loser is the person who's never failing
(Sep 11, 2022 07:28 AM)SurHomme Wrote:  Yes they blocked win32api also, I ended up using a DLL file that I found online to simulate the click, mostly used for Valorant cheat

You should have led with that. Yeah, Vanguard blocks direct calls to the Windows API. I do not know what 'DLL'/driver you are using, but be careful. Some are blacklisted and have a delayed ban.

Checkout this repo: https://github.com/ChrisFirerabbit/Valor...gation-Bot

Code
serMouse = serial.Serial('COM3', baudrate=2000000, writeTimeout=0)
serKeyboard = serial.Serial('COM4', baudrate=2000000, writeTimeout=0)

Adding a hardware layer is a safer option.
(Sep 11, 2022 07:44 AM)еlixir Wrote:  You should have led with that. Yeah, Vanguard blocks direct calls to the Windows API. I do not know what 'DLL'/driver you are using, but be careful. Some are blacklisted and have a delayed ban.

Checkout this repo: https://github.com/ChrisFirerabbit/Valor...gation-Bot

Code
serMouse = serial.Serial('COM3', baudrate=2000000, writeTimeout=0)
serKeyboard = serial.Serial('COM4', baudrate=2000000, writeTimeout=0)

Adding a hardware layer is a safer option.

Thanks you, ill check that out
The real loser is the person who's never failing
I know a lot of runescape botters use JavaScript for their mouse actions when botting. I know it also has something to do with the colors on screen. Not really a huge botter so unfortunately cant offer much more information.

If that doesnt work I would suggest some macros or hotkeys like above posters have mentioned.
Check your pms or telegram


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by PrisoftApr 18, 2021 09:02 AM 0 139 Apr 18, 2021 09:02 AM
Last Post: Prisoft
[C] by pepmyangusJan 3, 2021 03:27 PM 1 124 Jan 3, 2021 03:27 PM
Last Post: xZalurex
[C] by AstateOct 27, 2020 08:15 PM 2 201 Oct 27, 2020 08:15 PM
Last Post: gurlhackerclub