u/KSwagger098

Creating an autoclicker for a Steam Game

Steam game: S&Box

Code (in Python):

import keyboard, pyautogui
from time import sleep


def is_space():
    return keyboard.is_pressed('space')


def click():
    pyautogui.click()


def main():
    print('Holding for 3')
    sleep(3)
    print('Starting...')
    toggle = False
    while True:
        if is_space():
            toggle = not toggle
        
        if toggle:
            print('clicking')
            click()
            sleep(0.05)
        
        if keyboard.is_pressed('esc'):
            print('Peace...')
            break


        sleep(0.01)
  
if __name__ == "__main__":
    main()

Game recently came out and there's a clicker game a user made. I want to preserve my mouse, so I wanted to make a clicker so I don't have to ruin the left mouse button.

reddit.com
u/KSwagger098 — 5 days ago

Trying to make an autoclicker for S&Business

Here's the code:

import keyboard, pyautogui
from time import sleep


def is_space():
    return keyboard.is_pressed('space')


def click():
    pyautogui.click()


def main():
    print('Holding for 3')
    sleep(3)
    print('Starting...')
    toggle = False
    while True:
        if is_space():
            toggle = not toggle
        
        if toggle:
            print('clicking')
            click()
            sleep(0.05)
        
        if keyboard.is_pressed('esc'):
            print('Peace...')
            break


        sleep(0.01)
  
if __name__ == "__main__":
    main()

Quite simple, but it doesn't work on s&box

reddit.com
u/KSwagger098 — 5 days ago