Hello, I am trying to make an infinite loop that left clicks until I press a certain key. I have tried what looked logical to me but none of the methods worked. Can someone point me in the right direction?
I used the following modules:
pyautogui (for the actions I want my loop to perform)
sys ( I tried binding sys.exit() and sys.quit() to a key)
keyboard ( for controlling the loop with keyboard hotkeys)
I tried binding sys.exit() to a hotkey within a while True loop (Try1+2), trying the same with lambda: (Try3).
Then I switched my approach and tried making an infinite while loop that runs when the count is above 0 and making a hotkey that makes the count equal to 0 thus, breaking the loop in my understanding (Try4). In my last attempt I tried to bind break to a hotkey and if the hotkey is not pressed, make my script do a leftclick (Try5). I ran out of ideas at this point.
I would like someone to help me understand why I'm failing.
I used the following modules:
pyautogui (for the actions I want my loop to perform)
sys ( I tried binding sys.exit() and sys.quit() to a key)
keyboard ( for controlling the loop with keyboard hotkeys)
I tried binding sys.exit() to a hotkey within a while True loop (Try1+2), trying the same with lambda: (Try3).
Then I switched my approach and tried making an infinite while loop that runs when the count is above 0 and making a hotkey that makes the count equal to 0 thus, breaking the loop in my understanding (Try4). In my last attempt I tried to bind break to a hotkey and if the hotkey is not pressed, make my script do a leftclick (Try5). I ran out of ideas at this point.
I would like someone to help me understand why I'm failing.