-
Notifications
You must be signed in to change notification settings - Fork 34
/
autoclicker.js
32 lines (29 loc) · 1.04 KB
/
autoclicker.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//autoclicker, very fast
javascript: var DELAY = 1;
var autoClickerStyleElement = document.createElement("style");
autoClickerStyleElement.innerHTML = "*{cursor: crosshair !important;}";
document.body.appendChild(autoClickerStyleElement);
function addClicker(e) {
if (!e.isTrusted) {
return;
}
if (e.target.classList.contains("auto-clicker-target")) {
e.target.classList.remove("auto-clicker-target");
} else {
e.target.classList.add("auter-target");
}
document.body.removeChild(autoClickerStyleElement);
document.body.removeEventListener("click", addClicker);
e.preventDefault();
autoClick(e.target);
}
function autoClick(element) {
if (element.classList.contains("auto-clicker-target")) {
element.click();
setTimeout(function() {
autoClick(element);
console.Clear();
}, DELAY);
}
}
document.body.addEventListener("click", addClicker, 0);