Skip to content

Commit b589a86

Browse files
committed
Updated AimAssist, AutoSign, SpearAssist, PearlESP
1 parent d88f1ca commit b589a86

7 files changed

Lines changed: 176 additions & 13 deletions

File tree

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ Reports number of waypoints changed.
536536
- You can optionally allow aim assist to work whilst holding right click or stay on while spear is being used.
537537
- Auto Attack, your jab attack will continue to auto hit once the cooldown has expired so long as you're hitting an entity.
538538
- Auto alignment flys you up or down to match the level of your target when AimAssist is enabled
539-
- Extended AimAssist range (Max 100 Blocks) while using SpearAssist
539+
- Extended AimAssist range (Max 128 Blocks) while using SpearAssist
540540
- Added AimAssist lock-on whilst using spear
541541
- Spear charging no longer interferes with interactive blocks
542542

@@ -1215,6 +1215,10 @@ Examples:
12151215

12161216
### AimAssist Improved
12171217
- Added lock-on targetting
1218+
- Added right-click lock-on targetting with added vertical matching when in flight
1219+
- Optional auto-attack in the same method as MultiAura
1220+
- Optional range override
1221+
- Allowed new maximum 128 block range
12181222

12191223
### HealthTags Improved
12201224
- Now optionally uses the same hearts as the new MobHealth hack

src/main/java/net/wurstclient/hacks/AimAssistHack.java

Lines changed: 143 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,16 @@
1111
import java.util.function.Function;
1212
import java.util.stream.Stream;
1313
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
14+
import net.minecraft.world.InteractionHand;
1415
import net.minecraft.world.entity.Entity;
1516
import net.minecraft.world.entity.LivingEntity;
17+
import net.minecraft.world.phys.EntityHitResult;
1618
import net.minecraft.world.phys.Vec3;
1719
import net.wurstclient.Category;
1820
import net.wurstclient.events.MouseUpdateListener;
1921
import net.wurstclient.events.UpdateListener;
2022
import net.wurstclient.hack.Hack;
23+
import net.wurstclient.settings.AttackSpeedSliderSetting;
2124
import net.wurstclient.settings.AimAtSetting;
2225
import net.wurstclient.settings.CheckboxSetting;
2326
import net.wurstclient.settings.SliderSetting;
@@ -33,7 +36,7 @@ public final class AimAssistHack extends Hack
3336
implements UpdateListener, MouseUpdateListener
3437
{
3538
private final SliderSetting range =
36-
new SliderSetting("Range", 4.5, 1, 6, 0.05, ValueDisplay.DECIMAL);
39+
new SliderSetting("Range", 4.5, 1, 128, 0.05, ValueDisplay.DECIMAL);
3740

3841
private final SliderSetting rotationSpeed =
3942
new SliderSetting("Rotation Speed", 600, 10, 7200, 10,
@@ -62,6 +65,28 @@ public final class AimAssistHack extends Hack
6265
new CheckboxSetting("Aim while blocking",
6366
"description.wurst.setting.aimassist.aim_while_blocking", false);
6467

68+
private final CheckboxSetting rightClickLockOn = new CheckboxSetting(
69+
"Right-click lock-on",
70+
"While holding right-click, maintain full horizontal + vertical lock-on to the current target.",
71+
false);
72+
73+
private final CheckboxSetting rightClickLockOnRangeOverride =
74+
new CheckboxSetting("Right-click range override",
75+
"While holding right-click lock-on, use a separate range instead of AimAssist's normal range.",
76+
false);
77+
78+
private final SliderSetting rightClickLockOnRange = new SliderSetting(
79+
"Right-click range", "Range used while right-click lock-on is active.",
80+
12, 1, 128, 0.05, ValueDisplay.DECIMAL);
81+
82+
private final CheckboxSetting rightClickAutoAttack = new CheckboxSetting(
83+
"Right-click auto-attack",
84+
"Automatically attack while right-click lock-on is active. Uses crosshair target first, then AimAssist target.",
85+
false);
86+
87+
private final AttackSpeedSliderSetting rightClickAttackSpeed =
88+
new AttackSpeedSliderSetting();
89+
6590
private final EntityFilterList entityFilters =
6691
new EntityFilterList(FilterPlayersSetting.genericCombat(false),
6792
FilterSleepingSetting.genericCombat(false),
@@ -113,6 +138,11 @@ public AimAssistHack()
113138
addSetting(ignoreMouseInput);
114139
addSetting(checkLOS);
115140
addSetting(aimWhileBlocking);
141+
addSetting(rightClickLockOn);
142+
addSetting(rightClickLockOnRangeOverride);
143+
addSetting(rightClickLockOnRange);
144+
addSetting(rightClickAutoAttack);
145+
addSetting(rightClickAttackSpeed);
116146

117147
entityFilters.forEach(this::addSetting);
118148
}
@@ -131,6 +161,7 @@ protected void onEnable()
131161
WURST.getHax().protectHack.setEnabled(false);
132162
WURST.getHax().tpAuraHack.setEnabled(false);
133163

164+
rightClickAttackSpeed.resetTimer();
134165
EVENTS.add(UpdateListener.class, this);
135166
EVENTS.add(MouseUpdateListener.class, this);
136167
}
@@ -152,13 +183,15 @@ protected void onDisable()
152183
public void onUpdate()
153184
{
154185
target = null;
186+
rightClickAttackSpeed.updateTimer();
155187

156188
// don't aim when a container/inventory screen is open
157189
if(MC.screen instanceof AbstractContainerScreen)
158190
return;
159191

192+
boolean useHeld = isUseKeyHeld();
160193
boolean blockingAllowed =
161-
aimWhileBlocking.isChecked() || temporaryAllowBlocking;
194+
aimWhileBlocking.isChecked() || temporaryAllowBlocking || useHeld;
162195
if(!blockingAllowed && MC.player.isUsingItem())
163196
return;
164197

@@ -181,6 +214,9 @@ public void onUpdate()
181214
return;
182215
}
183216

217+
updateRightClickVerticalAlignment();
218+
updateRightClickAutoAttack();
219+
184220
WURST.getHax().autoSwordHack.setSlot(target);
185221

186222
// get needed rotation
@@ -301,15 +337,33 @@ public Entity getCurrentTarget()
301337

302338
private double getRange()
303339
{
340+
if(isRightClickLockOnActive()
341+
&& rightClickLockOnRangeOverride.isChecked())
342+
return rightClickLockOnRange.getValue();
343+
304344
return rangeOverride != null ? rangeOverride : range.getValue();
305345
}
306346

307347
private boolean isLockOnEnabled()
308348
{
349+
if(isRightClickLockOnActive())
350+
return true;
351+
309352
return lockOnOverride != null ? lockOnOverride.booleanValue()
310353
: lockOn.isChecked();
311354
}
312355

356+
private boolean isRightClickLockOnActive()
357+
{
358+
return rightClickLockOn.isChecked() && isUseKeyHeld();
359+
}
360+
361+
private boolean isUseKeyHeld()
362+
{
363+
return MC.options != null && MC.options.keyUse != null
364+
&& MC.options.keyUse.isDown();
365+
}
366+
313367
private double getRangeSq()
314368
{
315369
double value = getRange();
@@ -332,4 +386,91 @@ private boolean isValidForcedTarget(Entity entity)
332386

333387
return true;
334388
}
389+
390+
private void updateRightClickAutoAttack()
391+
{
392+
if(!rightClickAutoAttack.isChecked() || !isRightClickLockOnActive()
393+
|| target == null || MC.player == null || MC.gameMode == null)
394+
return;
395+
396+
if(!rightClickAttackSpeed.isTimeToAttack())
397+
return;
398+
399+
Entity attackTarget = resolveRightClickAttackTarget();
400+
if(attackTarget == null)
401+
return;
402+
403+
WURST.getHax().autoSwordHack.setSlot(attackTarget);
404+
MC.gameMode.attack(MC.player, attackTarget);
405+
MC.player.swing(InteractionHand.MAIN_HAND);
406+
rightClickAttackSpeed.resetTimer();
407+
}
408+
409+
private Entity resolveRightClickAttackTarget()
410+
{
411+
if(MC.hitResult instanceof EntityHitResult hit)
412+
{
413+
Entity hitEntity = hit.getEntity();
414+
if(hitEntity != null && isValidForcedTarget(hitEntity)
415+
&& MC.player.distanceToSqr(hitEntity) <= getRangeSq())
416+
return hitEntity;
417+
}
418+
419+
return target;
420+
}
421+
422+
private void updateRightClickVerticalAlignment()
423+
{
424+
if(WURST.getHax().flightHack.isEnabled())
425+
return;
426+
427+
Double step = getRightClickVerticalAlignmentStepInternal(null);
428+
if(step == null || MC.player == null)
429+
return;
430+
431+
Vec3 motion = MC.player.getDeltaMovement();
432+
MC.player.setDeltaMovement(motion.x, motion.y + step, motion.z);
433+
}
434+
435+
public Double getRightClickVerticalAlignmentStepForFlight()
436+
{
437+
return getRightClickVerticalAlignmentStepInternal(
438+
WURST.getHax().flightHack.verticalSpeed.getValue());
439+
}
440+
441+
private Double getRightClickVerticalAlignmentStepInternal(
442+
Double maxStepOverride)
443+
{
444+
if(MC.player == null || target == null || !isRightClickLockOnActive())
445+
return null;
446+
447+
boolean flying = MC.player.getAbilities().flying
448+
|| WURST.getHax().flightHack.isEnabled();
449+
if(!flying)
450+
return null;
451+
452+
if(target.onGround() && !MC.options.keyShift.isDown())
453+
{
454+
double feetDelta = target.getY() - MC.player.getY();
455+
if(feetDelta < 0)
456+
return null;
457+
}
458+
459+
double maxStep = maxStepOverride != null ? maxStepOverride
460+
: MC.player.getAbilities().getFlyingSpeed();
461+
if(maxStep <= 0)
462+
return null;
463+
464+
double targetY = target.getY();
465+
double playerY = MC.player.getY();
466+
double delta = targetY - playerY;
467+
468+
if(MC.player.onGround() && delta < 0 && !MC.options.keyShift.isDown())
469+
return null;
470+
471+
if(Math.abs(delta) < 0.02)
472+
return null;
473+
474+
return Math.max(-maxStep, Math.min(maxStep, delta));
475+
}
335476
}

src/main/java/net/wurstclient/hacks/AutoSignHack.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ private List<BlockPos> findNearbySigns()
450450
if(!(state.getBlock() instanceof SignBlock))
451451
continue;
452452

453-
boolean visible = BlockUtils.hasLineOfSight(center);
453+
boolean visible = hasLineOfSightToSign(candidate, center);
454454
if(!visible && canUseHandNoClip())
455455
visible = true;
456456
if(!visible)
@@ -464,6 +464,15 @@ private List<BlockPos> findNearbySigns()
464464
return results;
465465
}
466466

467+
private boolean hasLineOfSightToSign(BlockPos signPos, Vec3 signCenter)
468+
{
469+
BlockHitResult hit =
470+
BlockUtils.raycast(MC.player.getEyePosition(1.0F), signCenter);
471+
472+
return hit.getType() == net.minecraft.world.phys.HitResult.Type.MISS
473+
|| signPos.equals(hit.getBlockPos());
474+
}
475+
467476
private boolean linesMatch(String[] current, String[] desired)
468477
{
469478
if(current == null || desired == null)

src/main/java/net/wurstclient/hacks/FlightHack.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,9 @@ public void onUpdate()
245245

246246
Double alignStep =
247247
WURST.getHax().spearAssistHack.getAutoAlignmentStepForFlight();
248+
if(alignStep == null)
249+
alignStep = WURST.getHax().aimAssistHack
250+
.getRightClickVerticalAlignmentStepForFlight();
248251
if(alignStep != null)
249252
{
250253
Vec3 current = player.getDeltaMovement();

src/main/java/net/wurstclient/hacks/SpearAssistHack.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public void update()
116116

117117
private final SliderSetting aimAssistRangeOverride = new SliderSetting(
118118
"AimAssist range", "Overrides AimAssist range while holding a spear.",
119-
6, 1, 100, 0.05, ValueDisplay.DECIMAL.withSuffix(" blocks"));
119+
6, 1, 128, 0.05, ValueDisplay.DECIMAL.withSuffix(" blocks"));
120120

121121
private final CheckboxSetting aimAssistLockOnOverride = new CheckboxSetting(
122122
"AimAssist lock-on",

src/main/java/net/wurstclient/mixin/DisconnectedScreenMixin.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,14 @@ private void pressRandomAltReconnect()
237237
reconnectRandomAltButton.active = true;
238238
reconnectRandomAltButton
239239
.setMessage(error == null ? getRandomAltReconnectLabel()
240-
: Component.literal("Random alt login failed"));
240+
: Component.literal("Random Alt Login Failed"));
241241
}
242242

243243
if(error != null)
244244
return;
245245

246246
System.out.println(
247-
"Reconnect random alt selected: " + alt.getDisplayName());
247+
"Reconnect Random Alt Selected: " + alt.getDisplayName());
248248
LastServerRememberer.reconnect(parent);
249249
});
250250
}, "Wurst Random Alt Reconnect");
@@ -256,7 +256,7 @@ private void pressRandomAltReconnect()
256256
private Component getRandomAltReconnectLabel()
257257
{
258258
return Component.literal(randomAltReconnectInProgress
259-
? "Trying random alts..." : "Reconnect as random alt");
259+
? "Trying Random Alts..." : "Reconnect as Random Alt");
260260
}
261261

262262
private void layoutOverlay()

src/main/java/net/wurstclient/util/RenderUtils.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ public static void drawCurvedLine(PoseStack matrices, List<Vec3> points,
542542
RenderType layer = WurstRenderLayers.getLines(depthTest);
543543
VertexConsumer buffer = vcp.getBuffer(layer);
544544

545-
drawCurvedLine(matrices, buffer, points2, color);
545+
drawCurvedLine(matrices, buffer, points2, color, DEFAULT_LINE_WIDTH);
546546

547547
vcp.endBatch(layer);
548548
}
@@ -564,18 +564,24 @@ public static void drawCurvedLine(PoseStack matrices, List<Vec3> points,
564564
RenderType layer = WurstRenderLayers.getLineStrip(depthTest, width);
565565
VertexConsumer buffer = vcp.getBuffer(layer);
566566

567-
drawCurvedLine(matrices, buffer, points2, color);
567+
drawCurvedLine(matrices, buffer, points2, color, appliedWidth);
568568

569569
vcp.endBatch(layer);
570570
}
571571

572572
public static void drawCurvedLine(PoseStack matrices, VertexConsumer buffer,
573573
List<Vec3> points, int color)
574+
{
575+
drawCurvedLine(matrices, buffer, points, color, DEFAULT_LINE_WIDTH);
576+
}
577+
578+
public static void drawCurvedLine(PoseStack matrices, VertexConsumer buffer,
579+
List<Vec3> points, int color, float lineWidth)
574580
{
575581
GlobalEspManager globalEsp = GlobalEspManager.getInstance();
576582
if(globalEsp.shouldTakeOverBufferedLineCalls()
577583
&& globalEsp.submitCurvedLine(matrices, points, color,
578-
globalEsp.getRequestedLineDepth(), DEFAULT_LINE_WIDTH))
584+
globalEsp.getRequestedLineDepth(), lineWidth))
579585
return;
580586

581587
if(points.size() < 2)
@@ -589,9 +595,9 @@ public static void drawCurvedLine(PoseStack matrices, VertexConsumer buffer,
589595
Vector3f current = points.get(i).toVector3f();
590596
Vector3f normal = new Vector3f(current).sub(prev).normalize();
591597
buffer.addVertex(entry, prev).setColor(color)
592-
.setNormal(entry, normal).setLineWidth(2);
598+
.setNormal(entry, normal).setLineWidth(lineWidth);
593599
buffer.addVertex(entry, current).setColor(color)
594-
.setNormal(entry, normal).setLineWidth(2);
600+
.setNormal(entry, normal).setLineWidth(lineWidth);
595601
}
596602
}
597603

0 commit comments

Comments
 (0)