#Should I Make An AutoClicker?
1 messages · Page 1 of 1 (latest)
Go for it they’re really easy to implement at least in most languages
idk if I should use python
If you use python you can make an auto clicker in like 4 lines of code
pynput
Sorry for the delay
Really simple example```python
from time import sleep
from threading import Thread
from pynput.mouse import Button, Controller
from pynput.keyboard import Listener, KeyCode
Variables to change the behavor of the auto-clicker
delay = 0.001
button = Button.left
start_key = KeyCode(char='a')
stop_key = KeyCode(char='b')
class ClickMouse(Thread):
def init(self, delay, button):
super(ClickMouse, self).init()
self.delay = delay
self.button = button
self.running, self.program_running = False, True
def start_clicking(self): self.running = True
def stop_clicking(self) : self.running = False
def exit(self):
self.stop_clicking()
self.program_running = False
# Will continue until thread dies
def run(self):
while self.program_running:
while self.running:
mouse.click(self.button)
sleep(self.delay)
sleep(0.1)
mouse = Controller()
click_thread = ClickMouse(delay, button)
click_thread.start()
def on_press(key):
if key == start_key and not click_thread.running:
click_thread.start_clicking()
elif key == stop_key:
click_thread.exit()
listener.stop()
Pynput event listener
with Listener(on_press=on_press) as listener: listener.join()
I could make this in a few lines of code if I felt like it, but this solution is very readable in my opinion.
Also, this code isn't tested and is just completely based off my knowledge of pynput, this code should work without issues though.
why tho, for what
Cookie Clicker And Other Clicker Games lol
hm
prettu sure there’s already scripts for that
also with selenium, to collect the power ups as well afaik
hmm
thx
There honestly isn’t a need for selenium for cookie clicker
depends
Well no, just use JavaScript really, using selenium only really over complicates things
Especially for such a simple game like cookie clicker
well, i dont know JS lmao
How do you add input for the delay so the user can set it
How do you use the input method
ok
Pyautogui + pydirectinput
Also there are keyboard and mouse modules
I'd argue that pynput is just better in this case.
Maybe
I'd argue that C++ is better in this case xD
I’d argue that we should just write it all in ASM
Why not just binaries?