Skip to content

Instantly share code, notes, and snippets.

@rayriffy
Last active August 15, 2021 15:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rayriffy/34ff43ee0f1a18255692770f5ab3e024 to your computer and use it in GitHub Desktop.
Save rayriffy/34ff43ee0f1a18255692770f5ab3e024 to your computer and use it in GitHub Desktop.
popcat.click clicker
// popcat auto-clicker
// by rayriffy
// drop this into DevTools console
// to run:
// let agent = clicker()
//
// to stop:
// agent.stop()
let clicker = (interval) => {
const intervalId = setInterval(() => {
document.dispatchEvent(
new KeyboardEvent('keydown', { key: 'a' }),
interval
)
})
const stop = () => clearInterval(intervalId)
return {
intervalId,
stop,
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment