Small JS script for detecting autoclicking in the client. Include
<script src="https://unpkg.com/antiautoclick@1.0.6/antiautoclick.js"></script>
in your HTML, JS usage is as follows:
const detector = new antiautoclick(punishment, options);
A function to run when autoclicking is detected, recommended is:
window.location.reload();
const options = {
clicksToSave: 40,
detectNonhumanClick: true,
detectClickInterval: {
enabled: true,
margin: 10
},
detectFastClicking: {
enabled: true,
maximumAvgPerSecond: 40
}
}
How many clicks the program keeps track of. Recommended 40, but you can increase it to improve accuracy at the cost of some RAM.
Determines whether element.click()
is detected. Recommended true.
Detects repetitive and robotic clicking. (Ex. clicking exactly once every 10ms)
- enabled: Determines whether it is active. Recommended true.
- margin: Determines the maximum average difference between click timing to detect. Recommended 10ms.
Detects really fast clicking.
- enabled: Determines whether it is active. Recommended true
- maximumAvgPerSecong: Determines the maximum average clicks per second without detection. Recommended 40.