Skip to content

Instantly share code, notes, and snippets.

@OxideWaveLength
Last active February 20, 2021 00:51
Show Gist options
  • Save OxideWaveLength/a42b612c6d036ebe486c604340cfe175 to your computer and use it in GitHub Desktop.
Save OxideWaveLength/a42b612c6d036ebe486c604340cfe175 to your computer and use it in GitHub Desktop.
This is a basic autoclicker for my baseclient
public class AutoClicker extends Module {
public AutoClicker() {
super("AutoClicker", "This is an autoclicker", 0, Category.COMBAT, AntiCheat.VANILLA);
}
@Overerride
public void setup() {
moduleSettings.addDefault("cps", 13);
}
@Override
public void onUpdate(UpdateEvent event) {
if(!(timer.delay(1000 / moduleSettings.getInt("cps"))) // Limit the CPS. You can use Random to add some random (or use noise to make it smooth)
return;
// You should also be able to replace this with Minecraft.gameSettings.keyBindAttack.isPressed() or something like that.
// The difference between Mouse.isButtonDown and that method is that with keyBindAttack the key could be bound to anything and it would still work
if(Mouse.isButtonDown(0)) {
mc.clickMouse();
mc.leftClickCounter = 0;
}
}
}
@OxideWaveLength
Copy link
Author

Please, bare in mind that this piece of code does not contain a package declaration nor imports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment