From 7528de4c3f663c84791cfce3785057d8bcb4abd5 Mon Sep 17 00:00:00 2001 From: jackh Date: Wed, 29 Jan 2025 10:47:48 -0700 Subject: [PATCH] t --- .../module/impl/combat/KillAura.java | 6 +- .../module/impl/movement/Bhop.java | 3 + .../module/impl/movement/Sprint.java | 2 +- .../module/impl/player/DelayRemover.java | 12 +- .../module/impl/player/Scaffold.java | 129 +++++++++++------- .../module/impl/player/Tower.java | 59 ++++---- .../keystrokesmod/utility/ModuleUtils.java | 56 ++++++++ .../utility/command/CommandManager.java | 4 + .../utility/command/impl/Help.java | 1 + .../utility/command/impl/Status.java | 89 ++++++++++++ 10 files changed, 272 insertions(+), 89 deletions(-) create mode 100644 src/main/java/keystrokesmod/utility/command/impl/Status.java diff --git a/src/main/java/keystrokesmod/module/impl/combat/KillAura.java b/src/main/java/keystrokesmod/module/impl/combat/KillAura.java index 00fd81d..a095acd 100644 --- a/src/main/java/keystrokesmod/module/impl/combat/KillAura.java +++ b/src/main/java/keystrokesmod/module/impl/combat/KillAura.java @@ -966,13 +966,15 @@ public class KillAura extends Module { case 1: blinking.set(true); if (ModuleUtils.isBlocked) { - if (firstEdge <= 1) { + if (firstEdge == 1) { setSwapSlot(); swapped = true; - firstEdge++; } else { mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, DOWN)); + } + firstEdge++; + if (firstEdge > 3) { firstEdge = 0; } lag = false; diff --git a/src/main/java/keystrokesmod/module/impl/movement/Bhop.java b/src/main/java/keystrokesmod/module/impl/movement/Bhop.java index 3958a19..542ade8 100644 --- a/src/main/java/keystrokesmod/module/impl/movement/Bhop.java +++ b/src/main/java/keystrokesmod/module/impl/movement/Bhop.java @@ -38,6 +38,9 @@ public class Bhop extends Module { @SubscribeEvent public void onPostPlayerInput(PostPlayerInputEvent e) { + if (!mc.thePlayer.onGround || mc.thePlayer.capabilities.isFlying) { + return; + } if (hopping) { mc.thePlayer.movementInput.jump = false; } diff --git a/src/main/java/keystrokesmod/module/impl/movement/Sprint.java b/src/main/java/keystrokesmod/module/impl/movement/Sprint.java index 7e5e136..7d8fe66 100644 --- a/src/main/java/keystrokesmod/module/impl/movement/Sprint.java +++ b/src/main/java/keystrokesmod/module/impl/movement/Sprint.java @@ -65,7 +65,7 @@ public class Sprint extends Module { public boolean disableBackwards() { limit = MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw - Utils.getLastReportedYaw()); - double limitVal = 135; + double limitVal = 125; if (!disableBackwards.isToggled()) { return false; } diff --git a/src/main/java/keystrokesmod/module/impl/player/DelayRemover.java b/src/main/java/keystrokesmod/module/impl/player/DelayRemover.java index 9091b4a..3fad243 100644 --- a/src/main/java/keystrokesmod/module/impl/player/DelayRemover.java +++ b/src/main/java/keystrokesmod/module/impl/player/DelayRemover.java @@ -30,9 +30,17 @@ public class DelayRemover extends Module { if (oldReg.isToggled()) { ((IAccessorMinecraft) mc).setLeftClickCounter(0); } - if (removeJumpTicks.getInput() == 1 || removeJumpTicks.getInput() == 2 && removeJumpDelay()) { - ((IAccessorEntityLivingBase) mc.thePlayer).setJumpTicks(0); + switch ((int) removeJumpTicks.getInput()) { + case 1: + ((IAccessorEntityLivingBase) mc.thePlayer).setJumpTicks(0); + break; + case 2: + if (!mc.thePlayer.onGround && mc.thePlayer.isCollidedVertically) { + ((IAccessorEntityLivingBase) mc.thePlayer).setJumpTicks(0); + } + break; } + } private boolean removeJumpDelay() { diff --git a/src/main/java/keystrokesmod/module/impl/player/Scaffold.java b/src/main/java/keystrokesmod/module/impl/player/Scaffold.java index 42d159e..c0e9907 100644 --- a/src/main/java/keystrokesmod/module/impl/player/Scaffold.java +++ b/src/main/java/keystrokesmod/module/impl/player/Scaffold.java @@ -96,7 +96,7 @@ public class Scaffold extends Module { private int scaffoldTicks; private long firstStroke, strokeDelay = 575; - private float lastEdge, lastEdge2; + private float lastEdge, lastEdge2, yawAngle; public Scaffold() { super("Scaffold", category.player); @@ -129,7 +129,6 @@ public class Scaffold extends Module { isEnabled = true; moduleEnabled = true; ModuleUtils.fadeEdge = 0; - firstStroke = 0; FMLCommonHandler.instance().bus().register(scaffoldBlockCount = new ScaffoldBlockCount(mc)); lastSlot.set(-1); @@ -149,8 +148,11 @@ public class Scaffold extends Module { @SubscribeEvent public void onPreMotion(PreMotionEvent e) { + if (!Utils.nullCheck()) { + return; + } onGroundTicks = !mc.thePlayer.onGround ? 0 : ++onGroundTicks; - if (!isEnabled || !holdingBlocks()) { + if (!isEnabled) { return; } if (Utils.isMoving()) { @@ -246,37 +248,44 @@ public class Scaffold extends Module { e.setRotations(mc.thePlayer.rotationYaw - hardcodedYaw(), 81.150F); break; case 2: - /*float yawAngle; float moveAngle = (float) getMovementAngle(); float relativeYaw = mc.thePlayer.rotationYaw + moveAngle; float normalizedYaw = (relativeYaw % 360 + 360) % 360; float quad = normalizedYaw % 90; - float firstStraight = 130.50f; - float secondStraight = 131.50f; + float side = MathHelper.wrapAngleTo180_float(getMotionYaw() - yaw); + float offset = yawAngle;//(!Utils.scaffoldDiagonal(false)) ? 125.500F : 143.500F; + float minOffset = (!Utils.scaffoldDiagonal(false)) ? 20 : 8; + float yawBackwards = MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw(); + float blockYawOffset = MathHelper.wrapAngleTo180_float(yawBackwards - blockYaw); + + float minPitch = 78.650f; + + float firstStraight = 126.50f; + float secondStraight = 128.50f; float thirdStraight = 132.50f; - float firstDiag = 132.50f; + float firstDiag = 133.50f; float secondDiag = 134.50f; - float thirdDiag = 137.50f; - float fourthDiag = 140.50f; + float thirdDiag = 135.50f; + float fourthDiag = 138f; //first straight if (quad < 5 || quad >= 85) { yawAngle = firstStraight; - //second straight + //second straight } else if (quad >= 80 || quad < 10) { yawAngle = secondStraight; - //third straight + //third straight } else if (quad >= 65 || quad < 25) { yawAngle = thirdStraight; - //first diag + //first diag } else if (quad >= 55 || quad < 35) { yawAngle = firstDiag; - //second diag + //second diag } else if (quad >= 15 && quad < 45) { yawAngle = secondDiag; if (quad >= 38) { @@ -294,13 +303,6 @@ public class Scaffold extends Module { } } } - float side = MathHelper.wrapAngleTo180_float(getMotionYaw() - yaw); - float offset = yawAngle;//(!Utils.scaffoldDiagonal(false)) ? 125.500F : 143.500F; - float minOffset = 0;//(!Utils.scaffoldDiagonal(false)) ? 5 : 0; - float yawBackwards = MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw(); - float blockYawOffset = MathHelper.wrapAngleTo180_float(yawBackwards - blockYaw); - - float minPitch = 78.650F; if (firstStroke > 0 && (System.currentTimeMillis() - firstStroke) > strokeDelay) { firstStroke = 0; @@ -311,14 +313,13 @@ public class Scaffold extends Module { pitch = blockRotations[1]; yawOffset = blockYawOffset; if (pitch < minPitch && Utils.getHorizontalSpeed() < 0.6) { - pitch = minPitch; + //pitch = minPitch; } if (firstStroke == 0) { - strokeDelay = 350; + strokeDelay = 275; } } else { - firstStroke = Utils.time(); - yawOffset = 0; + yawOffset = minOffset; pitch = minPitch; strokeDelay = 575; } @@ -337,15 +338,35 @@ public class Scaffold extends Module { yaw = applyGcd( lastYaw + MathHelper.wrapAngleTo180_float(newYaw - lastYaw) ); + + if (firstStroke == 0 && Utils.scaffoldDiagonal(false)) { + if (quad >= 0 && quad < 45) { + if (side >= 0) { + set2 = false; + } else { + set2 = true; + } + } else { + if (side >= 0) { + set2 = true; + } else { + set2 = false; + } + } + firstStroke = Utils.time(); + } + double minSwitch = (!Utils.scaffoldDiagonal(false)) ? 0 : 15; if (side >= 0) { - if (yawOffset <= -minSwitch && firstStroke == 0) { - set2 = false; - firstStroke = Utils.time(); - } else if (yawOffset >= 0 && firstStroke == 0) { - if (yawOffset >= minSwitch) { - set2 = true; + if (!Utils.scaffoldDiagonal(false) && (quad >= 85 || quad <= 5)) { + if (yawOffset <= -minSwitch && firstStroke == 0) { + set2 = false; firstStroke = Utils.time(); + } else if (yawOffset >= 0 && firstStroke == 0) { + if (yawOffset >= minSwitch) { + set2 = true; + firstStroke = Utils.time(); + } } } if (set2) { @@ -355,13 +376,15 @@ public class Scaffold extends Module { break; } } else if (side <= -0) { - if (yawOffset >= minSwitch && firstStroke == 0) { - set2 = false; - firstStroke = Utils.time(); - } else if (yawOffset <= 0 && firstStroke == 0) { - if (yawOffset <= -minSwitch) { - set2 = true; + if (!Utils.scaffoldDiagonal(false) && (quad >= 85 || quad <= 5)) { + if (yawOffset >= minSwitch && firstStroke == 0) { + set2 = false; firstStroke = Utils.time(); + } else if (yawOffset <= 0 && firstStroke == 0) { + if (yawOffset <= -minSwitch) { + set2 = true; + firstStroke = Utils.time(); + } } } if (set2) { @@ -380,9 +403,9 @@ public class Scaffold extends Module { if (yawOffset >= minOffset) yawOffset = minOffset; } e.setRotations(yaw - yawOffset, pitch); - set2 = false;*/ + set2 = false; - float minPitch = 77.9F; + /*float minPitch = 79.450F; float yawBackwards = MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw(); float blockYawOffset = MathHelper.wrapAngleTo180_float(yawBackwards - blockYaw); @@ -393,13 +416,13 @@ public class Scaffold extends Module { float normalizedYaw = (relativeYaw % 360 + 360) % 360; float quad = normalizedYaw % 90; - float firstStraight = 55.5F; + float firstStraight = 54.5F; float secondStraight = 52.5F; - float thirdStraight = 49.5F; + float thirdStraight = 50.5F; float firstDiag = 47.5F; - float secondDiag = 46.5F; - float thirdDiag = 45.F; - float fourthDiag = 43F; + float secondDiag = 45.5F; + float thirdDiag = 44.5F; + float fourthDiag = 42.5F; if (blockRotations != null) { blockYaw = blockRotations[0]; @@ -416,12 +439,12 @@ public class Scaffold extends Module { pitch = minPitch; } - if (firstStroke > 0 && (Utils.time() - firstStroke) > 330) { + if (firstStroke > 0 && (Utils.time() - firstStroke) > 275) { firstStroke = 0; //Utils.print("Reset time"); } //Utils.print("" + firstStroke + " " + ModuleUtils.groundTicks + " " + ModuleManager.tower.speed); - if (firstStroke == 0 || mc.thePlayer.onGround && ModuleUtils.groundTicks < 2 || ModuleManager.tower.speed) { + if (firstStroke == 0 || mc.thePlayer.onGround && ModuleUtils.groundTicks < 2 || ModuleManager.tower.canTower() && mc.thePlayer.ticksExisted % 6 == 0) { //first straight if (quad < 5 || quad >= 85) { if (blockRotations != null) { @@ -470,7 +493,7 @@ public class Scaffold extends Module { } } } - if (yawOffset != lastYawOffset || mc.thePlayer.onGround || ModuleManager.tower.speed) { + if (yawOffset != lastYawOffset || mc.thePlayer.onGround || ModuleManager.tower.canTower() && mc.thePlayer.ticksExisted % 6 == 0) { firstStroke = Utils.time(); //Utils.print("Delay"); } @@ -479,7 +502,7 @@ public class Scaffold extends Module { } yaw = (mc.thePlayer.rotationYaw - hardcodedYaw()); - if (firstStroke == 0 || mc.thePlayer.onGround || ModuleManager.tower.speed) { + if (firstStroke == 0 || mc.thePlayer.onGround || ModuleManager.tower.canTower() && mc.thePlayer.ticksExisted % 6 == 0) { yaw = (mc.thePlayer.rotationYaw - hardcodedYaw()); } else { @@ -494,7 +517,7 @@ public class Scaffold extends Module { yaw = (lastEdge2 + yawDifference * smoothingFactor); lastEdge2 = yaw;*/ //yaw += (float) Utils.randomizeDouble(-0.00001, 0.0012); - e.setRotations(yaw, pitch); + //e.setRotations(yaw, pitch); break; case 3: if (blockRotations != null) { @@ -642,9 +665,9 @@ public class Scaffold extends Module { targetBlock = null; blockInfo = null; blockRotations = null; - startYPos = -1; fastScaffoldKeepY = firstKeepYPlace = rotateForward = rotatingForward = lowhop = floatStarted = floatJumped = floatWasEnabled = towerEdge = false; rotationDelay = keepYTicks = scaffoldTicks = 0; + firstStroke = 0; startYPos = -1; lookVec = null; } @@ -855,7 +878,7 @@ public class Scaffold extends Module { for (EnumFacing enumFacing : EnumFacing.values()) { if (enumFacing != EnumFacing.UP && placeConditions(enumFacing, yOffset, xOffset)) { BlockPos offsetPos = new BlockPos(x, y - 1, z).offset(enumFacing); - if (!BlockUtils.replaceable(offsetPos)) { + if (!BlockUtils.replaceable(offsetPos) && !BlockUtils.isInteractable(BlockUtils.getBlock(offsetPos))) { possibleBlocks.add(new PlaceData(offsetPos, enumFacing.getOpposite())); } } @@ -867,7 +890,7 @@ public class Scaffold extends Module { for (EnumFacing enumFacing3 : EnumFacing.values()) { if (enumFacing3 != EnumFacing.UP && placeConditions(enumFacing3, yOffset, xOffset)) { BlockPos offsetPos3 = offsetPos2.offset(enumFacing3); - if (!BlockUtils.replaceable(offsetPos3)) { + if (!BlockUtils.replaceable(offsetPos3) && !BlockUtils.isInteractable(BlockUtils.getBlock(offsetPos3))) { possibleBlocks.add(new PlaceData(offsetPos3, enumFacing3.getOpposite())); } } @@ -883,7 +906,7 @@ public class Scaffold extends Module { for (EnumFacing enumFacing6 : EnumFacing.values()) { if (enumFacing6 != EnumFacing.UP && placeConditions(enumFacing6, yOffset, xOffset)) { BlockPos offsetPos6 = offsetPos5.offset(enumFacing6); - if (!BlockUtils.replaceable(offsetPos6)) { + if (!BlockUtils.replaceable(offsetPos6) && !BlockUtils.isInteractable(BlockUtils.getBlock(offsetPos6))) { possibleBlocks.add(new PlaceData(offsetPos6, enumFacing6.getOpposite())); } } @@ -898,7 +921,7 @@ public class Scaffold extends Module { for (EnumFacing enumFacing8 : EnumFacing.values()) { if (enumFacing8 != EnumFacing.UP && placeConditions(enumFacing8, yOffset, xOffset)) { BlockPos offsetPos8 = offsetPos7.offset(enumFacing8); - if (!BlockUtils.replaceable(offsetPos8)) { + if (!BlockUtils.replaceable(offsetPos8) && !BlockUtils.isInteractable(BlockUtils.getBlock(offsetPos8))) { possibleBlocks.add(new PlaceData(offsetPos8, enumFacing8.getOpposite())); } } diff --git a/src/main/java/keystrokesmod/module/impl/player/Tower.java b/src/main/java/keystrokesmod/module/impl/player/Tower.java index c4881df..2f57c4d 100644 --- a/src/main/java/keystrokesmod/module/impl/player/Tower.java +++ b/src/main/java/keystrokesmod/module/impl/player/Tower.java @@ -59,7 +59,7 @@ public class Tower extends Module { @SubscribeEvent public void onPreMotion(PreMotionEvent e) { - if (canTower()) { + if (canTower() && Utils.keysDown()) { switch ((int) towerMove.getInput()) { case 1: @@ -71,8 +71,10 @@ public class Tower extends Module { break; case 4: - if (ModuleUtils.inAirTicks == 6) { - e.setPosY(e.getPosY() + 0.000383527); + if (tower) { + if (ModuleUtils.inAirTicks == 6) { + e.setPosY(e.getPosY() + 0.000383527); + } } break; } @@ -164,24 +166,28 @@ public class Tower extends Module { case 4: speed = false; int simpleY = (int) Math.round((mc.thePlayer.posY % 1.0D) * 100.0D); - switch(simpleY) { - case 0: - mc.thePlayer.motionY = 0.42f; - if (ModuleUtils.inAirTicks == 6) { - mc.thePlayer.motionY = -0.078400001525879; - } - Utils.setSpeed(getTower25Levels(getSpeedLevel())); - speed = true; - break; - case 42: - mc.thePlayer.motionY = 0.33f; - Utils.setSpeed(getTower25Levels(getSpeedLevel())); - speed = true; - break; - case 75: - mc.thePlayer.motionY = 1 - mc.thePlayer.posY % 1; - speed = false; - break; + if (mc.thePlayer.posY % 1 == 0) { + tower = true; + } + if (tower) { + switch (simpleY) { + case 0: + mc.thePlayer.motionY = 0.42f; + if (ModuleUtils.inAirTicks == 6) { + mc.thePlayer.motionY = -0.078400001525879; + } + Utils.setSpeed(getTowerSpeed(getSpeedLevel())); + speed = true; + break; + case 42: + mc.thePlayer.motionY = 0.33f; + Utils.setSpeed(getTowerSpeed(getSpeedLevel())); + speed = true; + break; + case 75: + mc.thePlayer.motionY = 1 - mc.thePlayer.posY % 1f; + break; + } } break; } @@ -218,7 +224,7 @@ public class Tower extends Module { if (!aligning) { blockX = (int) mc.thePlayer.posX; - firstX = mc.thePlayer.posX; + firstX = mc.thePlayer.posX - 10; firstY = mc.thePlayer.posY; firstZ = mc.thePlayer.posZ; } @@ -379,13 +385,4 @@ public class Tower extends Module { return towerGroundSpeedLevels[0]; } - private final double[] tower25Levels = {0.3, 0.34, 0.38, 0.42, 0.42}; - - private double getTower25Levels(int speedLevel) { - if (speedLevel >= 0) { - return tower25Levels[speedLevel]; - } - return tower25Levels[0]; - } - } \ No newline at end of file diff --git a/src/main/java/keystrokesmod/utility/ModuleUtils.java b/src/main/java/keystrokesmod/utility/ModuleUtils.java index f521493..02bb22f 100644 --- a/src/main/java/keystrokesmod/utility/ModuleUtils.java +++ b/src/main/java/keystrokesmod/utility/ModuleUtils.java @@ -6,12 +6,14 @@ import keystrokesmod.event.PreUpdateEvent; import keystrokesmod.event.SendPacketEvent; import keystrokesmod.module.impl.movement.LongJump; import keystrokesmod.module.impl.render.HUD; +import keystrokesmod.utility.command.CommandManager; import net.minecraft.client.Minecraft; import keystrokesmod.module.ModuleManager; import net.minecraft.entity.EntityLivingBase; import net.minecraft.network.play.client.*; import net.minecraft.network.play.server.S27PacketExplosion; import net.minecraft.util.BlockPos; +import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.client.event.RenderWorldLastEvent; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -194,7 +196,61 @@ public class ModuleUtils { } } + if (CommandManager.status.cooldown != 0) { + if (mc.thePlayer.ticksExisted % 20 == 0) { + CommandManager.status.cooldown--; + } + } + } + @SubscribeEvent + public void onChat(ClientChatReceivedEvent e) { + if (!Utils.nullCheck()) { + return; + } + String stripped = Utils.stripColor(e.message.getUnformattedText()); + + //online + if (stripped.contains("You tipped ") && stripped.contains(" in") && stripped.contains("!") && CommandManager.status.start) { + CommandManager.status.start = false; + Utils.print("§a " + CommandManager.status.ign + " is online"); + e.setCanceled(true); + } + if ((stripped.contains("You've already tipped someone in the past hour in") && stripped.contains("! Wait a bit and try again!") || stripped.contains("You've already tipped that person today in ")) && CommandManager.status.start) { + CommandManager.status.start = false; + Utils.print("§a " + CommandManager.status.ign + " is online"); + //client.print(util.colorSymbol + "7^ if player recently left the server this may be innacurate (rate limited)"); + e.setCanceled(true); + } + //offline + if (stripped.contains("That player is not online, try another user!") && CommandManager.status.start) { + CommandManager.status.start = false; + Utils.print("§7 " + CommandManager.status.ign + " is offline"); + e.setCanceled(true); + } + //invalid name + if (stripped.contains("Can't find a player by the name of '") && CommandManager.status.start) { + CommandManager.status.cooldown = 0; + CommandManager.status.start = false; + CommandManager.status.currentMode = CommandManager.status.lastMode; + Utils.print("§7 " + CommandManager.status.ign + " doesn't exist"); + e.setCanceled(true); + } + if (stripped.contains("That's not a valid username!") && CommandManager.status.start) { + CommandManager.status.cooldown = 0; + CommandManager.status.start = false; + CommandManager.status.currentMode = CommandManager.status.lastMode; + Utils.print("§binvalid username"); + e.setCanceled(true); + } + //checking urself + if (stripped.contains("You cannot give yourself tips!") && CommandManager.status.start) { + CommandManager.status.cooldown = 0; + CommandManager.status.start = false; + CommandManager.status.currentMode = CommandManager.status.lastMode; + Utils.print("§a " + CommandManager.status.ign + " is online"); + e.setCanceled(true); + } } @SubscribeEvent diff --git a/src/main/java/keystrokesmod/utility/command/CommandManager.java b/src/main/java/keystrokesmod/utility/command/CommandManager.java index 664aec1..177e392 100644 --- a/src/main/java/keystrokesmod/utility/command/CommandManager.java +++ b/src/main/java/keystrokesmod/utility/command/CommandManager.java @@ -1,5 +1,6 @@ package keystrokesmod.utility.command; +import keystrokesmod.module.impl.combat.Velocity; import keystrokesmod.utility.Utils; import keystrokesmod.utility.command.impl.*; @@ -11,6 +12,8 @@ public class CommandManager { private List commands = new ArrayList<>(); public String[] latestAutoComplete = new String[]{}; + public static Status status; + public CommandManager() { registerCommand(new Help()); registerCommand(new Ping()); @@ -22,6 +25,7 @@ public class CommandManager { registerCommand(new Enemy()); registerCommand(new Profiles()); registerCommand(new Q()); + registerCommand(new Status()); } public void executeCommand(String input) { diff --git a/src/main/java/keystrokesmod/utility/command/impl/Help.java b/src/main/java/keystrokesmod/utility/command/impl/Help.java index 28897a1..26cbb65 100644 --- a/src/main/java/keystrokesmod/utility/command/impl/Help.java +++ b/src/main/java/keystrokesmod/utility/command/impl/Help.java @@ -14,6 +14,7 @@ public class Help extends Command { chat(" &b.ping &7Estimate your ping."); chat(" &b.friend/enemy [name/clear] &7Adds as enemy/friend."); chat(" &b.q [mode] &7Queues a gamemode."); + chat(" &b.status [player] &7Checks if a player is online or not. (Bypasses filters)"); chatWithPrefix("&7Chat commands - &dModules"); chat(" &b.cname [name] &7Set name hider name."); chat(" &b.binds (key) &7List module binds."); diff --git a/src/main/java/keystrokesmod/utility/command/impl/Status.java b/src/main/java/keystrokesmod/utility/command/impl/Status.java new file mode 100644 index 0000000..0e3076e --- /dev/null +++ b/src/main/java/keystrokesmod/utility/command/impl/Status.java @@ -0,0 +1,89 @@ +package keystrokesmod.utility.command.impl; + +import keystrokesmod.Raven; +import keystrokesmod.event.PreUpdateEvent; +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.utility.ModuleUtils; +import keystrokesmod.utility.PacketUtils; +import keystrokesmod.utility.Utils; +import keystrokesmod.utility.command.Command; +import keystrokesmod.utility.profile.Profile; +import net.minecraft.network.play.client.C01PacketChatMessage; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.input.Keyboard; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class Status extends Command { + public Status() { + super("status"); + } + + public static String ign, modeString; + + public static int currentMode, lastMode, cooldown, displayNumber; + public static boolean start; + + @Override + public void onExecute(String[] args) { + if (args.length == 2) { + ign = args[1]; + + if (cooldown != 0) { + Utils.print("§dcurrently on cooldown for " + cooldown + "s"); + } + else { + ++currentMode; + getModeString(); + String msg = "/tip " + ign + modeString; + mc.thePlayer.sendChatMessage(msg); + lastMode = currentMode; + displayNumber = lastMode + 1; + start = true; + + cooldown = 7; + } + } + } + + private void getModeString() { + if (currentMode > 9) currentMode = 0; + if (currentMode == 0) { + modeString = " skywars"; + } + else if (currentMode == 1) { + modeString = " tnt"; + } + else if (currentMode == 2) { + modeString = " classic"; + } + else if (currentMode == 3) { + modeString = " blitz"; + } + else if (currentMode == 4) { + modeString = " mega"; + } + else if (currentMode == 5) { + modeString = " uhc"; + } + else if (currentMode == 6) { + modeString = " arcade"; + } + else if (currentMode == 7) { + modeString = " warlords"; + } + else if (currentMode == 8) { + modeString = " smash"; + } + else if (currentMode == 9) { + modeString = " cops"; + } + } + + +}