Skip to content

Commit c2acbab

Browse files
committed
Updated SpearAssist, AimAssist, KeyBinds
1 parent 43b0c31 commit c2acbab

File tree

8 files changed

+296
-27
lines changed

8 files changed

+296
-27
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,10 @@ I did not, nor could I copy their code directly as most are Meteor based mods. S
407407
- Your charge is automatically and constantly resumed (no cooldown) so you can forever hold right click. It will be noisy but even if the spear is pointed down you will still be able to attack.
408408
- You can optionally allow aim assist to work whilst holding right click.
409409
- Auto Attack, your jab attack will continue to auto hit once the cooldown has expired so long as you're hitting an entity.
410+
- Auto alignment flys you up or down to match the level of your target when AimAssist is enabled
411+
- Extended AimAssist range (Max 100 Blocks) while using SpearAssist
412+
- Added AimAssist lock-on whilst using spear
413+
- Spear charging no longer interferes with interactive blocks
410414
- Designed for elytra-free ground PvP/PvE, though may be even more interesting with one.
411415

412416
![Spear](https://i.imgur.com/XVypZML.png)
@@ -620,12 +624,16 @@ Examples:
620624
- Can input sign text directly into ClickUI/Nagivator
621625
- Can now save and manage a list of presets
622626

627+
### AimAssist Improved
628+
- Added lock-on targetting
629+
623630
### HandNoClip Improved
624631
- Now shows a red X over your crosshair to remind you that you cannot place or interact with blocks (in front of you) while the hack is enabled
625632
- X is removed when using any combat weapon as they still function normally
626633

627634
### Keybind Manager Improved
628635
- Can now clear the entire keybinds instead of just resetting.
636+
- Fixed bug where typing your new key bind resulted in adding that character to the command input
629637

630638
### Alt Manager Improved
631639
- Can now multi-select and delete alt accounts

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

Lines changed: 62 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,12 @@ public final class AimAssistHack extends Hack
3636
new SliderSetting("Range", 4.5, 1, 6, 0.05, ValueDisplay.DECIMAL);
3737

3838
private final SliderSetting rotationSpeed =
39-
new SliderSetting("Rotation Speed", 600, 10, 3600, 10,
39+
new SliderSetting("Rotation Speed", 600, 10, 7200, 10,
4040
ValueDisplay.DEGREES.withSuffix("/s"));
4141

42+
private final CheckboxSetting lockOn = new CheckboxSetting("Lock-on",
43+
"Instantly snaps to targets instead of smoothing rotation.", false);
44+
4245
private final SliderSetting fov =
4346
new SliderSetting("FOV", "description.wurst.setting.aimassist.fov", 120,
4447
30, 360, 10, ValueDisplay.DEGREES);
@@ -93,7 +96,9 @@ public final class AimAssistHack extends Hack
9396
private float nextPitch;
9497
private Function<Entity, Vec3> overrideAimPoint;
9598
private Entity externalTarget;
96-
private boolean temporaryAllowBlocking;
99+
private boolean temporaryAllowBlocking;
100+
private Double rangeOverride;
101+
private Boolean lockOnOverride;
97102

98103
public AimAssistHack()
99104
{
@@ -102,6 +107,7 @@ public AimAssistHack()
102107

103108
addSetting(range);
104109
addSetting(rotationSpeed);
110+
addSetting(lockOn);
105111
addSetting(fov);
106112
addSetting(aimAt);
107113
addSetting(ignoreMouseInput);
@@ -137,7 +143,9 @@ protected void onDisable()
137143
target = null;
138144
overrideAimPoint = null;
139145
externalTarget = null;
140-
temporaryAllowBlocking = false;
146+
temporaryAllowBlocking = false;
147+
rangeOverride = null;
148+
lockOnOverride = null;
141149
}
142150

143151
@Override
@@ -179,6 +187,15 @@ public void onUpdate()
179187
Rotation needed = RotationUtils.getNeededRotations(hitVec);
180188

181189
// turn towards center of boundingBox
190+
if(isLockOnEnabled())
191+
{
192+
needed.applyToClientPlayer();
193+
needed.sendPlayerLookPacket();
194+
nextYaw = needed.yaw();
195+
nextPitch = needed.pitch();
196+
return;
197+
}
198+
182199
Rotation next = RotationUtils.slowlyTurnTowards(needed,
183200
rotationSpeed.getValueI() / 20F);
184201
nextYaw = next.yaw();
@@ -190,11 +207,21 @@ public void setTemporarilyAllowBlocking(boolean allow)
190207
temporaryAllowBlocking = allow;
191208
}
192209

210+
public void setRangeOverride(Double override)
211+
{
212+
rangeOverride = override;
213+
}
214+
215+
public void setLockOnOverride(Boolean override)
216+
{
217+
lockOnOverride = override;
218+
}
219+
193220
private void chooseTarget()
194221
{
195222
Stream<Entity> stream = EntityUtils.getAttackableEntities();
196223

197-
double rangeSq = range.getValueSq();
224+
double rangeSq = getRangeSq();
198225
stream = stream.filter(e -> MC.player.distanceToSqr(e) <= rangeSq);
199226

200227
if(fov.getValue() < 360.0)
@@ -215,15 +242,22 @@ public void onMouseUpdate(MouseUpdateEvent event)
215242
if(target == null || MC.player == null)
216243
return;
217244

245+
if(isLockOnEnabled())
246+
{
247+
event.setDeltaX(0);
248+
event.setDeltaY(0);
249+
return;
250+
}
251+
218252
float curYaw = MC.player.getYRot();
219253
float curPitch = MC.player.getXRot();
220254
int diffYaw = (int)(nextYaw - curYaw);
221255
int diffPitch = (int)(nextPitch - curPitch);
222256

223257
// If we are <1 degree off but still missing the hitbox,
224258
// slightly exaggerate the difference to fix that.
225-
if(diffYaw == 0 && diffPitch == 0 && !RotationUtils
226-
.isFacingBox(target.getBoundingBox(), range.getValue()))
259+
if(diffYaw == 0 && diffPitch == 0
260+
&& !RotationUtils.isFacingBox(target.getBoundingBox(), getRange()))
227261
{
228262
diffYaw = nextYaw < curYaw ? -1 : 1;
229263
diffPitch = nextPitch < curPitch ? -1 : 1;
@@ -260,6 +294,28 @@ public void clearExternalTarget()
260294
externalTarget = null;
261295
}
262296

297+
public Entity getCurrentTarget()
298+
{
299+
return target;
300+
}
301+
302+
private double getRange()
303+
{
304+
return rangeOverride != null ? rangeOverride : range.getValue();
305+
}
306+
307+
private boolean isLockOnEnabled()
308+
{
309+
return lockOnOverride != null ? lockOnOverride.booleanValue()
310+
: lockOn.isChecked();
311+
}
312+
313+
private double getRangeSq()
314+
{
315+
double value = getRange();
316+
return value * value;
317+
}
318+
263319
private boolean isValidForcedTarget(Entity entity)
264320
{
265321
if(entity == null)

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ protected void onDisable()
150150
@Override
151151
public void onRightClick(RightClickEvent event)
152152
{
153-
if(status != Status.IDLE)
153+
if(status == Status.NO_TEMPLATE || status == Status.LOADING)
154154
return;
155155

156156
HitResult hitResult = MC.hitResult;
@@ -159,7 +159,14 @@ public void onRightClick(RightClickEvent event)
159159
return;
160160

161161
BlockPos hitResultPos = blockHitResult.getBlockPos();
162-
if(!BlockUtils.canBeClicked(hitResultPos))
162+
boolean clickable = BlockUtils.canBeClicked(hitResultPos);
163+
if(clickable)
164+
event.cancel();
165+
166+
if(status != Status.IDLE)
167+
return;
168+
169+
if(!clickable)
163170
return;
164171

165172
BlockPos startPos =

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,14 @@ public void onUpdate()
108108

109109
if(antiKick.isChecked())
110110
doAntiKick(velocity);
111+
112+
Double alignStep =
113+
WURST.getHax().spearAssistHack.getAutoAlignmentStepForFlight();
114+
if(alignStep != null)
115+
{
116+
Vec3 current = player.getDeltaMovement();
117+
player.setDeltaMovement(current.x, alignStep, current.z);
118+
}
111119
}
112120

113121
@Override

0 commit comments

Comments
 (0)