K
K
kodbiprog2021-04-09 12:39:34
Bots
kodbiprog, 2021-04-09 12:39:34

How to control the mouse in games with Python?

Hello everyone, I'm writing a cheat for Samp, I think some people know about auto + c.
In short, the bot must perform the following actions:
1. Opens the sight (right mouse button)
2. makes a shot (left mouse button)
3. (presses "C")
I took the pyautogui library and the keyboard library to help, the sight opens, but after this immediately it aims at the floor, at the very bottom.So
my question is, how do I make it so that the scope is straight or how to raise it up with python?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DemoNiMa, 2021-04-09
@kodbiprog

I would not advise using these libraries, they are sometimes not perceived by games. Probably autohotkey(ahk) would be better.
Here's a site for you , translate and try, everything is perfectly clear.
Look carefully at the keyboard layout if you press the keyboard, be sure to use English :)

import pyautogui
import time

pyautogui.click(button='right') #pyautogui.click() - так вроде бы тоже работает
pyautogui.move(0, -300, 0.4) # 0: ось х, -300: ось y, скорость перемещения мыши
time.sleep(4)
pyautogui.hotkey('c') #нажимает "с".

M
maksam07, 2021-04-09
@maksam07

You can do it, but purely because of disrespect for cheaters, I will not advise libraries for working with the cursor

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question