Skip to content

Instantly share code, notes, and snippets.

@page2me
Forked from rayriffy/popcat.js
Created August 15, 2021 15:39
Show Gist options
  • Save page2me/f734e073cac2abf4e1be6e3827b4d27b to your computer and use it in GitHub Desktop.
Save page2me/f734e073cac2abf4e1be6e3827b4d27b 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