Class LinearPathMouseMovement

java.lang.Object
net.storm.api.interact.mouse.LinearPathMouseMovement
All Implemented Interfaces:
MouseMovementStrategy

public class LinearPathMouseMovement extends Object implements MouseMovementStrategy
Mouse movement strategy that creates a linear path from current to target position. The path is executed across multiple client ticks (one point per tick by default).
  • Constructor Details

    • LinearPathMouseMovement

      public LinearPathMouseMovement(int steps, int pointsPerTick)
      Creates a linear path mouse movement strategy.
      Parameters:
      steps - Number of intermediate points in the path (higher = smoother)
      pointsPerTick - Number of points to execute per client tick (higher = faster)
    • LinearPathMouseMovement

      public LinearPathMouseMovement()
      Creates a linear path with 10 steps and 1 point per tick.
  • Method Details

    • generatePath

      public MouseMovementStrategy.MousePath generatePath(Point current, Point target)
      Description copied from interface: MouseMovementStrategy
      Generates a mouse movement path from the current position to the target position. The path will be executed one point per client tick (or according to pointsPerTick). This method must NOT dispatch any events or block the thread - it should only generate and return the path.
      Specified by:
      generatePath in interface MouseMovementStrategy
      Parameters:
      current - The current mouse position (can be null if unknown)
      target - The target position to move to
      Returns:
      A MousePath containing the sequence of points to move through