From 19e7562f2fc72c0e0727180d472f36ec6be5efc6 Mon Sep 17 00:00:00 2001 From: kirillsaint Date: Mon, 1 Jan 2024 18:11:15 +0600 Subject: [PATCH] clicker detect test --- .../client/skillissue/SkillIssue.java | 2 ++ .../skillissue/detections/AutoClicker.java | 27 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 src/main/java/net/silentclient/client/skillissue/detections/AutoClicker.java diff --git a/src/main/java/net/silentclient/client/skillissue/SkillIssue.java b/src/main/java/net/silentclient/client/skillissue/SkillIssue.java index 736dc20..ed5ffdf 100644 --- a/src/main/java/net/silentclient/client/skillissue/SkillIssue.java +++ b/src/main/java/net/silentclient/client/skillissue/SkillIssue.java @@ -5,6 +5,7 @@ import net.silentclient.client.Client; import net.silentclient.client.event.EventManager; import net.silentclient.client.event.EventTarget; import net.silentclient.client.event.impl.ClientTickEvent; +import net.silentclient.client.skillissue.detections.AutoClicker; import net.silentclient.client.skillissue.detections.Detection; import net.silentclient.client.skillissue.detections.Reach; import net.silentclient.client.utils.Requests; @@ -23,6 +24,7 @@ public class SkillIssue { EventManager.register(this); Client.logger.info(String.format("[SkillIssue]: Initialising (v%s)", VERSION)); detections.add(new Reach(this)); + detections.add(new AutoClicker(this)); timer = new TimerUtils(); } diff --git a/src/main/java/net/silentclient/client/skillissue/detections/AutoClicker.java b/src/main/java/net/silentclient/client/skillissue/detections/AutoClicker.java new file mode 100644 index 0000000..736ca65 --- /dev/null +++ b/src/main/java/net/silentclient/client/skillissue/detections/AutoClicker.java @@ -0,0 +1,27 @@ +package net.silentclient.client.skillissue.detections; + +import net.silentclient.client.Client; +import net.silentclient.client.event.EventTarget; +import net.silentclient.client.event.impl.EntityAttackEvent; +import net.silentclient.client.skillissue.SkillIssue; +import net.silentclient.client.utils.PlayerUtils; +import org.lwjgl.input.Mouse; + +public class AutoClicker extends Detection { + private long lastHit = 0; + + public AutoClicker(SkillIssue skillIssue) { + super(skillIssue, "AutoClicker"); + } + + @EventTarget + public void onHit(EntityAttackEvent event) { + if(System.currentTimeMillis() - lastHit < 500 || !PlayerUtils.isSurvival()) { + return; + } + this.lastHit = System.currentTimeMillis(); + if(!Mouse.isButtonDown(0) && Client.getInstance().getCPSTracker().getLCPS() > 10) { + this.detect(String.format("lmb is not pressed when hitting, %s cps", Client.getInstance().getCPSTracker().getLCPS())); + } + } +}