Skip to content

Commit

Permalink
add grimac mode to fast scaffold
Browse files Browse the repository at this point in the history
add telly start/stop tick option
  • Loading branch information
xia-mc committed Jul 10, 2024
1 parent c5ba5b4 commit 7cf84aa
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions src/main/java/keystrokesmod/module/impl/world/Scaffold.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public class Scaffold extends Module { // from b4 :)
private final SliderSetting aimSpeed;
private final SliderSetting motion;
private final ModeSetting rotation;
private final SliderSetting tellyStartTick;
private final SliderSetting tellyStopTick;
private final SliderSetting strafe;
private final ModeSetting fastScaffold;
private final ButtonSetting cancelSprint;
Expand All @@ -65,7 +67,7 @@ public class Scaffold extends Module { // from b4 :)
protected MovingObjectPosition placeBlock;
private int lastSlot;
private static final String[] rotationModes = new String[]{"None", "Backwards", "Strict", "Precise", "Telly"};
private static final String[] fastScaffoldModes = new String[]{"Disabled", "Sprint", "Edge", "Jump A", "Jump B", "Jump C", "Float", "Side", "Legit", "Auto Jump"};
private static final String[] fastScaffoldModes = new String[]{"Disabled", "Sprint", "Edge", "Jump A", "Jump B", "Jump C", "Float", "Side", "Legit", "Auto Jump", "GrimAC"};
private static final String[] precisionModes = new String[]{"Very low", "Low", "Moderate", "High", "Very high"};
public float placeYaw;
public float placePitch;
Expand All @@ -89,10 +91,12 @@ public Scaffold() {
this.registerSetting(aimSpeed = new SliderSetting("Aim speed", 20, 5, 20, 0.1));
this.registerSetting(motion = new SliderSetting("Motion", 1.0, 0.5, 1.2, 0.01));
this.registerSetting(rotation = new ModeSetting("Rotation", rotationModes, 1));
this.registerSetting(tellyStartTick = new SliderSetting("Telly start", 3, 0, 11, 1, "tick", new ModeOnly(rotation, 4)));
this.registerSetting(tellyStopTick = new SliderSetting("Telly stop", 8, 0, 11, 1, "tick", new ModeOnly(rotation, 4)));
this.registerSetting(strafe = new SliderSetting("Strafe", 0, -45, 45, 5));
this.registerSetting(fastScaffold = new ModeSetting("Fast scaffold", fastScaffoldModes, 0));
this.registerSetting(precision = new ModeSetting("Precision", precisionModes, 4));
this.registerSetting(cancelSprint = new ButtonSetting("Cancel sprint", false, new ModeOnly(fastScaffold, 0, 9).reserve()));
this.registerSetting(cancelSprint = new ButtonSetting("Cancel sprint", false, new ModeOnly(fastScaffold, 0).reserve()));
this.registerSetting(rayCast = new ButtonSetting("Ray cast", false));
this.registerSetting(sneak = new ButtonSetting("Sneak", false));
this.registerSetting(sneakEveryBlocks = new SliderSetting("Sneak every blocks", 1, 1, 10, 1, sneak::isToggled));
Expand All @@ -107,7 +111,7 @@ public Scaffold() {
this.registerSetting(silentSwing = new ButtonSetting("Silent swing", false));
this.registerSetting(tower = new ButtonSetting("Tower", false));
this.registerSetting(fast = new ButtonSetting("Fast", false));
this.registerSetting(sameY = new ButtonSetting("SameY", false, new ModeOnly(fastScaffold, 9).reserve()));
this.registerSetting(sameY = new ButtonSetting("SameY", false));
}

public void onDisable() {
Expand Down Expand Up @@ -160,7 +164,7 @@ public void onRotation(RotationEvent event) {
pitch = placePitch;
break;
case 4:
if (offGroundTicks >= 3 && offGroundTicks < 8 && placeBlock != null && MoveUtil.isMoving()) {
if (offGroundTicks >= tellyStartTick.getInput() && offGroundTicks < tellyStopTick.getInput() && placeBlock != null && MoveUtil.isMoving() && !Utils.jumpDown()) {
telly$noBlockPlace = true;
yaw = event.getYaw();
pitch = event.getPitch();
Expand All @@ -180,9 +184,17 @@ public void onRotation(RotationEvent event) {

@SubscribeEvent
public void onPreMotion(PreMotionEvent event) {
if (cancelSprint.isToggled() || fastScaffold.getInput() == 9) {
if (cancelSprint.isToggled()) {
event.setSprinting(false);
}

if (fastScaffold.getInput() == 10) {
if (Math.abs(MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) -
MathHelper.wrapAngleTo180_float(RotationHandler.getRotationYaw())) > 100) {
((KeyBindingAccessor) mc.gameSettings.keyBindSprint).setPressed(false);
mc.thePlayer.setSprinting(false);
}
}
}

@SubscribeEvent
Expand Down Expand Up @@ -512,6 +524,7 @@ public boolean sprint() {
switch ((int) fastScaffold.getInput()) {
case 1:
case 7:
case 10:
return true;
case 2:
return Utils.onEdge();
Expand Down

0 comments on commit 7cf84aa

Please sign in to comment.