Skip to content

Commit

Permalink
autosoup + aura reach fix
Browse files Browse the repository at this point in the history
  • Loading branch information
K-ov committed Oct 8, 2022
1 parent 1661645 commit 0b2ad35
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 48 deletions.
Binary file modified build/libs/[1.8.9] BetterKeystrokes V-1.2-sources.jar
Binary file not shown.
Binary file modified build/libs/[1.8.9] BetterKeystrokes V-1.2.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import keystrokesmod.client.main.Raven;
import keystrokesmod.client.module.Module;
import keystrokesmod.client.module.modules.combat.LegitAura2;
import keystrokesmod.client.module.modules.combat.Reach;
import keystrokesmod.client.module.modules.render.Fullbright;
import net.minecraft.client.Minecraft;
Expand Down Expand Up @@ -66,8 +67,9 @@ public void getMouseOver(float p_getMouseOver_1_) {


Module reachMod = Raven.moduleManager.getModuleByClazz(Reach.class);
Module aura = Raven.moduleManager.getModuleByClazz(LegitAura2.class);

if (!reachMod.isEnabled()) {
if (!reachMod.isEnabled() && !aura.isEnabled()) {
if (this.mc.playerController.extendedReach()) {
reach = 6.0D;
distanceToVec = 6.0D;
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/keystrokesmod/client/module/ModuleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
import keystrokesmod.client.module.modules.render.Tracers;
import keystrokesmod.client.module.modules.world.AntiBot;
import keystrokesmod.client.module.modules.world.ChatLogger;
import keystrokesmod.client.module.modules.world.Scaffold;
import keystrokesmod.client.utils.Utils;
import net.minecraft.client.gui.FontRenderer;

Expand Down Expand Up @@ -190,7 +189,6 @@ public ModuleManager() {
addModule(new Radar());
addModule(new AutoSoup());
addModule(new CursorTrail());
addModule(new Scaffold());

//addModule(new SpeedTest());
//addModule(new LegitAura());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,39 +1,52 @@
package keystrokesmod.client.module.modules.combat;

import java.util.ArrayList;
import java.util.List;

import com.google.common.eventbus.Subscribe;

import keystrokesmod.client.event.impl.UpdateEvent;
import keystrokesmod.client.module.Module;
import keystrokesmod.client.module.setting.impl.DoubleSliderSetting;
import keystrokesmod.client.module.setting.impl.SliderSetting;
import keystrokesmod.client.module.setting.impl.TickSetting;
import keystrokesmod.client.utils.CoolDown;
import keystrokesmod.client.utils.Utils;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.inventory.ContainerPlayer;
import net.minecraft.item.ItemSoup;
import net.minecraft.item.ItemStack;

public class AutoSoup extends Module {

private final DoubleSliderSetting delay;
private final DoubleSliderSetting coolDown;
private final DoubleSliderSetting delay, coolDown, invCoolDown, invWait;
private final SliderSetting health;
private final CoolDown cd = new CoolDown(1);
private final CoolDown cd = new CoolDown(1), invCd = new CoolDown(1);
private final TickSetting invConsume, autoRefill;
private State state = State.WAITINGTOSWITCH;
private int originalSlot;
private boolean inInv;
private List<Integer> sortedSlots = new ArrayList<>();

public AutoSoup() {
super("AutoSoup", ModuleCategory.combat);
this.registerSetting(delay = new DoubleSliderSetting("delay", 50, 100, 0, 200, 1));
this.registerSetting(delay = new DoubleSliderSetting("delay(ms)", 50, 100, 0, 200, 1));
this.registerSetting(coolDown = new DoubleSliderSetting("cooldown(ms)", 1000, 1200, 0, 5000, 1));
this.registerSetting(invWait = new DoubleSliderSetting("invWait(ms)", 50, 100, 0, 200, 1));
this.registerSetting(invCoolDown = new DoubleSliderSetting("refill delay(ms)", 50, 100, 0, 200, 1));
this.registerSetting(health = new SliderSetting("health", 7, 0, 20, 0.1));

this.registerSetting(invConsume = new TickSetting("consume in inv", false));
this.registerSetting(autoRefill = new TickSetting("auto refil", true));
}

@Subscribe
public void update(UpdateEvent e) {
if(!Utils.Player.isPlayerInGame())
return;
if((mc.thePlayer.getHealth() < health.getInput()) && cd.hasFinished()) {
if(
(invConsume.isToggled() || (mc.currentScreen == null))
&& (mc.thePlayer.getHealth() < health.getInput()) && cd.hasFinished()
) {
switch(state) {
case WAITINGTOSWITCH:
cd.setCooldown((int) Utils.Client.ranModuleVal(delay, Utils.Java.rand())/4);
Expand Down Expand Up @@ -66,6 +79,36 @@ public void update(UpdateEvent e) {
state = state.next();
cd.start();
}
if (autoRefill.isToggled() && Utils.Player.isPlayerInInventory()) {
if (!inInv) {
invCd.setCooldown((long) Utils.Client.ranModuleVal(invWait, Utils.Java.rand()));
invCd.start();
generatePath((ContainerPlayer) mc.thePlayer.openContainer);
inInv = true;
}
if (!sortedSlots.isEmpty())
if (invCd.hasFinished()) {
mc.playerController.windowClick(mc.thePlayer.openContainer.windowId, sortedSlots.get(0), 0, 1, mc.thePlayer);
invCd.setCooldown((long) Utils.Client.ranModuleVal(invCoolDown, Utils.Java.rand()));
invCd.start();
sortedSlots.remove(0);
}
} else
inInv = false;
}

public void generatePath(ContainerPlayer inv) {
ArrayList<Integer> slots = new ArrayList<>();
int slotsNeeded = 0;
for (int i = 0; i <= 8; i++)
slotsNeeded = mc.thePlayer.inventory.getStackInSlot(i) == null ? slotsNeeded + 1 : slotsNeeded ;
for (int i = 0; i < inv.getInventory().size(); i++) {
if(!slots.isEmpty() && (slots.size() >= slotsNeeded)) break;
if ((inv.getInventory().get(i) != null) && (inv.getInventory().get(i).getItem() instanceof ItemSoup) && !((i >= 36) && (i <= 44)))
slots.add(i);
}

this.sortedSlots = slots;
}

public int getSoupSlot() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ public void renderWorldLast(ForgeEvent fe) {
int green = 255 - red;
int rgb = new Color(red, green, 0).getRGB();
Utils.HUD.drawBoxAroundEntity(target, 2, 0, 0, rgb, false);
for(EntityPlayer p : pTargets)
Utils.HUD.drawBoxAroundEntity(p, 2, 0, 0, 0x800000FF, false);
}
for(EntityPlayer p : pTargets)
Utils.HUD.drawBoxAroundEntity(p, 2, 0, 0, 0xFF0000FF, false);
}

@Subscribe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import keystrokesmod.client.event.impl.Render2DEvent;
import keystrokesmod.client.module.Module;
import keystrokesmod.client.module.modules.world.AntiBot;
import keystrokesmod.client.module.setting.impl.RGBSetting;
import keystrokesmod.client.module.setting.impl.SliderSetting;
import keystrokesmod.client.utils.RenderUtils;
import keystrokesmod.client.utils.Utils;
Expand All @@ -12,27 +14,35 @@

public class Radar extends Module {

private int x = 50, y = 50, width = 50, height = 50;
private int x = 200, y = 0, width = 50, height = 50;
private SliderSetting distance;

private RGBSetting boxColor, boarderColor, playerColor, selfColor;

public Radar() {
super("Radar", ModuleCategory.render);
this.registerSetting(distance = new SliderSetting("distance", 25, 5, 100, 1));
this.registerSetting(boxColor = new RGBSetting("box color", 0, 200, 0));
this.registerSetting(boarderColor = new RGBSetting("boarder color", 255, 200, 255));
this.registerSetting(playerColor = new RGBSetting("player color", 0, 0, 255));
this.registerSetting(selfColor = new RGBSetting("self color", 255, 0, 0));

}

@Subscribe
public void render2D(Render2DEvent e) {
if(!Utils.Player.isPlayerInGame() || mc.currentScreen != null)
if(!Utils.Player.isPlayerInGame() || (mc.currentScreen != null))
return;
int centreX = x + width/2, centreY = y + height/2;
RenderUtils.drawBorderedRoundedRect(x, y, x + width, y + height, 3, 3, 0xFFFFFFFF, 0xFF00FF00);
Gui.drawRect(centreX - 1, centreY - 1, centreX + 1, centreY + 1, 0xFFFF00FF);
int centreX = x + (width/2), centreY = y + (height/2);
RenderUtils.drawBorderedRoundedRect(x, y, x + width, y + height, 5, 5, boarderColor.getRGB(), boxColor.getRGB());
for(Entity en : mc.theWorld.playerEntities) {
if((en == mc.thePlayer) || AntiBot.bot(en)) continue;
int radius = (int) mc.thePlayer.getDistanceToEntity(en);
if(radius > distance.getInput()) continue;
int theta = (int) Utils.Player.fovFromEntity(en) -180; //why do i need to put the 180 here huh
int enX = (int) (radius * Math.sin(Math.toRadians(theta))), enY =(int) (radius * Math.cos(Math.toRadians(theta)));
Gui.drawRect(centreX + enX, centreY + enY, centreX + enX + 1, centreY + enY + 1, 0xFFFF0000);
int enX = (int) ((radius * Math.sin(Math.toRadians(theta)))*((width/2)/distance.getInput())),
enY = (int) ((radius * Math.cos(Math.toRadians(theta)))*((height/2)/distance.getInput()));
Gui.drawRect((centreX + enX) -1 , (centreY + enY) - 1 , centreX + enX + 1, centreY + enY + 1, playerColor.getRGB());
}
Gui.drawRect(centreX - 1, centreY - 1, centreX + 1, centreY + 1, selfColor.getRGB());
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ public float drawString(String text, double x, double y, int color, boolean shad
x *= 2;
y = (y - 3) * 2;
GL11.glPushMatrix();
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
GlStateManager.scale(0.5, 0.5, 0.5);
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
Expand Down Expand Up @@ -191,7 +190,6 @@ public float drawString(String text, double x, double y, int color, boolean shad

GL11.glHint(GL11.GL_POLYGON_SMOOTH_HINT, GL11.GL_DONT_CARE);
GlStateManager.resetColor();
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
GL11.glPopMatrix();
GL11.glColor4f(1, 1, 1, 1);
return (float) x / 2f;
Expand All @@ -210,7 +208,6 @@ public float drawSmoothString(String text, double x, double y, int color, boolea
x *= 2;
y = (y - 3) * 2;
GL11.glPushMatrix();
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
GlStateManager.scale(0.5, 0.5, 0.5);
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
Expand Down Expand Up @@ -317,7 +314,6 @@ public float drawSmoothString(String text, double x, double y, int color, boolea
}

GL11.glHint(GL11.GL_POLYGON_SMOOTH_HINT, GL11.GL_DONT_CARE);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
GL11.glPopMatrix();
GL11.glColor4f(1, 1, 1, 1);
return (float) x / 2f;
Expand All @@ -336,7 +332,6 @@ public float drawNoBSString(String text, double x, double y, int color, boolean
x *= 2;
y = (y - 3) * 2;
GL11.glPushMatrix();
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
GlStateManager.scale(0.5, 0.5, 0.5);
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
Expand Down Expand Up @@ -443,7 +438,6 @@ public float drawNoBSString(String text, double x, double y, int color, boolean
}

GL11.glHint(GL11.GL_POLYGON_SMOOTH_HINT, GL11.GL_DONT_CARE);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
GL11.glPopMatrix();
GL11.glColor4f(1, 1, 1, 1);
return (float) x / 2f;
Expand Down

0 comments on commit 0b2ad35

Please sign in to comment.