Hello there! Im writing a bot for a game and very often cursor moves only when I move my mouse.
There is a function I use to click:
( ag = pyautogui)
def smoothClick(x,y):
currentpos = ag.position()
difx = x-currentpos.x
dify = y - currentpos.y
for i in range(2,101):
perc = i/100
print((currentpos.x + difx*perc,currentpos.y+ dify*perc))
win32api.SetCursorPos((int(currentpos.x + difx*perc),int(currentpos.y+ dify*perc)))
sleep(0.000001)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y, 0, 0)
sleep(30 / 1000)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y, 0, 0)