Ask coding questions

← Back to all posts
bookmarklet autoclicker
CoolGuy27 (68)

does anyone know a bookmarklet autoclicker?

tussiez (1648)

If you mean a webpage autoclicker, this is mine:
EDIT: Fixed error in code

javascript:setTimeout(function(){var n,e=prompt("Autoclick speed? Less is faster"),t=0,l=0,c=setInterval(function(){null!=n&&null!=n&&},e);document.body.addEventListener("keyup",function(e){"`"==e.key&&(null!=c?(clearInterval(c),c=void 0,alert("Stopped clicking")):c=setInterval(function(){null!=n&&null!=n&&},e))}),document.body.addEventListener("mousemove",function(e){t=e.clientX,l=e.clientY,n=document.elementFromPoint(t,l)})});```
CoolGuy27 (68)

@tussiez I don't seem to understand how to activate it, could you clarify?

tussiez (1648)

@CoolGuy27 Click on the bookmarklet.

tussiez (1648)

@CoolGuy27 Sorry, the code is bugged. In a minute or so I'll post the fixed version.

Coder100 (18099)

why not make it urself

CoolGuy27 (68)

@Coder100 i am not smart enough and trying to learn

xxpertHacker (930)

This isn't too clear, do you mean something that clicks a bookmarklet, or a bookmarklet that clicks stuff?

If you're referring to the former, that isn't possible without native code.

As for the latter, that depends on what you want to be clicked.

CoolGuy27 (68)

@xxpertHacker i am referring to the latter, and I honestly don't know what I mean myself

xxpertHacker (930)

@CoolGuy27 Well, can you give a webpage, and an example of what you want clicked? I've made plenty auto clicker scripts.

xxpertHacker (930)

@CoolGuy27 Oh, then ig all you'll need is this:

clicker: {
	"use strict";

	const { Number } = self;

	const milliseconds = Number.parseInt(
			"How many milliseconds do you want to wait before clicking again?",
		), 10

	if (false === Number.isSafeInteger(milliseconds)) {
		self.alert("Input was not an integer");

		break clicker;

	// mouse coordinates
	let clientX = 0,
		clientY = 0;

	const { document } = self;

		() => {
			// document.elementFromPoint should probably never return null, but I'm not sure
			// not all elements have #click

		event => {
			({ clientX, clientY } = event);
		}, {
			passive: true

Tested it myself.

And the minified bookmarklet:

javascript:clicker:{"use strict";const{Number}=self;const milliseconds=Number.parseInt(self.prompt("How many seconds do you want to wait before clicking again?",'1'),10);if(false===Number.isSafeInteger(milliseconds)){self.alert("Input was not an integer");break clicker;}let clientX=0,clientY=0;const{document}=self;self.setInterval(()=>{document.elementFromPoint(clientX,clientY)?.click?.();},milliseconds);document.addEventListener("mousemove",event=>{({clientX,clientY}=event);},{passive:true});}
xxpertHacker (930)

@RexGREEN Didn't design it with that in mind, it never does.