Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
b1.2.0
Browse files Browse the repository at this point in the history
- [+] Add LowHop mode for Tower.
    - Thanks to @千夜小优.
- [+] Add AutoHeal.
- [+] Add HitSelect.
- [+] Add SuperKnockback.
- [+] Add Dynamic mode for Fakelag.
- [※] Improve InvMove.
- [※] Fix Criticals.
- [+] Add showBPS option for LongJump.
- [-] Remove WTap.
  • Loading branch information
xia-mc committed Jun 9, 2024
1 parent a558893 commit 34347dd
Show file tree
Hide file tree
Showing 22 changed files with 474 additions and 115 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import keystrokesmod.event.PreMotionEvent;
import keystrokesmod.event.PreUpdateEvent;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.impl.combat.WTap;
import keystrokesmod.module.impl.combat.SuperKnockback;
import keystrokesmod.module.impl.movement.NoSlow;
import keystrokesmod.utility.RotationUtils;
import net.minecraft.client.Minecraft;
Expand Down Expand Up @@ -298,9 +298,8 @@ public void onLivingUpdate() {
this.setSprinting(true);
}

if (this.isSprinting() && ((this.movementInput.moveForward < f || this.isCollidedHorizontally || !flag3) || (ModuleManager.scaffold != null && ModuleManager.scaffold.isEnabled() && !ModuleManager.scaffold.sprint() && !ModuleManager.tower.canSprint()) || (ModuleManager.wTap.isEnabled() && WTap.stopSprint))) {
if (this.isSprinting() && ((this.movementInput.moveForward < f || this.isCollidedHorizontally || !flag3) || (ModuleManager.scaffold != null && ModuleManager.scaffold.isEnabled() && !ModuleManager.scaffold.sprint() && !ModuleManager.tower.canSprint()))) {
this.setSprinting(false);
WTap.stopSprint = false;
}

if (this.capabilities.allowFlying) {
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/keystrokesmod/module/ModuleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class ModuleManager {
public static HUD hud;
public static Timer timer;
public static Module fly;
public static Module wTap;
public static Module superKnockback;
public static Potions potions;
public static NoFall noFall;
public static PlayerESP playerESP;
Expand All @@ -59,6 +59,8 @@ public class ModuleManager {
public static Criticals criticals;
public static TimerRange timerRange;
public static TargetStrafe targetStrafe;
public static AutoHeal autoHeal;
public static HitSelect hitSelect;

public void register() {
this.addModule(autoClicker = new AutoClicker());
Expand Down Expand Up @@ -111,7 +113,7 @@ public void register() {
this.addModule(hud = new HUD());
this.addModule(new Anticheat());
this.addModule(new BreakProgress());
this.addModule(wTap = new WTap());
this.addModule(superKnockback = new SuperKnockback());
this.addModule(new Xray());
this.addModule(new BridgeInfo());
this.addModule(new TargetHUD());
Expand Down Expand Up @@ -148,6 +150,8 @@ public void register() {
this.addModule(criticals = new Criticals());
this.addModule(timerRange = new TimerRange());
this.addModule(targetStrafe = new TargetStrafe());
this.addModule(autoHeal = new AutoHeal());
this.addModule(hitSelect = new HitSelect());
antiBot.enable();
modules.sort(Comparator.comparing(Module::getName));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void guiUpdate() {

@SubscribeEvent
public void onRenderTick(RenderTickEvent ev) {
if (ev.phase != Phase.END && Utils.nullCheck() && !mc.thePlayer.isEating()) {
if (ev.phase != Phase.END && Utils.nullCheck() && !mc.thePlayer.isEating() && HitSelect.canAttack()) {
if (mc.currentScreen == null && mc.inGameHasFocus) {
if (weaponOnly.isToggled() && !Utils.holdingWeapon()) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void onEnable() {
}

this.disable();
} catch (InterruptedException var5) {
} catch (InterruptedException ignored) {
}

});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void onPacketReceive(@NotNull ReceivePacketEvent event) {
@SubscribeEvent
public void onPreMotion(PreMotionEvent event) {
if (!isEnabled()) return;
if (mc.thePlayer.ticksExisted <= 18 && mc.thePlayer.fallDistance < 1.3) {
if (ticksSinceVelocity <= 18 && mc.thePlayer.fallDistance < 1.3) {
event.setOnGround(false);
}
}
Expand Down
51 changes: 51 additions & 0 deletions src/main/java/keystrokesmod/module/impl/combat/HitSelect.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package keystrokesmod.module.impl.combat;

import keystrokesmod.event.PreUpdateEvent;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.DescriptionSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import net.minecraftforge.event.entity.player.AttackEntityEvent;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.jetbrains.annotations.NotNull;

import static keystrokesmod.module.ModuleManager.hitSelect;

public class HitSelect extends Module {
private static long attackTime = -1;
private final SliderSetting delay;
private final SliderSetting chance;
private static boolean currentShouldAttack = false;

public HitSelect() {
super("HitSelect", category.combat);
this.registerSetting(new DescriptionSetting("chooses the best time to hit."));
this.registerSetting(delay = new SliderSetting("Delay", 500, 200, 750, 1));
this.registerSetting(chance = new SliderSetting("Chance", 80, 0, 100, 1));
}

@SubscribeEvent(priority = EventPriority.LOWEST)
public void onAttack(@NotNull AttackEntityEvent event) {
attackTime = System.currentTimeMillis();
}

@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onPreUpdate(PreUpdateEvent event) {
currentShouldAttack = Math.random() > hitSelect.chance.getInput() || System.currentTimeMillis() - HitSelect.attackTime >= hitSelect.delay.getInput();
}

public static boolean canAttack() {
if (!hitSelect.isEnabled()) return true;
if (currentShouldAttack) {
HitSelect.attackTime = System.currentTimeMillis();
return true;
}

return false;
}

public static boolean canSwing() {
if (!hitSelect.isEnabled()) return true;
return currentShouldAttack;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public void onPreUpdate(PreUpdateEvent e) {
return;
}
boolean swingWhileBlocking = !silentSwing.isToggled() || !block.get();
if (swing && attack) {
if (swing && attack && HitSelect.canSwing()) {
if (swingWhileBlocking) {
mc.thePlayer.swingItem();
}
Expand Down
61 changes: 61 additions & 0 deletions src/main/java/keystrokesmod/module/impl/combat/SuperKnockback.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package keystrokesmod.module.impl.combat;

import keystrokesmod.Raven;
import keystrokesmod.module.Module;
import keystrokesmod.module.impl.world.AntiBot;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.Utils;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.event.entity.player.AttackEntityEvent;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

import java.util.concurrent.TimeUnit;

public class SuperKnockback extends Module {
private final SliderSetting chance;
private final SliderSetting delay;
private final SliderSetting rePressDelay;
private long lastFinish = -1;
private final ButtonSetting playersOnly;
private final ButtonSetting sprintReset;
private final ButtonSetting sneak;

public SuperKnockback() {
super("SuperKnockback", category.combat);
this.registerSetting(chance = new SliderSetting("Chance", 100, 0, 100, 1, "%"));
this.registerSetting(delay = new SliderSetting("Delay", 500, 200, 750, 1, "ms"));
this.registerSetting(rePressDelay = new SliderSetting("Re-press delay", 100, 1, 500, 1, "ms"));
this.registerSetting(playersOnly = new ButtonSetting("Players only", true));
this.registerSetting(sprintReset = new ButtonSetting("Sprint reset", true));
this.registerSetting(sneak = new ButtonSetting("Sneak", false));
}

@SubscribeEvent(priority = EventPriority.HIGH)
public void onAttack(AttackEntityEvent event) {
final long currentTimeMillis = System.currentTimeMillis();
if (!Utils.nullCheck() || event.entityPlayer != mc.thePlayer || currentTimeMillis - lastFinish < delay.getInput()) return;
if (playersOnly.isToggled() && !(event.target instanceof EntityPlayer)) return;
else if (!(event.target instanceof EntityLivingBase)) return;
if (((EntityLivingBase) event.target).deathTime != 0) return;
if (AntiBot.isBot(event.target)) return;

if (Math.random() > chance.getInput()) return;
// code
if (sprintReset.isToggled() && mc.gameSettings.keyBindForward.isKeyDown()) {
KeyBinding.setKeyBindState(mc.gameSettings.keyBindForward.getKeyCode(), false);
Raven.getExecutor().schedule(() -> KeyBinding.setKeyBindState(mc.gameSettings.keyBindForward.getKeyCode(), true),
(long) rePressDelay.getInput(), TimeUnit.MILLISECONDS);
}
if (sneak.isToggled() && !mc.gameSettings.keyBindSneak.isKeyDown()) {
KeyBinding.setKeyBindState(mc.gameSettings.keyBindSneak.getKeyCode(), true);
Raven.getExecutor().schedule(() -> KeyBinding.setKeyBindState(mc.gameSettings.keyBindSneak.getKeyCode(), false),
(long) rePressDelay.getInput(), TimeUnit.MILLISECONDS);
}

lastFinish = currentTimeMillis;
}
}
64 changes: 0 additions & 64 deletions src/main/java/keystrokesmod/module/impl/combat/WTap.java

This file was deleted.

38 changes: 33 additions & 5 deletions src/main/java/keystrokesmod/module/impl/movement/InvMove.java
Original file line number Diff line number Diff line change
@@ -1,46 +1,74 @@
package keystrokesmod.module.impl.movement;

import keystrokesmod.event.ReceivePacketEvent;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.DescriptionSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.Utils;
import net.minecraft.client.gui.inventory.GuiChest;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.network.play.server.S2DPacketOpenWindow;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.jetbrains.annotations.NotNull;
import org.lwjgl.input.Keyboard;

import static keystrokesmod.module.ModuleManager.blink;

public class InvMove extends Module {
public static final String[] MODES = {"Normal", "Blink"};
private final SliderSetting mode;
private final ButtonSetting chestNameCheck;
private boolean blinking = false;
private String currentTitle = "";
public InvMove() {
super("InvMove", category.movement);
this.registerSetting(new DescriptionSetting("Allow you move in inventory."));
this.registerSetting(mode = new SliderSetting("Mode", MODES, 0));
this.registerSetting(chestNameCheck = new ButtonSetting("Chest name check", true));
}

@Override
public void onUpdate() {
if (mc.currentScreen instanceof GuiContainer) {
if (!blinking) {
blink.enable();
if (mc.currentScreen instanceof GuiContainer && nameCheck()) {
if ((int) mode.getInput() == 1) {
if (!blinking) {
blink.enable();
}
blinking = true;
}
blinking = true;

KeyBinding.setKeyBindState(mc.gameSettings.keyBindForward.getKeyCode(), Keyboard.isKeyDown(mc.gameSettings.keyBindForward.getKeyCode()));
KeyBinding.setKeyBindState(mc.gameSettings.keyBindBack.getKeyCode(), Keyboard.isKeyDown(mc.gameSettings.keyBindBack.getKeyCode()));
KeyBinding.setKeyBindState(mc.gameSettings.keyBindRight.getKeyCode(), Keyboard.isKeyDown(mc.gameSettings.keyBindRight.getKeyCode()));
KeyBinding.setKeyBindState(mc.gameSettings.keyBindLeft.getKeyCode(), Keyboard.isKeyDown(mc.gameSettings.keyBindLeft.getKeyCode()));
KeyBinding.setKeyBindState(mc.gameSettings.keyBindJump.getKeyCode(), Utils.jumpDown());
} else {
} else if ((int) mode.getInput() == 1) {
if (blinking && blink.isEnabled()) {
blink.disable();
}
blinking = false;
}
}

private boolean nameCheck() {
if (!chestNameCheck.isToggled()) return true;
if (!(mc.currentScreen instanceof GuiChest)) return true;

return currentTitle.equals("Chest");
}

@SubscribeEvent(priority = EventPriority.HIGH)
public void onReceivePacket(@NotNull ReceivePacketEvent event) {
if (event.getPacket() instanceof S2DPacketOpenWindow) {
S2DPacketOpenWindow packet = (S2DPacketOpenWindow) event.getPacket();

this.currentTitle = packet.getWindowTitle().getUnformattedText();
}
}

@Override
public void onDisable() {
if (blinking && blink.isEnabled()) {
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/keystrokesmod/module/impl/movement/LongJump.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
import keystrokesmod.utility.MoveUtil;
import keystrokesmod.utility.Reflection;
import keystrokesmod.utility.Utils;
import keystrokesmod.utility.render.RenderUtils;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.network.play.server.S12PacketEntityVelocity;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
import org.jetbrains.annotations.NotNull;

public class LongJump extends Module {
Expand All @@ -23,6 +25,7 @@ public class LongJump extends Module {
private final SliderSetting horizonBoost;
private final SliderSetting verticalMotion;
private final ButtonSetting jumpAtEnd;
private final ButtonSetting showBPS;
private int ticks = 0;
private boolean start;
private boolean done;
Expand All @@ -35,6 +38,18 @@ public LongJump() {
this.registerSetting(horizonBoost = new SliderSetting("Horizon boost", 1.0, 0.5, 3.0, 0.05));
this.registerSetting(verticalMotion = new SliderSetting("Vertical motion", 0.35, 0.01, 0.4, 0.01));
this.registerSetting(jumpAtEnd = new ButtonSetting("Jump at end.", false));
this.registerSetting(showBPS = new ButtonSetting("Show BPS", false));
}

@SubscribeEvent
public void onRender(TickEvent.RenderTickEvent event) {
if (!showBPS.isToggled() || event.phase != TickEvent.Phase.END || !Utils.nullCheck()) {
return;
}
if (mc.currentScreen != null || mc.gameSettings.showDebugInfo) {
return;
}
RenderUtils.renderBPS(true, false);
}

@SubscribeEvent(priority = EventPriority.HIGH)
Expand Down
Loading

0 comments on commit 34347dd

Please # to comment.