Class Human

java.lang.Object
privbot.behavior.Human

public final class Human extends Object
Thread-safe pacing for player-visible automation (script thread / execute() only).

Typical use: ctx.human.random(...), ctx.human.afterTicks(...), etc. Randomness is ThreadLocalRandom; blocking calls delegate to Time.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    addTicks(int atTick, double chance, int minAdd, int maxAdd)
    With probability chance, adds a random tick offset in [minAdd, maxAdd] to atTick.
    int
    afterTicks(int minTicks, int maxTicks)
    Inclusive random tick count in [minTicks, maxTicks] — add to getTickCount() for a “ready after” gate.
    boolean
    maybeTicks(double chance, int maxTicks)
    With probability chance, sleeps one or more whole game ticks (up to maxTicks).
    long
    random(long minMs, long maxMs)
    Uniform milliseconds in [minMs, maxMs] (inclusive).
    boolean
    roll(double probability)
    Bernoulli trial in [0, 1] — use with random(long, long) and ctx.sleep for optional ms pauses.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Human

      public Human()
  • Method Details

    • random

      public long random(long minMs, long maxMs)
      Uniform milliseconds in [minMs, maxMs] (inclusive).
    • roll

      public boolean roll(double probability)
      Bernoulli trial in [0, 1] — use with random(long, long) and ctx.sleep for optional ms pauses.
    • maybeTicks

      public boolean maybeTicks(double chance, int maxTicks)
      With probability chance, sleeps one or more whole game ticks (up to maxTicks).
    • afterTicks

      public int afterTicks(int minTicks, int maxTicks)
      Inclusive random tick count in [minTicks, maxTicks] — add to getTickCount() for a “ready after” gate.
    • addTicks

      public int addTicks(int atTick, double chance, int minAdd, int maxAdd)
      With probability chance, adds a random tick offset in [minAdd, maxAdd] to atTick.