Jump to content
Killer5a

[UNIVERSAL] Anti-Autoclicker

Recommended Posts

This is a simple anti autoclicker i made for Project Silverlake.
There isn't really much to it, and very easy to add to your mission.

How it works, it counts up your clicks and removes each click from the variable after 1 second.
Once the first click gets removed, it will run the if statement and its up to you what it does from there.
I set it up to just log it as seen below.
 

ClicksPerSecond = 0; //Sets a value to the variable
lastlogging = 0; //Sets value to the last logging
clickingstarted = false; // Default value

(findDisplay 46) displayAddEventHandler ["MouseButtonDown",{
_this spawn {
ClicksPerSecond = ClicksPerSecond + 1; clickingstarted = true; //Ups the clicks per second
if(ClicksPerSecond < 0) then {ClicksPerSecond = 0;}; //Just to make sure the value doesn't go below 0
hint format["Clicks per second: %1",ClicksPerSecond]; //Just a hint to demonstrate that it catches your clicks per second
uisleep 1; ClicksPerSecond = ClicksPerSecond - 1; // Reduces value after 1 second (helps getting clicks per second)
if(ClicksPerSecond >= 20 && clickingstarted) then { //If clicks per second is equal or above 20 it runs this
  clickingstarted = false;
  hint format["AutoClicker Detected (%1 c/s)",ClicksPerSecond];
  if((lastLogging + 20) < time) then { // if its been 20 seconds since last time it logged it, it will log it again
    lastLogging = time;  // resets the time before it logs it again
    systemChat "Logged the autoclicker.."; //Replace this with a logging function or auto kick/ban
  };
};
if(ClicksPerSecond < 0) then {ClicksPerSecond = 0;}; //Just to make sure the value doesn't go below 0
}}];

GIF of how it works: https://i.gyazo.com/62f985e52bcb11eb6f1f0be5c90aefae.mp4

How to use it for your server:
You just need to execute it on the player when he joins, so drop it in the initplayerlocal and your good to go!

Now you have a simple anti-autoclicker. 
Made by King / Killer5a

Edited by Killer5a
  • Like 5

Share this post


Link to post
Share on other sites

Note: This does not stop people from rebinding their default action. To counter that. You can just use the same script but add it to the event handler for KeyDown or KeyUp

Edited by Killer5a

Share this post


Link to post
Share on other sites
28 minutes ago, Stich۞ said:

So if i want to use this on Alits 5.0, does the admin recive a msg, when autoclicker is detected?

This is pretty much a template, you would have to do that yourself, but shouldn't be too hard

Share this post


Link to post
Share on other sites

When following the instructions on where to put it in the first post nothing happen.

When following Repentz advise the client doesn't get initialized correct and spawns at the spawn marker without loadout.

 

EDIT: Got it to work know. Just wondering how I can get the name of the player that got detected...

Edited by Dunkstormen

Share this post


Link to post
Share on other sites

so, do I understand this right?

the script detects Autoclicker if a person does 20 or more clicks per second ?!

and in this line we can tell the script to kick the person with replasing the "Logged the autoclicker..." by the Arma Command for kicking players?

    systemChat "Logged the autoclicker.."; //Replace this with a logging function or auto kick/ban

Share this post


Link to post
Share on other sites
15 hours ago, Denniis_CHX45 said:

so, do I understand this right?

the script detects Autoclicker if a person does 20 or more clicks per second ?!

and in this line we can tell the script to kick the person with replasing the "Logged the autoclicker..." by the Arma Command for kicking players?

    systemChat "Logged the autoclicker.."; //Replace this with a logging function or auto kick/ban

Yes this is how I did mine

ClicksPerSecond = 0;
lastlogging = 0;
clickingstarted = false;

(findDisplay 46) displayAddEventHandler ["MouseButtonDown",{
_this spawn {
ClicksPerSecond = ClicksPerSecond + 1; clickingstarted = true;
if (ClicksPerSecond < 0) then {ClicksPerSecond = 0;};
uisleep 1; ClicksPerSecond = ClicksPerSecond - 1;
if (ClicksPerSecond >= 11 && clickingstarted) then {
  clickingstarted = false;
  if ((lastLogging + 5) < time) then {
  lastLogging = time;
	_uid = getPlayerUID player;
	_name = name player;
	[_name,_uid,ClicksPerSecond] remoteExec ["life_fnc_autoclicker",2];
  [format["AutoClicker Detected: %1 - %2 Is using a AutoClicker ClicksPerSecond %3",_uid,_name,ClicksPerSecond],"AutoClicker"] remoteExecCall ["A3Log", 2];
  disableUserInput true;
  ["AutoClicker",false,true] call BIS_fnc_endMission;
  };
};
if (ClicksPerSecond < 0) then {ClicksPerSecond = 0;};
}}];

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.