#Should I Make An AutoClicker?

1 messages · Page 1 of 1 (latest)

ornate quest
#

🤔

stark gyro
#

Go for it they’re really easy to implement at least in most languages

ornate quest
#

idk if I should use python

stark gyro
#

If you use python you can make an auto clicker in like 4 lines of code

ornate quest
#

oh

#

what module do you use to send key strokes?

stark gyro
#

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.

heavy briar
#

why tho, for what

ornate quest
#

Cookie Clicker And Other Clicker Games lol

heavy briar
#

hm

#

prettu sure there’s already scripts for that

#

also with selenium, to collect the power ups as well afaik

ornate quest
#

hmm

heavy briar
#

but sure make your own

#

its good learning

#

have fun!

ornate quest
#

thx

stark gyro
stark gyro
#

Well no, just use JavaScript really, using selenium only really over complicates things

#

Especially for such a simple game like cookie clicker

ornate quest
#

How do you add input for the delay so the user can set it

stark gyro
#

Well using the input method

#

Or using some form of a gui

ornate quest
#

How do you use the input method

stark gyro
ornate quest
#

ok

empty halo
stark gyro
empty halo
stark gyro
#

I’d argue that we should just write it all in ASM

empty halo