0

I am writing an auto clicker and want to have the delay as a CPS (clicks per second) so, how would I work out the delay from the CPS value in python?

I have tried googling but only found CPS testers, no actual code

Here is a snippet of code:

def clickerstart():  #this functions activates when you press the "start" button in the autocklicker menu  ¦
    if clickerlmb == 1:
        mouse.press(Button.left)
        time.sleep(delay) # "delay" is the time to sleep, found from the CPS
        mouse.release(Button.left)
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Zax71
  • 45
  • 7

1 Answers1

1

period = 1 / frequency

You're converting clicks per second into seconds per click. In terms of your likely variables:

delay = 1 / cps
Prune
  • 76,765
  • 14
  • 60
  • 81