0

i'm trying to make a script that clicks letters on the alphabet every x amount of time. im able to open gmod with pyautogui but once it comes to interacting with the application itself, nothing happens, what do I do

def moveToApp():

#Temporary x,y
pyautogui.moveTo(572, 1056)
pyautogui.click()
time.sleep(0.5)
pyautogui.press("e")

moveToApp()

Edward
  • 1
  • Unrelated, but I like pynput for this sort of thing. – Dock Jan 03 '21 at 17:57
  • thanks, ill give that a try – Edward Jan 03 '21 at 17:57
  • 1
    it may be because gmod blocks inputs from "fake" keyboards and mouse. Games have this kind of feature to prevent cheating. – user14518362 Jan 03 '21 at 18:00
  • if it is indeed the source of your problem you can work around it by sending low level keyboard inputs with python. See [link](https://stackoverflow.com/questions/13564851/how-to-generate-keyboard-events-in-python) – user14518362 Jan 03 '21 at 18:03

0 Answers0