Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
    • Best Sellers

    • Latest Products

    • Featured

    • Topics

    • Posts

      • You can customize Bezier steps and overshooting distance.. have fun,   Put this in your onStart method   Mouse.setMouseAlgorithm(new WindMouseCustom());
      • import org.dreambot.api.input.Mouse; import org.dreambot.api.input.event.impl.mouse.MouseButton; import org.dreambot.api.input.mouse.algorithm.MouseAlgorithm; import org.dreambot.api.input.mouse.destination.AbstractMouseDestination; import org.dreambot.api.methods.Calculations; import org.dreambot.api.utilities.Logger; import java.awt.*; import java.util.Random; /** * Modified WindMouse with customized Bézier curves and overshooting for human like movement */ public class WindMouseCustom implements MouseAlgorithm { private Random random = new Random(); @Override public boolean handleMovement(AbstractMouseDestination abstractMouseDestination) { Point suitPos = abstractMouseDestination.getSuitablePoint(); mouseMovement(suitPos); return distance(Mouse.getPosition(), suitPos) < 2; } @Override public boolean handleClick(MouseButton mouseButton) { return Mouse.getDefaultMouseAlgorithm().handleClick(mouseButton); } public static void sleep(int min, int max) { try { Thread.sleep(Calculations.random(min, max)); } catch (InterruptedException e) { Logger.log(e.getMessage()); } } public static void sleep(int ms) { try { Thread.sleep(ms); } catch (InterruptedException e) { Logger.log(e.getMessage()); } } /** * enhanced mouse movement using Bézier curves for smooth, human like pathing * * @param point The destination point */ public void mouseMovement(Point point) { Point curPos = Mouse.getPosition(); boolean shouldOvershoot = random.nextBoolean(); // Random chance to overshoot if (shouldOvershoot) { Point overshootPoint = getOvershootPoint(curPos, point); moveMouseBezier(curPos, overshootPoint); // First move to the overshoot point moveMouseBezier(overshootPoint, point); // Then correct to the target point } else { moveMouseBezier(curPos, point); // Directly move to the target point } } /** * Generate control points for Bezier curve * * @param start The start point * @param end The end point * @return Array of control points */ private Point[] generateControlPoints(Point start, Point end) { Point[] controlPoints = new Point[4]; controlPoints[0] = start; controlPoints[3] = end; int midX = (start.x + end.x) / 2; int midY = (start.y + end.y) / 2; controlPoints[1] = new Point(midX + random.nextInt(100) - 50, midY + random.nextInt(100) - 50); controlPoints[2] = new Point(midX + random.nextInt(100) - 50, midY + random.nextInt(100) - 50); return controlPoints; } /** * Move mouse using a Bezier curve * * @param start The start point * @param end The end point */ private void moveMouseBezier(Point start, Point end) { Point[] controlPoints = generateControlPoints(start, end); int steps = Calculations.random(30, 50); // Increase steps for smoother curves for (int i = 0; i <= steps; i++) { double t = (double) i / (double) steps; int x = (int) (Math.pow(1 - t, 3) * controlPoints[0].x + 3 * Math.pow(1 - t, 2) * t * controlPoints[1].x + 3 * (1 - t) * Math.pow(t, 2) * controlPoints[2].x + Math.pow(t, 3) * controlPoints[3].x); int y = (int) (Math.pow(1 - t, 3) * controlPoints[0].y + 3 * Math.pow(1 - t, 2) * t * controlPoints[1].y + 3 * (1 - t) * Math.pow(t, 2) * controlPoints[2].y + Math.pow(t, 3) * controlPoints[3].y); Mouse.hop(new Point(x, y)); try { Thread.sleep(Calculations.random(5, 15)); } catch (InterruptedException e) { Logger.log(e.getMessage()); } } } /** * Calculate an overshoot point past the target for more human like behavior * * @param start The start point * @param end The end point * @return The overshoot point */ private Point getOvershootPoint(Point start, Point end) { int overshootDistance = 30 + random.nextInt(31); // Random overshoot between 30 and 60 pixels double angle = Math.atan2(end.y - start.y, end.x - start.x); int overshootX = (int) (end.x + overshootDistance * Math.cos(angle)); int overshootY = (int) (end.y + overshootDistance * Math.sin(angle)); return new Point(overshootX, overshootY); } public double distance(Point p1, Point p2) { return Math.sqrt((p2.y - p1.y) * (p2.y - p1.y) + (p2.x - p1.x) * (p2.x - p1.x)); } }
      • Make sure you are on the latest dreambot version if you arent already usually fixes stuff like this
      • @SubCZ @SubScripts Please participate in this thread.
      • You can use Model#getHullBounds @Override public void onPaint(Graphics2D graphics2D){ NPC banker = NPCs.closest(i -> i != null && i.getName().equals("Banker")); Shape shape = banker.getModel().getHullBounds(1.f); // Enable anti-aliasing for smoother lines graphics2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); // Set the color to Cyan graphics2D.setColor(Color.CYAN); // Set the thickness of the boarder graphics2D.setStroke(new BasicStroke(2.f)); //Draw the shape graphics2D.draw(shape); }
    • Popular Contributors

    • Feedback Statistics

      • Positive
        11388
      • Neutral
        18
      • Negative
        144
      • Total Positive
        99%
    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.