Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

Commit

Permalink
Merge pull request #514 from ulybaka1337/main
Browse files Browse the repository at this point in the history
customisable triggerbot delay
  • Loading branch information
ChamsBypass authored Sep 22, 2024
2 parents cd7f594 + c299f75 commit 646560b
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public final class TriggerBot extends Module {
public final Setting<Boolean> autoJump = new Setting<>("AutoJump", false).addToGroup(smartCrit);
public final Setting<Boolean> ignoreWalls = new Setting<>("IgnoreWalls", false);
public final Setting<Boolean> pauseEating = new Setting<>("PauseWhileEating", false);
public final Setting<Integer> minDelay = new Setting<>("RandomDelayMin", 2, 0, 20);
public final Setting<Integer> maxDelay = new Setting<>("RandomDelayMax", 13, 0, 20);

private int delay;
private final Random random = new Random(); // For random delay
Expand Down Expand Up @@ -52,7 +54,11 @@ public void onAttack(PlayerUpdateEvent e) {
mc.player.swingHand(Hand.MAIN_HAND);

// Set delay for the next hit (10 to 20 ms)
delay = random.nextInt(11) + 2; // (20ms / 50ms per tick = ~0.4 ticks, 10ms / 50ms = ~0.2 ticks)
delay = random.nextInt(minDelay.getValue(), maxDelay.getValue() + 1) ; // (20ms / 50ms per tick = ~0.4 ticks, 10ms / 50ms = ~0.2 ticks)
// ulybaka1337: am i cooking???
// default delay is calculated with
// nextInt(11) + 2
// so max value is 11+2=13 and min is 2
}
}

Expand Down

0 comments on commit 646560b

Please sign in to comment.