1

I play this game that i would like to automate which requires little mouse movement as well as some keyboard inputs. While the code works(most of the time), sometimes it dosnt move the mouse all the time.

pydirectinput.keyDown('l')
time.sleep(0.5)
pydirectinput.keyUp('l')
time.sleep(2)
pydirectinput.leftClick(1265,437)
time.sleep(8.5)
pydirectinput.leftClick(39,704)

The keyboard output works however the leftclicks seem to not function they just dont move the curser and it only blinks to the location when I move the mouse(slightly) manually. I was wondering if there is any solution to this problem. Thanks

Wiz Ninja
  • 19
  • 1
  • 5
  • I think left click is only `pydirectinput.click()`, and not `.leftClick`. If that's not it, instead of using the `click` function directly, try using `pydirectinput.mouseDown()` and then `pydirectinput.mouseUp()`. Also try some time in between the Down and Up, maybe `time.sleep(0.2)` – Sahira Mena May 13 '21 at 08:09

0 Answers0