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
  • holic

    Scripter
    • Posts

      639
    • Joined

    • Last visited

    • Days Won

      20

    Reputation Activity

    1. Like
      holic got a reaction from Bruhuh in DrawMouseUtil - Draw mouse trails and custom cursors   
      I made a nifty little mouse utility for drawing custom cursors and trails that I thought I would pass onto the community. Some of the trails are meh but I think the final product is still great and it's very straightforward to use.
      Credits:
      DarkMagican for the original mouse trails & rainbow source ENFILADE for MousePathPoint Setup functions
      void setCursorColor(Color cursorColor) Manually set the cursor's colour, default white void setCursorStroke(BasicStroke cursorStroke) Manually set the cursor's stroke thickness, default 2 void setTrailColor(Color trailColor) Manually set the trail's colour, default white void setRainbow(boolean RAINBOW) Set the mouse cursor & trail colour to be rainbow void setRandomColor() Set the mouse cursor & trail colour to be random, possibly rainbow Mouse functions
      void drawRandomMouse(Graphics g) Draws the randomly selected mouse graphic. void drawPlusMouse(Graphics g) Draws a "+" for the mouse, with shadow. void drawCrossMouse(Graphics g) Draws a "x" for the mouse, with shadow. void drawCircleMouse(Graphics g) Draws a circle for the mouse, with shadow. void drawDotMouse(Graphics g) Draws a dot for the mouse, with shadow. void drawRotatingCrossMouse(Graphics g) Draws an "x" for the mouse that rotates, with shadow. void drawRotatingCircleMouse(Graphics g) Draws a circle with rotating pie slices, with shadow. Trail functions
      void drawTrail(Graphics g) Draws a typical line-based mouse trail, varying size line width void drawZoomTrail(Graphics g) Draws a "ZOOM" for a trail, varying case and size void drawTextTrail(Graphics g, String trail) Draws your specified text for a trail, could work for script status? void drawDotTrail(Graphics g) Draws a series of dots as a trail, varying sizes void drawCircleTrail(Graphics g) Draws a series of circles as a trail, varying sizes void drawPlusTrail(Graphics g) Draws a series of "+" as a trail, varying sizes void drawRotatingSlashTrail(Graphics g) Draws a series of "/" as a trail that rotate, varying sizes void drawRotatingCrossTrail(Graphics g) Draws a series of "x" as a trail that rotate, varying sizes Usage example
      First, add DrawMouseUtil to your project by copying and pasting it into a file name DrawMouseUtil.java and importing it into your project
      Second, create a variable for DrawMouseUtil so you have consistency in your setup and calls.
      private DrawMouseUtil drawMouseUtil = new DrawMouseUtil();  
      Third, set your desired settings and add it to onStart. For this example we will be setting up the mouse randomly:
      @Override public void onStart() { drawMouseUtil.setRandomColor(); //Set a random colour and leave the stroke setting at default ..... }  
      Fourth, call your desired mouse cursor and trail in onPaint. For this example we will be using random settings:
      @Override public void onPaint(Graphics g) { drawMouseUtil.drawRandomMouse(g); drawMouseUtil.drawRandomMouseTrail(g); }  
      My favourite combination currently is either
      drawMouseUtil.drawRotatingCrossMouse(g) drawMouseUtil.drawRotatingCrossTrail(g) or
      drawMouseUtil.drawRotatingCircleMouse(g); drawMouseUtil.drawDotTrail(g);  
       
      DrawMouseUtil.java:
      /** DrawMouseUtil by holic **/ import org.dreambot.api.Client; import org.dreambot.api.methods.Calculations; import java.awt.*; import java.awt.geom.AffineTransform; import java.awt.geom.Arc2D; import java.awt.geom.Line2D; import java.util.LinkedList; import static org.dreambot.api.methods.MethodProvider.log; public class DrawMouseUtil { LinkedList<MousePathPoint> mousePath = new LinkedList<MousePathPoint>(); private boolean RAINBOW = false; private int STROKE = 2; private int mX, mY; private long angle; private BasicStroke cursorStroke = new BasicStroke(STROKE); private int randomMouse = Calculations.random(5); private int randomMouseTrail = Calculations.random(7); private Color cursorColor = Color.WHITE; private Color trailColor = cursorColor; private Color[] cursorColors = {new Color(78, 216, 255), new Color(90, 222, 98), new Color(215, 182, 77), new Color(232, 134, 124), new Color(215, 120, 124), new Color(183, 138, 215), Color.WHITE}; private AffineTransform oldTransform; private int r = 0, g = 0, b = 0, duration = 650; public DrawMouseUtil() { Client.getInstance().setDrawMouse(false); } public void setRainbow(boolean RAINBOW) { if (RAINBOW) { g = 255; } else { g = 0; } this.RAINBOW = RAINBOW; } public void setRandomColor() { if (Calculations.random(2) != 1) { log("Rainbow mouse!"); setRainbow(true); } else { setRainbow(false); cursorColor = getRandomColour(); trailColor = cursorColor; } } private Color getRandomColour() { return cursorColors[Calculations.random(cursorColors.length - 1)]; } public void setCursorStroke(BasicStroke cursorStroke) { this.cursorStroke = cursorStroke; } public void setCursorColor(Color cursorColor) { this.cursorColor = cursorColor; } public void setTrailColor(Color trailColor) { this.trailColor = trailColor; } public void drawRandomMouse(Graphics g) { switch (randomMouse) { case 0: drawPlusMouse(g); break; case 1: drawCrossMouse(g); break; case 2: drawCircleMouse(g); break; case 3: drawDotMouse(g); break; case 4: drawRotatingCrossMouse(g); break; case 5: drawRotatingCircleMouse(g); break; } } public void drawRandomMouseTrail(Graphics g) { switch (randomMouseTrail) { case 0: drawTrail(g); break; case 1: drawZoomTrail(g); break; case 2: drawPlusTrail(g); break; case 3: drawCircleTrail(g); break; case 4: drawDotTrail(g); break; case 5: drawRotatingSlashTrail(g); break; case 6: drawRotatingCrossTrail(g); break; case 7: drawTextTrail(g, "your text here"); break; } } /** * * ** ** ** ** * Mouse cursor * * ** ** ** ** **/ public void drawPlusMouse(Graphics g) { Graphics2D g2 = (Graphics2D) g; int s = 4; Point cP = Client.getMousePosition(); int cX = (int) cP.getX(); int cY = (int) cP.getY(); g2.setColor(Color.BLACK); g2.setStroke(cursorStroke); /* + Cursor */ g2.drawLine(cX - s + 1, cY + 1, cX + s + 1, cY + 1); g2.drawLine(cX + 1, cY - s + 1, cX + 1, cY + s + 1); g2.setColor(cursorColor); g2.drawLine(cX - s, cY, cX + s, cY); g2.drawLine(cX, cY - s, cX, cY + s); g2.setStroke(new BasicStroke(1)); } public void drawCrossMouse(Graphics g) { Graphics2D g2 = (Graphics2D) g; int s = 3; Point cP = Client.getMousePosition(); int cX = (int) cP.getX(); int cY = (int) cP.getY(); g2.setStroke(cursorStroke); g2.setColor(Color.BLACK); /* X Cursor */ g2.drawLine(cX - s + 1, cY - s + 1, cX + s + 1, cY + s + 1); g2.drawLine(cX - s + 1, cY + s + 1, cX + s + 1, cY - s + 1); g2.setColor(cursorColor); g2.drawLine(cX - s, cY - s, cX + s, cY + s); g2.drawLine(cX - s, cY + s, cX + s, cY - s); g2.setStroke(new BasicStroke(1)); } public void drawCircleMouse(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); int mX = Client.getMousePosition().x; mY = Client.getMousePosition().y; g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); if (mX != -1) { g2.setStroke(cursorStroke); g2.setColor(Color.BLACK); g2.drawOval(mX - 1, mY - 1, 4, 4); g2.setColor(cursorColor); g2.drawOval(mX - 2, mY - 2, 4, 4); g2.setStroke(new BasicStroke(1)); } } public void drawDotMouse(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); int mX = Client.getMousePosition().x; mY = Client.getMousePosition().y; g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); if (mX != -1) { g2.setStroke(cursorStroke); g2.setColor(Color.BLACK); g2.drawOval(mX - 1, mY - 1, 4, 4); g2.setColor(cursorColor); g2.drawOval(mX - 2, mY - 2, 4, 4); g2.setStroke(new BasicStroke(1)); } } public void drawRotatingCircleMouse(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); int mX = Client.getMousePosition().x; mY = Client.getMousePosition().y; g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); if (mX != -1) { g2.setStroke(cursorStroke); g2.drawOval(mX - 2, mY - 2, 4, 4); g2.setColor(cursorColor); g2.rotate(Math.toRadians(angle += 6), mX, mY); g2.draw(new Arc2D.Double(mX - 6, mY - 6, 12, 12, 330, 60, Arc2D.OPEN)); g2.draw(new Arc2D.Double(mX - 6, mY - 6, 12, 12, 151, 60, Arc2D.OPEN)); g2.setTransform(oldTransform); g2.setStroke(new BasicStroke(1)); } } public void drawRotatingCrossMouse(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); Point cP = Client.getMousePosition(); int cX = (int) cP.getX(); int cY = (int) cP.getY(); int s = 4; g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); if (mX != -1) { g2.setStroke(cursorStroke); g2.setColor(Color.BLACK); //g.rotate(Math.toRadians(angle+=1), mX, mY); Line2D lineShadow = new Line2D.Double(cX - s + 1, cY + 1, cX + s + 1, cY + 1); Line2D lineShadow2 = new Line2D.Double(cX + 1, cY - s + 1, cX + 1, cY + s + 1); AffineTransform atS = AffineTransform.getRotateInstance( Math.toRadians(angle += 4), cX + 1, cY + 1); AffineTransform atS2 = AffineTransform.getRotateInstance( Math.toRadians(angle), cX + 1, cY + 1); g2.draw(atS.createTransformedShape(lineShadow)); g2.draw(atS2.createTransformedShape(lineShadow2)); g2.setColor(nextCursorColor()); Line2D line = new Line2D.Double(cX - s, cY, cX + s, cY); Line2D line2 = new Line2D.Double(cX, cY - s, cX, cY + s); AffineTransform at = AffineTransform.getRotateInstance( Math.toRadians(angle += 4), cX, cY); AffineTransform at2 = AffineTransform.getRotateInstance( Math.toRadians(angle), cX, cY); // Draw the rotated line g2.draw(at.createTransformedShape(line)); g2.draw(at2.createTransformedShape(line2)); g2.setStroke(new BasicStroke(1)); } } /** * * ** ** ** ** * Mouse trails * * ** ** ** ** **/ public void drawTrail(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); int mX = Client.getMousePosition().x; mY = Client.getMousePosition().y; g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); while (!mousePath.isEmpty() && mousePath.peek().isUp()) mousePath.remove(); Point clientCursor = Client.getMousePosition(); MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, duration); if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) mousePath.add(mpp); MousePathPoint lastPoint = null; for (MousePathPoint a : mousePath) { if (lastPoint != null) { Color c = nextTrailColor(); int tmpcursorStroke = STROKE; if (STROKE > 1) tmpcursorStroke = (a.getAlpha() > 175 ? STROKE : STROKE - 1); g2.setStroke(new BasicStroke(tmpcursorStroke)); g2.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), a.getAlpha())); //trail color g2.drawLine(a.x, a.y, lastPoint.x, lastPoint.y); g2.setStroke(new BasicStroke(1)); } lastPoint = a; } } public void drawZoomTrail(Graphics g) { String zoom = "zoom zoom "; int zoomIndex = 0, zoomIndexStart = -1; Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); g2.setFont(new Font("default", Font.BOLD, 12)); g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); while (!mousePath.isEmpty() && mousePath.peek().isUp()) mousePath.remove(); Point clientCursor = Client.getMousePosition(); MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, duration * 2); if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) mousePath.add(mpp); MousePathPoint lastPoint = null; for (MousePathPoint a : mousePath) { if (zoomIndex >= zoom.length()) zoomIndex = 0; String toDraw = String.valueOf(zoom.toCharArray()[zoomIndex]); if (lastPoint != null) { Color c = nextTrailColor(); toDraw = a.getAlpha() > 175 ? toDraw.toUpperCase() : toDraw; g2.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), a.getAlpha())); //trail color g2.drawString(toDraw, a.x, a.y + 5); } lastPoint = a; zoomIndex++; } g2.setFont(new Font("default", Font.PLAIN, 12)); } public void drawTextTrail(Graphics g, String trail) { int zoomIndex = 0, zoomIndexStart = -1; Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); g2.setFont(new Font("default", Font.BOLD, 12)); g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); while (!mousePath.isEmpty() && mousePath.peek().isUp()) mousePath.remove(); Point clientCursor = Client.getMousePosition(); MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, duration * 2); if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) mousePath.add(mpp); MousePathPoint lastPoint = null; for (MousePathPoint a : mousePath) { if (lastPoint != null) { Color c = nextTrailColor(); g2.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), a.getAlpha())); //trail color g2.drawString(trail, a.x, a.y); } lastPoint = a; zoomIndex++; } g2.setFont(new Font("default", Font.PLAIN, 12)); } public void drawDotTrail(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); while (!mousePath.isEmpty() && mousePath.peek().isUp()) mousePath.remove(); Point clientCursor = Client.getMousePosition(); MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, duration * 2); if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) mousePath.add(mpp); MousePathPoint lastPoint = null; for (MousePathPoint a : mousePath) { if (lastPoint != null) { Color c = nextTrailColor(); int size = a.getAlpha() > 200 ? 6 : a.getAlpha() > 150 ? 5 : a.getAlpha() > 100 ? 4 : a.getAlpha() > 50 ? 3 : 2; g2.setStroke(cursorStroke); g2.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), a.getAlpha())); //trail color g2.fillOval(a.x, a.y, size, size); g2.setStroke(new BasicStroke(1)); } lastPoint = a; } } public void drawCircleTrail(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); while (!mousePath.isEmpty() && mousePath.peek().isUp()) mousePath.remove(); Point clientCursor = Client.getMousePosition(); MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, duration * 2); if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) mousePath.add(mpp); MousePathPoint lastPoint = null; for (MousePathPoint a : mousePath) { if (lastPoint != null) { Color c = nextTrailColor(); int size = a.getAlpha() > 200 ? 6 : a.getAlpha() > 150 ? 5 : a.getAlpha() > 100 ? 4 : a.getAlpha() > 50 ? 3 : 2; g2.setStroke(cursorStroke); g2.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), a.getAlpha())); //trail color g2.drawOval(a.x, a.y, size, size); g2.setStroke(new BasicStroke(1)); } lastPoint = a; } } public void drawPlusTrail(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); while (!mousePath.isEmpty() && mousePath.peek().isUp()) mousePath.remove(); Point clientCursor = Client.getMousePosition(); MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, duration * 2); if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) mousePath.add(mpp); MousePathPoint lastPoint = null; for (MousePathPoint a : mousePath) { if (lastPoint != null) { Color c = nextTrailColor(); int size = a.getAlpha() > 200 ? 5 : a.getAlpha() > 150 ? 4 : a.getAlpha() > 100 ? 3 : a.getAlpha() > 50 ? 2 : 1; g2.setStroke(cursorStroke); g2.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), a.getAlpha())); //trail color g2.drawLine(a.x - size + 1, a.y + 1, a.x + size + 1, a.y + 1); g2.drawLine(a.x + 1, a.y - size + 1, a.x + 1, a.y + size + 1); g2.setStroke(new BasicStroke(1)); } lastPoint = a; } } public void drawRotatingSlashTrail(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); while (!mousePath.isEmpty() && mousePath.peek().isUp()) mousePath.remove(); Point clientCursor = Client.getMousePosition(); MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, duration * 2); if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) mousePath.add(mpp); MousePathPoint lastPoint = null; for (MousePathPoint a : mousePath) { if (lastPoint != null) { Color c = nextTrailColor(); int size = a.getAlpha() > 200 ? 5 : a.getAlpha() > 150 ? 4 : a.getAlpha() > 100 ? 3 : a.getAlpha() > 50 ? 2 : 1; g2.setStroke(cursorStroke); g2.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), a.getAlpha())); //trail color Line2D line = new Line2D.Double(a.x - size, a.y, a.x + size, a.y); Line2D line2 = new Line2D.Double(a.x, a.y - size, a.x, a.y + size); AffineTransform at = AffineTransform.getRotateInstance( Math.toRadians(angle += 4), a.x, a.y); g2.draw(at.createTransformedShape(line)); g2.setStroke(new BasicStroke(1)); } lastPoint = a; } } public void drawRotatingCrossTrail(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); while (!mousePath.isEmpty() && mousePath.peek().isUp()) mousePath.remove(); Point clientCursor = Client.getMousePosition(); MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, duration * 2); if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) mousePath.add(mpp); MousePathPoint lastPoint = null; for (MousePathPoint a : mousePath) { if (lastPoint != null) { Color c = nextTrailColor(); int size = a.getAlpha() > 200 ? 5 : a.getAlpha() > 150 ? 4 : a.getAlpha() > 100 ? 3 : a.getAlpha() > 50 ? 2 : 1; g2.setStroke(cursorStroke); g2.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), a.getAlpha())); //trail color Line2D line = new Line2D.Double(a.x - size, a.y, a.x + size, a.y); Line2D line2 = new Line2D.Double(a.x, a.y - size, a.x, a.y + size); AffineTransform at = AffineTransform.getRotateInstance( Math.toRadians(angle += 4), a.x, a.y); g2.draw(at.createTransformedShape(line)); g2.draw(at.createTransformedShape(line2)); g2.setStroke(new BasicStroke(1)); } lastPoint = a; } } public void nextRGB() { if (r == 255 && g < 255 & b == 0) { g++; } if (g == 255 && r > 0 && b == 0) { r--; } if (g == 255 && b < 255 && r == 0) { b++; } if (b == 255 && g > 0 && r == 0) { g--; } if (b == 255 && r < 255 && g == 0) { r++; } if (r == 255 && b > 0 && g == 0) { b--; } } public Color currentCursorColor() { if (!RAINBOW) { return cursorColor; } else { return new Color(r, g, b); } } public Color currentTrailColor() { if (!RAINBOW) { return trailColor; } else { return new Color(r, g, b); } } public Color nextCursorColor() { nextRGB(); return currentCursorColor(); } public Color nextTrailColor() { if (!RAINBOW) //Don't call this if it is set to rainbow so we're not double calling nextRGB() nextRGB(); return currentTrailColor(); } public class MousePathPoint extends Point { private long finishTime; private double lastingTime; private int alpha = 255; public MousePathPoint(int x, int y, int lastingTime) { super(x, y); this.lastingTime = lastingTime; finishTime = System.currentTimeMillis() + lastingTime; } public int getAlpha() { int newAlpha = ((int) ((finishTime - System.currentTimeMillis()) / (lastingTime / alpha))); if (newAlpha > 255) newAlpha = 255; if (newAlpha < 0) newAlpha = 0; return newAlpha; } public boolean isUp() { return System.currentTimeMillis() >= finishTime; } } }  
      Enjoy falsely tricking people into thinking your script is better than it is!
    2. Like
      holic got a reaction from Xtra in DrawMouseUtil - Draw mouse trails and custom cursors   
      I made a nifty little mouse utility for drawing custom cursors and trails that I thought I would pass onto the community. Some of the trails are meh but I think the final product is still great and it's very straightforward to use.
      Credits:
      DarkMagican for the original mouse trails & rainbow source ENFILADE for MousePathPoint Setup functions
      void setCursorColor(Color cursorColor) Manually set the cursor's colour, default white void setCursorStroke(BasicStroke cursorStroke) Manually set the cursor's stroke thickness, default 2 void setTrailColor(Color trailColor) Manually set the trail's colour, default white void setRainbow(boolean RAINBOW) Set the mouse cursor & trail colour to be rainbow void setRandomColor() Set the mouse cursor & trail colour to be random, possibly rainbow Mouse functions
      void drawRandomMouse(Graphics g) Draws the randomly selected mouse graphic. void drawPlusMouse(Graphics g) Draws a "+" for the mouse, with shadow. void drawCrossMouse(Graphics g) Draws a "x" for the mouse, with shadow. void drawCircleMouse(Graphics g) Draws a circle for the mouse, with shadow. void drawDotMouse(Graphics g) Draws a dot for the mouse, with shadow. void drawRotatingCrossMouse(Graphics g) Draws an "x" for the mouse that rotates, with shadow. void drawRotatingCircleMouse(Graphics g) Draws a circle with rotating pie slices, with shadow. Trail functions
      void drawTrail(Graphics g) Draws a typical line-based mouse trail, varying size line width void drawZoomTrail(Graphics g) Draws a "ZOOM" for a trail, varying case and size void drawTextTrail(Graphics g, String trail) Draws your specified text for a trail, could work for script status? void drawDotTrail(Graphics g) Draws a series of dots as a trail, varying sizes void drawCircleTrail(Graphics g) Draws a series of circles as a trail, varying sizes void drawPlusTrail(Graphics g) Draws a series of "+" as a trail, varying sizes void drawRotatingSlashTrail(Graphics g) Draws a series of "/" as a trail that rotate, varying sizes void drawRotatingCrossTrail(Graphics g) Draws a series of "x" as a trail that rotate, varying sizes Usage example
      First, add DrawMouseUtil to your project by copying and pasting it into a file name DrawMouseUtil.java and importing it into your project
      Second, create a variable for DrawMouseUtil so you have consistency in your setup and calls.
      private DrawMouseUtil drawMouseUtil = new DrawMouseUtil();  
      Third, set your desired settings and add it to onStart. For this example we will be setting up the mouse randomly:
      @Override public void onStart() { drawMouseUtil.setRandomColor(); //Set a random colour and leave the stroke setting at default ..... }  
      Fourth, call your desired mouse cursor and trail in onPaint. For this example we will be using random settings:
      @Override public void onPaint(Graphics g) { drawMouseUtil.drawRandomMouse(g); drawMouseUtil.drawRandomMouseTrail(g); }  
      My favourite combination currently is either
      drawMouseUtil.drawRotatingCrossMouse(g) drawMouseUtil.drawRotatingCrossTrail(g) or
      drawMouseUtil.drawRotatingCircleMouse(g); drawMouseUtil.drawDotTrail(g);  
       
      DrawMouseUtil.java:
      /** DrawMouseUtil by holic **/ import org.dreambot.api.Client; import org.dreambot.api.methods.Calculations; import java.awt.*; import java.awt.geom.AffineTransform; import java.awt.geom.Arc2D; import java.awt.geom.Line2D; import java.util.LinkedList; import static org.dreambot.api.methods.MethodProvider.log; public class DrawMouseUtil { LinkedList<MousePathPoint> mousePath = new LinkedList<MousePathPoint>(); private boolean RAINBOW = false; private int STROKE = 2; private int mX, mY; private long angle; private BasicStroke cursorStroke = new BasicStroke(STROKE); private int randomMouse = Calculations.random(5); private int randomMouseTrail = Calculations.random(7); private Color cursorColor = Color.WHITE; private Color trailColor = cursorColor; private Color[] cursorColors = {new Color(78, 216, 255), new Color(90, 222, 98), new Color(215, 182, 77), new Color(232, 134, 124), new Color(215, 120, 124), new Color(183, 138, 215), Color.WHITE}; private AffineTransform oldTransform; private int r = 0, g = 0, b = 0, duration = 650; public DrawMouseUtil() { Client.getInstance().setDrawMouse(false); } public void setRainbow(boolean RAINBOW) { if (RAINBOW) { g = 255; } else { g = 0; } this.RAINBOW = RAINBOW; } public void setRandomColor() { if (Calculations.random(2) != 1) { log("Rainbow mouse!"); setRainbow(true); } else { setRainbow(false); cursorColor = getRandomColour(); trailColor = cursorColor; } } private Color getRandomColour() { return cursorColors[Calculations.random(cursorColors.length - 1)]; } public void setCursorStroke(BasicStroke cursorStroke) { this.cursorStroke = cursorStroke; } public void setCursorColor(Color cursorColor) { this.cursorColor = cursorColor; } public void setTrailColor(Color trailColor) { this.trailColor = trailColor; } public void drawRandomMouse(Graphics g) { switch (randomMouse) { case 0: drawPlusMouse(g); break; case 1: drawCrossMouse(g); break; case 2: drawCircleMouse(g); break; case 3: drawDotMouse(g); break; case 4: drawRotatingCrossMouse(g); break; case 5: drawRotatingCircleMouse(g); break; } } public void drawRandomMouseTrail(Graphics g) { switch (randomMouseTrail) { case 0: drawTrail(g); break; case 1: drawZoomTrail(g); break; case 2: drawPlusTrail(g); break; case 3: drawCircleTrail(g); break; case 4: drawDotTrail(g); break; case 5: drawRotatingSlashTrail(g); break; case 6: drawRotatingCrossTrail(g); break; case 7: drawTextTrail(g, "your text here"); break; } } /** * * ** ** ** ** * Mouse cursor * * ** ** ** ** **/ public void drawPlusMouse(Graphics g) { Graphics2D g2 = (Graphics2D) g; int s = 4; Point cP = Client.getMousePosition(); int cX = (int) cP.getX(); int cY = (int) cP.getY(); g2.setColor(Color.BLACK); g2.setStroke(cursorStroke); /* + Cursor */ g2.drawLine(cX - s + 1, cY + 1, cX + s + 1, cY + 1); g2.drawLine(cX + 1, cY - s + 1, cX + 1, cY + s + 1); g2.setColor(cursorColor); g2.drawLine(cX - s, cY, cX + s, cY); g2.drawLine(cX, cY - s, cX, cY + s); g2.setStroke(new BasicStroke(1)); } public void drawCrossMouse(Graphics g) { Graphics2D g2 = (Graphics2D) g; int s = 3; Point cP = Client.getMousePosition(); int cX = (int) cP.getX(); int cY = (int) cP.getY(); g2.setStroke(cursorStroke); g2.setColor(Color.BLACK); /* X Cursor */ g2.drawLine(cX - s + 1, cY - s + 1, cX + s + 1, cY + s + 1); g2.drawLine(cX - s + 1, cY + s + 1, cX + s + 1, cY - s + 1); g2.setColor(cursorColor); g2.drawLine(cX - s, cY - s, cX + s, cY + s); g2.drawLine(cX - s, cY + s, cX + s, cY - s); g2.setStroke(new BasicStroke(1)); } public void drawCircleMouse(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); int mX = Client.getMousePosition().x; mY = Client.getMousePosition().y; g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); if (mX != -1) { g2.setStroke(cursorStroke); g2.setColor(Color.BLACK); g2.drawOval(mX - 1, mY - 1, 4, 4); g2.setColor(cursorColor); g2.drawOval(mX - 2, mY - 2, 4, 4); g2.setStroke(new BasicStroke(1)); } } public void drawDotMouse(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); int mX = Client.getMousePosition().x; mY = Client.getMousePosition().y; g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); if (mX != -1) { g2.setStroke(cursorStroke); g2.setColor(Color.BLACK); g2.drawOval(mX - 1, mY - 1, 4, 4); g2.setColor(cursorColor); g2.drawOval(mX - 2, mY - 2, 4, 4); g2.setStroke(new BasicStroke(1)); } } public void drawRotatingCircleMouse(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); int mX = Client.getMousePosition().x; mY = Client.getMousePosition().y; g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); if (mX != -1) { g2.setStroke(cursorStroke); g2.drawOval(mX - 2, mY - 2, 4, 4); g2.setColor(cursorColor); g2.rotate(Math.toRadians(angle += 6), mX, mY); g2.draw(new Arc2D.Double(mX - 6, mY - 6, 12, 12, 330, 60, Arc2D.OPEN)); g2.draw(new Arc2D.Double(mX - 6, mY - 6, 12, 12, 151, 60, Arc2D.OPEN)); g2.setTransform(oldTransform); g2.setStroke(new BasicStroke(1)); } } public void drawRotatingCrossMouse(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); Point cP = Client.getMousePosition(); int cX = (int) cP.getX(); int cY = (int) cP.getY(); int s = 4; g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); if (mX != -1) { g2.setStroke(cursorStroke); g2.setColor(Color.BLACK); //g.rotate(Math.toRadians(angle+=1), mX, mY); Line2D lineShadow = new Line2D.Double(cX - s + 1, cY + 1, cX + s + 1, cY + 1); Line2D lineShadow2 = new Line2D.Double(cX + 1, cY - s + 1, cX + 1, cY + s + 1); AffineTransform atS = AffineTransform.getRotateInstance( Math.toRadians(angle += 4), cX + 1, cY + 1); AffineTransform atS2 = AffineTransform.getRotateInstance( Math.toRadians(angle), cX + 1, cY + 1); g2.draw(atS.createTransformedShape(lineShadow)); g2.draw(atS2.createTransformedShape(lineShadow2)); g2.setColor(nextCursorColor()); Line2D line = new Line2D.Double(cX - s, cY, cX + s, cY); Line2D line2 = new Line2D.Double(cX, cY - s, cX, cY + s); AffineTransform at = AffineTransform.getRotateInstance( Math.toRadians(angle += 4), cX, cY); AffineTransform at2 = AffineTransform.getRotateInstance( Math.toRadians(angle), cX, cY); // Draw the rotated line g2.draw(at.createTransformedShape(line)); g2.draw(at2.createTransformedShape(line2)); g2.setStroke(new BasicStroke(1)); } } /** * * ** ** ** ** * Mouse trails * * ** ** ** ** **/ public void drawTrail(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); int mX = Client.getMousePosition().x; mY = Client.getMousePosition().y; g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); while (!mousePath.isEmpty() && mousePath.peek().isUp()) mousePath.remove(); Point clientCursor = Client.getMousePosition(); MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, duration); if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) mousePath.add(mpp); MousePathPoint lastPoint = null; for (MousePathPoint a : mousePath) { if (lastPoint != null) { Color c = nextTrailColor(); int tmpcursorStroke = STROKE; if (STROKE > 1) tmpcursorStroke = (a.getAlpha() > 175 ? STROKE : STROKE - 1); g2.setStroke(new BasicStroke(tmpcursorStroke)); g2.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), a.getAlpha())); //trail color g2.drawLine(a.x, a.y, lastPoint.x, lastPoint.y); g2.setStroke(new BasicStroke(1)); } lastPoint = a; } } public void drawZoomTrail(Graphics g) { String zoom = "zoom zoom "; int zoomIndex = 0, zoomIndexStart = -1; Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); g2.setFont(new Font("default", Font.BOLD, 12)); g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); while (!mousePath.isEmpty() && mousePath.peek().isUp()) mousePath.remove(); Point clientCursor = Client.getMousePosition(); MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, duration * 2); if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) mousePath.add(mpp); MousePathPoint lastPoint = null; for (MousePathPoint a : mousePath) { if (zoomIndex >= zoom.length()) zoomIndex = 0; String toDraw = String.valueOf(zoom.toCharArray()[zoomIndex]); if (lastPoint != null) { Color c = nextTrailColor(); toDraw = a.getAlpha() > 175 ? toDraw.toUpperCase() : toDraw; g2.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), a.getAlpha())); //trail color g2.drawString(toDraw, a.x, a.y + 5); } lastPoint = a; zoomIndex++; } g2.setFont(new Font("default", Font.PLAIN, 12)); } public void drawTextTrail(Graphics g, String trail) { int zoomIndex = 0, zoomIndexStart = -1; Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); g2.setFont(new Font("default", Font.BOLD, 12)); g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); while (!mousePath.isEmpty() && mousePath.peek().isUp()) mousePath.remove(); Point clientCursor = Client.getMousePosition(); MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, duration * 2); if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) mousePath.add(mpp); MousePathPoint lastPoint = null; for (MousePathPoint a : mousePath) { if (lastPoint != null) { Color c = nextTrailColor(); g2.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), a.getAlpha())); //trail color g2.drawString(trail, a.x, a.y); } lastPoint = a; zoomIndex++; } g2.setFont(new Font("default", Font.PLAIN, 12)); } public void drawDotTrail(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); while (!mousePath.isEmpty() && mousePath.peek().isUp()) mousePath.remove(); Point clientCursor = Client.getMousePosition(); MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, duration * 2); if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) mousePath.add(mpp); MousePathPoint lastPoint = null; for (MousePathPoint a : mousePath) { if (lastPoint != null) { Color c = nextTrailColor(); int size = a.getAlpha() > 200 ? 6 : a.getAlpha() > 150 ? 5 : a.getAlpha() > 100 ? 4 : a.getAlpha() > 50 ? 3 : 2; g2.setStroke(cursorStroke); g2.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), a.getAlpha())); //trail color g2.fillOval(a.x, a.y, size, size); g2.setStroke(new BasicStroke(1)); } lastPoint = a; } } public void drawCircleTrail(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); while (!mousePath.isEmpty() && mousePath.peek().isUp()) mousePath.remove(); Point clientCursor = Client.getMousePosition(); MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, duration * 2); if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) mousePath.add(mpp); MousePathPoint lastPoint = null; for (MousePathPoint a : mousePath) { if (lastPoint != null) { Color c = nextTrailColor(); int size = a.getAlpha() > 200 ? 6 : a.getAlpha() > 150 ? 5 : a.getAlpha() > 100 ? 4 : a.getAlpha() > 50 ? 3 : 2; g2.setStroke(cursorStroke); g2.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), a.getAlpha())); //trail color g2.drawOval(a.x, a.y, size, size); g2.setStroke(new BasicStroke(1)); } lastPoint = a; } } public void drawPlusTrail(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); while (!mousePath.isEmpty() && mousePath.peek().isUp()) mousePath.remove(); Point clientCursor = Client.getMousePosition(); MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, duration * 2); if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) mousePath.add(mpp); MousePathPoint lastPoint = null; for (MousePathPoint a : mousePath) { if (lastPoint != null) { Color c = nextTrailColor(); int size = a.getAlpha() > 200 ? 5 : a.getAlpha() > 150 ? 4 : a.getAlpha() > 100 ? 3 : a.getAlpha() > 50 ? 2 : 1; g2.setStroke(cursorStroke); g2.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), a.getAlpha())); //trail color g2.drawLine(a.x - size + 1, a.y + 1, a.x + size + 1, a.y + 1); g2.drawLine(a.x + 1, a.y - size + 1, a.x + 1, a.y + size + 1); g2.setStroke(new BasicStroke(1)); } lastPoint = a; } } public void drawRotatingSlashTrail(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); while (!mousePath.isEmpty() && mousePath.peek().isUp()) mousePath.remove(); Point clientCursor = Client.getMousePosition(); MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, duration * 2); if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) mousePath.add(mpp); MousePathPoint lastPoint = null; for (MousePathPoint a : mousePath) { if (lastPoint != null) { Color c = nextTrailColor(); int size = a.getAlpha() > 200 ? 5 : a.getAlpha() > 150 ? 4 : a.getAlpha() > 100 ? 3 : a.getAlpha() > 50 ? 2 : 1; g2.setStroke(cursorStroke); g2.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), a.getAlpha())); //trail color Line2D line = new Line2D.Double(a.x - size, a.y, a.x + size, a.y); Line2D line2 = new Line2D.Double(a.x, a.y - size, a.x, a.y + size); AffineTransform at = AffineTransform.getRotateInstance( Math.toRadians(angle += 4), a.x, a.y); g2.draw(at.createTransformedShape(line)); g2.setStroke(new BasicStroke(1)); } lastPoint = a; } } public void drawRotatingCrossTrail(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); while (!mousePath.isEmpty() && mousePath.peek().isUp()) mousePath.remove(); Point clientCursor = Client.getMousePosition(); MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, duration * 2); if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) mousePath.add(mpp); MousePathPoint lastPoint = null; for (MousePathPoint a : mousePath) { if (lastPoint != null) { Color c = nextTrailColor(); int size = a.getAlpha() > 200 ? 5 : a.getAlpha() > 150 ? 4 : a.getAlpha() > 100 ? 3 : a.getAlpha() > 50 ? 2 : 1; g2.setStroke(cursorStroke); g2.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), a.getAlpha())); //trail color Line2D line = new Line2D.Double(a.x - size, a.y, a.x + size, a.y); Line2D line2 = new Line2D.Double(a.x, a.y - size, a.x, a.y + size); AffineTransform at = AffineTransform.getRotateInstance( Math.toRadians(angle += 4), a.x, a.y); g2.draw(at.createTransformedShape(line)); g2.draw(at.createTransformedShape(line2)); g2.setStroke(new BasicStroke(1)); } lastPoint = a; } } public void nextRGB() { if (r == 255 && g < 255 & b == 0) { g++; } if (g == 255 && r > 0 && b == 0) { r--; } if (g == 255 && b < 255 && r == 0) { b++; } if (b == 255 && g > 0 && r == 0) { g--; } if (b == 255 && r < 255 && g == 0) { r++; } if (r == 255 && b > 0 && g == 0) { b--; } } public Color currentCursorColor() { if (!RAINBOW) { return cursorColor; } else { return new Color(r, g, b); } } public Color currentTrailColor() { if (!RAINBOW) { return trailColor; } else { return new Color(r, g, b); } } public Color nextCursorColor() { nextRGB(); return currentCursorColor(); } public Color nextTrailColor() { if (!RAINBOW) //Don't call this if it is set to rainbow so we're not double calling nextRGB() nextRGB(); return currentTrailColor(); } public class MousePathPoint extends Point { private long finishTime; private double lastingTime; private int alpha = 255; public MousePathPoint(int x, int y, int lastingTime) { super(x, y); this.lastingTime = lastingTime; finishTime = System.currentTimeMillis() + lastingTime; } public int getAlpha() { int newAlpha = ((int) ((finishTime - System.currentTimeMillis()) / (lastingTime / alpha))); if (newAlpha > 255) newAlpha = 255; if (newAlpha < 0) newAlpha = 0; return newAlpha; } public boolean isUp() { return System.currentTimeMillis() >= finishTime; } } }  
      Enjoy falsely tricking people into thinking your script is better than it is!
    3. Like
      holic got a reaction from xSam in DrawMouseUtil - Draw mouse trails and custom cursors   
      I made a nifty little mouse utility for drawing custom cursors and trails that I thought I would pass onto the community. Some of the trails are meh but I think the final product is still great and it's very straightforward to use.
      Credits:
      DarkMagican for the original mouse trails & rainbow source ENFILADE for MousePathPoint Setup functions
      void setCursorColor(Color cursorColor) Manually set the cursor's colour, default white void setCursorStroke(BasicStroke cursorStroke) Manually set the cursor's stroke thickness, default 2 void setTrailColor(Color trailColor) Manually set the trail's colour, default white void setRainbow(boolean RAINBOW) Set the mouse cursor & trail colour to be rainbow void setRandomColor() Set the mouse cursor & trail colour to be random, possibly rainbow Mouse functions
      void drawRandomMouse(Graphics g) Draws the randomly selected mouse graphic. void drawPlusMouse(Graphics g) Draws a "+" for the mouse, with shadow. void drawCrossMouse(Graphics g) Draws a "x" for the mouse, with shadow. void drawCircleMouse(Graphics g) Draws a circle for the mouse, with shadow. void drawDotMouse(Graphics g) Draws a dot for the mouse, with shadow. void drawRotatingCrossMouse(Graphics g) Draws an "x" for the mouse that rotates, with shadow. void drawRotatingCircleMouse(Graphics g) Draws a circle with rotating pie slices, with shadow. Trail functions
      void drawTrail(Graphics g) Draws a typical line-based mouse trail, varying size line width void drawZoomTrail(Graphics g) Draws a "ZOOM" for a trail, varying case and size void drawTextTrail(Graphics g, String trail) Draws your specified text for a trail, could work for script status? void drawDotTrail(Graphics g) Draws a series of dots as a trail, varying sizes void drawCircleTrail(Graphics g) Draws a series of circles as a trail, varying sizes void drawPlusTrail(Graphics g) Draws a series of "+" as a trail, varying sizes void drawRotatingSlashTrail(Graphics g) Draws a series of "/" as a trail that rotate, varying sizes void drawRotatingCrossTrail(Graphics g) Draws a series of "x" as a trail that rotate, varying sizes Usage example
      First, add DrawMouseUtil to your project by copying and pasting it into a file name DrawMouseUtil.java and importing it into your project
      Second, create a variable for DrawMouseUtil so you have consistency in your setup and calls.
      private DrawMouseUtil drawMouseUtil = new DrawMouseUtil();  
      Third, set your desired settings and add it to onStart. For this example we will be setting up the mouse randomly:
      @Override public void onStart() { drawMouseUtil.setRandomColor(); //Set a random colour and leave the stroke setting at default ..... }  
      Fourth, call your desired mouse cursor and trail in onPaint. For this example we will be using random settings:
      @Override public void onPaint(Graphics g) { drawMouseUtil.drawRandomMouse(g); drawMouseUtil.drawRandomMouseTrail(g); }  
      My favourite combination currently is either
      drawMouseUtil.drawRotatingCrossMouse(g) drawMouseUtil.drawRotatingCrossTrail(g) or
      drawMouseUtil.drawRotatingCircleMouse(g); drawMouseUtil.drawDotTrail(g);  
       
      DrawMouseUtil.java:
      /** DrawMouseUtil by holic **/ import org.dreambot.api.Client; import org.dreambot.api.methods.Calculations; import java.awt.*; import java.awt.geom.AffineTransform; import java.awt.geom.Arc2D; import java.awt.geom.Line2D; import java.util.LinkedList; import static org.dreambot.api.methods.MethodProvider.log; public class DrawMouseUtil { LinkedList<MousePathPoint> mousePath = new LinkedList<MousePathPoint>(); private boolean RAINBOW = false; private int STROKE = 2; private int mX, mY; private long angle; private BasicStroke cursorStroke = new BasicStroke(STROKE); private int randomMouse = Calculations.random(5); private int randomMouseTrail = Calculations.random(7); private Color cursorColor = Color.WHITE; private Color trailColor = cursorColor; private Color[] cursorColors = {new Color(78, 216, 255), new Color(90, 222, 98), new Color(215, 182, 77), new Color(232, 134, 124), new Color(215, 120, 124), new Color(183, 138, 215), Color.WHITE}; private AffineTransform oldTransform; private int r = 0, g = 0, b = 0, duration = 650; public DrawMouseUtil() { Client.getInstance().setDrawMouse(false); } public void setRainbow(boolean RAINBOW) { if (RAINBOW) { g = 255; } else { g = 0; } this.RAINBOW = RAINBOW; } public void setRandomColor() { if (Calculations.random(2) != 1) { log("Rainbow mouse!"); setRainbow(true); } else { setRainbow(false); cursorColor = getRandomColour(); trailColor = cursorColor; } } private Color getRandomColour() { return cursorColors[Calculations.random(cursorColors.length - 1)]; } public void setCursorStroke(BasicStroke cursorStroke) { this.cursorStroke = cursorStroke; } public void setCursorColor(Color cursorColor) { this.cursorColor = cursorColor; } public void setTrailColor(Color trailColor) { this.trailColor = trailColor; } public void drawRandomMouse(Graphics g) { switch (randomMouse) { case 0: drawPlusMouse(g); break; case 1: drawCrossMouse(g); break; case 2: drawCircleMouse(g); break; case 3: drawDotMouse(g); break; case 4: drawRotatingCrossMouse(g); break; case 5: drawRotatingCircleMouse(g); break; } } public void drawRandomMouseTrail(Graphics g) { switch (randomMouseTrail) { case 0: drawTrail(g); break; case 1: drawZoomTrail(g); break; case 2: drawPlusTrail(g); break; case 3: drawCircleTrail(g); break; case 4: drawDotTrail(g); break; case 5: drawRotatingSlashTrail(g); break; case 6: drawRotatingCrossTrail(g); break; case 7: drawTextTrail(g, "your text here"); break; } } /** * * ** ** ** ** * Mouse cursor * * ** ** ** ** **/ public void drawPlusMouse(Graphics g) { Graphics2D g2 = (Graphics2D) g; int s = 4; Point cP = Client.getMousePosition(); int cX = (int) cP.getX(); int cY = (int) cP.getY(); g2.setColor(Color.BLACK); g2.setStroke(cursorStroke); /* + Cursor */ g2.drawLine(cX - s + 1, cY + 1, cX + s + 1, cY + 1); g2.drawLine(cX + 1, cY - s + 1, cX + 1, cY + s + 1); g2.setColor(cursorColor); g2.drawLine(cX - s, cY, cX + s, cY); g2.drawLine(cX, cY - s, cX, cY + s); g2.setStroke(new BasicStroke(1)); } public void drawCrossMouse(Graphics g) { Graphics2D g2 = (Graphics2D) g; int s = 3; Point cP = Client.getMousePosition(); int cX = (int) cP.getX(); int cY = (int) cP.getY(); g2.setStroke(cursorStroke); g2.setColor(Color.BLACK); /* X Cursor */ g2.drawLine(cX - s + 1, cY - s + 1, cX + s + 1, cY + s + 1); g2.drawLine(cX - s + 1, cY + s + 1, cX + s + 1, cY - s + 1); g2.setColor(cursorColor); g2.drawLine(cX - s, cY - s, cX + s, cY + s); g2.drawLine(cX - s, cY + s, cX + s, cY - s); g2.setStroke(new BasicStroke(1)); } public void drawCircleMouse(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); int mX = Client.getMousePosition().x; mY = Client.getMousePosition().y; g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); if (mX != -1) { g2.setStroke(cursorStroke); g2.setColor(Color.BLACK); g2.drawOval(mX - 1, mY - 1, 4, 4); g2.setColor(cursorColor); g2.drawOval(mX - 2, mY - 2, 4, 4); g2.setStroke(new BasicStroke(1)); } } public void drawDotMouse(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); int mX = Client.getMousePosition().x; mY = Client.getMousePosition().y; g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); if (mX != -1) { g2.setStroke(cursorStroke); g2.setColor(Color.BLACK); g2.drawOval(mX - 1, mY - 1, 4, 4); g2.setColor(cursorColor); g2.drawOval(mX - 2, mY - 2, 4, 4); g2.setStroke(new BasicStroke(1)); } } public void drawRotatingCircleMouse(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); int mX = Client.getMousePosition().x; mY = Client.getMousePosition().y; g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); if (mX != -1) { g2.setStroke(cursorStroke); g2.drawOval(mX - 2, mY - 2, 4, 4); g2.setColor(cursorColor); g2.rotate(Math.toRadians(angle += 6), mX, mY); g2.draw(new Arc2D.Double(mX - 6, mY - 6, 12, 12, 330, 60, Arc2D.OPEN)); g2.draw(new Arc2D.Double(mX - 6, mY - 6, 12, 12, 151, 60, Arc2D.OPEN)); g2.setTransform(oldTransform); g2.setStroke(new BasicStroke(1)); } } public void drawRotatingCrossMouse(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); Point cP = Client.getMousePosition(); int cX = (int) cP.getX(); int cY = (int) cP.getY(); int s = 4; g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); if (mX != -1) { g2.setStroke(cursorStroke); g2.setColor(Color.BLACK); //g.rotate(Math.toRadians(angle+=1), mX, mY); Line2D lineShadow = new Line2D.Double(cX - s + 1, cY + 1, cX + s + 1, cY + 1); Line2D lineShadow2 = new Line2D.Double(cX + 1, cY - s + 1, cX + 1, cY + s + 1); AffineTransform atS = AffineTransform.getRotateInstance( Math.toRadians(angle += 4), cX + 1, cY + 1); AffineTransform atS2 = AffineTransform.getRotateInstance( Math.toRadians(angle), cX + 1, cY + 1); g2.draw(atS.createTransformedShape(lineShadow)); g2.draw(atS2.createTransformedShape(lineShadow2)); g2.setColor(nextCursorColor()); Line2D line = new Line2D.Double(cX - s, cY, cX + s, cY); Line2D line2 = new Line2D.Double(cX, cY - s, cX, cY + s); AffineTransform at = AffineTransform.getRotateInstance( Math.toRadians(angle += 4), cX, cY); AffineTransform at2 = AffineTransform.getRotateInstance( Math.toRadians(angle), cX, cY); // Draw the rotated line g2.draw(at.createTransformedShape(line)); g2.draw(at2.createTransformedShape(line2)); g2.setStroke(new BasicStroke(1)); } } /** * * ** ** ** ** * Mouse trails * * ** ** ** ** **/ public void drawTrail(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); int mX = Client.getMousePosition().x; mY = Client.getMousePosition().y; g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); while (!mousePath.isEmpty() && mousePath.peek().isUp()) mousePath.remove(); Point clientCursor = Client.getMousePosition(); MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, duration); if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) mousePath.add(mpp); MousePathPoint lastPoint = null; for (MousePathPoint a : mousePath) { if (lastPoint != null) { Color c = nextTrailColor(); int tmpcursorStroke = STROKE; if (STROKE > 1) tmpcursorStroke = (a.getAlpha() > 175 ? STROKE : STROKE - 1); g2.setStroke(new BasicStroke(tmpcursorStroke)); g2.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), a.getAlpha())); //trail color g2.drawLine(a.x, a.y, lastPoint.x, lastPoint.y); g2.setStroke(new BasicStroke(1)); } lastPoint = a; } } public void drawZoomTrail(Graphics g) { String zoom = "zoom zoom "; int zoomIndex = 0, zoomIndexStart = -1; Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); g2.setFont(new Font("default", Font.BOLD, 12)); g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); while (!mousePath.isEmpty() && mousePath.peek().isUp()) mousePath.remove(); Point clientCursor = Client.getMousePosition(); MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, duration * 2); if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) mousePath.add(mpp); MousePathPoint lastPoint = null; for (MousePathPoint a : mousePath) { if (zoomIndex >= zoom.length()) zoomIndex = 0; String toDraw = String.valueOf(zoom.toCharArray()[zoomIndex]); if (lastPoint != null) { Color c = nextTrailColor(); toDraw = a.getAlpha() > 175 ? toDraw.toUpperCase() : toDraw; g2.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), a.getAlpha())); //trail color g2.drawString(toDraw, a.x, a.y + 5); } lastPoint = a; zoomIndex++; } g2.setFont(new Font("default", Font.PLAIN, 12)); } public void drawTextTrail(Graphics g, String trail) { int zoomIndex = 0, zoomIndexStart = -1; Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); g2.setFont(new Font("default", Font.BOLD, 12)); g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); while (!mousePath.isEmpty() && mousePath.peek().isUp()) mousePath.remove(); Point clientCursor = Client.getMousePosition(); MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, duration * 2); if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) mousePath.add(mpp); MousePathPoint lastPoint = null; for (MousePathPoint a : mousePath) { if (lastPoint != null) { Color c = nextTrailColor(); g2.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), a.getAlpha())); //trail color g2.drawString(trail, a.x, a.y); } lastPoint = a; zoomIndex++; } g2.setFont(new Font("default", Font.PLAIN, 12)); } public void drawDotTrail(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); while (!mousePath.isEmpty() && mousePath.peek().isUp()) mousePath.remove(); Point clientCursor = Client.getMousePosition(); MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, duration * 2); if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) mousePath.add(mpp); MousePathPoint lastPoint = null; for (MousePathPoint a : mousePath) { if (lastPoint != null) { Color c = nextTrailColor(); int size = a.getAlpha() > 200 ? 6 : a.getAlpha() > 150 ? 5 : a.getAlpha() > 100 ? 4 : a.getAlpha() > 50 ? 3 : 2; g2.setStroke(cursorStroke); g2.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), a.getAlpha())); //trail color g2.fillOval(a.x, a.y, size, size); g2.setStroke(new BasicStroke(1)); } lastPoint = a; } } public void drawCircleTrail(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); while (!mousePath.isEmpty() && mousePath.peek().isUp()) mousePath.remove(); Point clientCursor = Client.getMousePosition(); MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, duration * 2); if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) mousePath.add(mpp); MousePathPoint lastPoint = null; for (MousePathPoint a : mousePath) { if (lastPoint != null) { Color c = nextTrailColor(); int size = a.getAlpha() > 200 ? 6 : a.getAlpha() > 150 ? 5 : a.getAlpha() > 100 ? 4 : a.getAlpha() > 50 ? 3 : 2; g2.setStroke(cursorStroke); g2.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), a.getAlpha())); //trail color g2.drawOval(a.x, a.y, size, size); g2.setStroke(new BasicStroke(1)); } lastPoint = a; } } public void drawPlusTrail(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); while (!mousePath.isEmpty() && mousePath.peek().isUp()) mousePath.remove(); Point clientCursor = Client.getMousePosition(); MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, duration * 2); if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) mousePath.add(mpp); MousePathPoint lastPoint = null; for (MousePathPoint a : mousePath) { if (lastPoint != null) { Color c = nextTrailColor(); int size = a.getAlpha() > 200 ? 5 : a.getAlpha() > 150 ? 4 : a.getAlpha() > 100 ? 3 : a.getAlpha() > 50 ? 2 : 1; g2.setStroke(cursorStroke); g2.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), a.getAlpha())); //trail color g2.drawLine(a.x - size + 1, a.y + 1, a.x + size + 1, a.y + 1); g2.drawLine(a.x + 1, a.y - size + 1, a.x + 1, a.y + size + 1); g2.setStroke(new BasicStroke(1)); } lastPoint = a; } } public void drawRotatingSlashTrail(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); while (!mousePath.isEmpty() && mousePath.peek().isUp()) mousePath.remove(); Point clientCursor = Client.getMousePosition(); MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, duration * 2); if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) mousePath.add(mpp); MousePathPoint lastPoint = null; for (MousePathPoint a : mousePath) { if (lastPoint != null) { Color c = nextTrailColor(); int size = a.getAlpha() > 200 ? 5 : a.getAlpha() > 150 ? 4 : a.getAlpha() > 100 ? 3 : a.getAlpha() > 50 ? 2 : 1; g2.setStroke(cursorStroke); g2.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), a.getAlpha())); //trail color Line2D line = new Line2D.Double(a.x - size, a.y, a.x + size, a.y); Line2D line2 = new Line2D.Double(a.x, a.y - size, a.x, a.y + size); AffineTransform at = AffineTransform.getRotateInstance( Math.toRadians(angle += 4), a.x, a.y); g2.draw(at.createTransformedShape(line)); g2.setStroke(new BasicStroke(1)); } lastPoint = a; } } public void drawRotatingCrossTrail(Graphics g) { Graphics2D g2 = (Graphics2D) g; oldTransform = g2.getTransform(); g2.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); while (!mousePath.isEmpty() && mousePath.peek().isUp()) mousePath.remove(); Point clientCursor = Client.getMousePosition(); MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, duration * 2); if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) mousePath.add(mpp); MousePathPoint lastPoint = null; for (MousePathPoint a : mousePath) { if (lastPoint != null) { Color c = nextTrailColor(); int size = a.getAlpha() > 200 ? 5 : a.getAlpha() > 150 ? 4 : a.getAlpha() > 100 ? 3 : a.getAlpha() > 50 ? 2 : 1; g2.setStroke(cursorStroke); g2.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), a.getAlpha())); //trail color Line2D line = new Line2D.Double(a.x - size, a.y, a.x + size, a.y); Line2D line2 = new Line2D.Double(a.x, a.y - size, a.x, a.y + size); AffineTransform at = AffineTransform.getRotateInstance( Math.toRadians(angle += 4), a.x, a.y); g2.draw(at.createTransformedShape(line)); g2.draw(at.createTransformedShape(line2)); g2.setStroke(new BasicStroke(1)); } lastPoint = a; } } public void nextRGB() { if (r == 255 && g < 255 & b == 0) { g++; } if (g == 255 && r > 0 && b == 0) { r--; } if (g == 255 && b < 255 && r == 0) { b++; } if (b == 255 && g > 0 && r == 0) { g--; } if (b == 255 && r < 255 && g == 0) { r++; } if (r == 255 && b > 0 && g == 0) { b--; } } public Color currentCursorColor() { if (!RAINBOW) { return cursorColor; } else { return new Color(r, g, b); } } public Color currentTrailColor() { if (!RAINBOW) { return trailColor; } else { return new Color(r, g, b); } } public Color nextCursorColor() { nextRGB(); return currentCursorColor(); } public Color nextTrailColor() { if (!RAINBOW) //Don't call this if it is set to rainbow so we're not double calling nextRGB() nextRGB(); return currentTrailColor(); } public class MousePathPoint extends Point { private long finishTime; private double lastingTime; private int alpha = 255; public MousePathPoint(int x, int y, int lastingTime) { super(x, y); this.lastingTime = lastingTime; finishTime = System.currentTimeMillis() + lastingTime; } public int getAlpha() { int newAlpha = ((int) ((finishTime - System.currentTimeMillis()) / (lastingTime / alpha))); if (newAlpha > 255) newAlpha = 255; if (newAlpha < 0) newAlpha = 0; return newAlpha; } public boolean isUp() { return System.currentTimeMillis() >= finishTime; } } }  
      Enjoy falsely tricking people into thinking your script is better than it is!
    4. Like
      holic got a reaction from boomslap in WindMouse - Custom Mouse Movement Algorithm   
      Hey all,
      Since DB3 officially supports custom mouse algorithms I thought I would port over a classic one: WindMouse.
      WindMouse was written by BenLand100 for SCAR some years back (maybe 10 years?) and has been used on so many damn bots throughout the years because it functions really well so it only seemed right to bring it here.
      In the source code below, there are two implementations of WindMouse:
      Point windMouse(int x, int y) Which comes directly from the SMART github with minor adjustments to work with DB3.
      Better in fixed mode.
        void windMouse2(Point point) My tweaked version from years back that supports all screen sizes.
      I've added a random point between the original and the destination point if the distance between them is large to feel more human but has a 50% chance of happening. By default my implementation is the active algorithm (as it handles all sizes), swap the comments in handleMovement to change to the original.
       
      To use it, simply add the file WindMouse.java to your project and add the following to your onStart method:
      Client.getInstance().setMouseMovementAlgorithm(new WindMouse());  
      All credits go to Benjamin J. Land a.k.a. BenLand100
      WindMouse.java:
      /** * WindMouse from SMART by Benland100 * Copyright to Benland100, (Benjamin J. Land) * * Prepped for DreamBot 3 **/ import org.dreambot.api.Client; import org.dreambot.api.input.Mouse; import org.dreambot.api.input.mouse.algorithm.MouseMovementAlgorithm; import org.dreambot.api.input.mouse.destination.AbstractMouseDestination; import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.input.mouse.MouseSettings; import java.awt.*; import static java.lang.Thread.sleep; public class WindMouse implements MouseMovementAlgorithm { private int _mouseSpeed = MouseSettings.getSpeed() > 15 ? MouseSettings.getSpeed() - 10 : 15; private int _mouseSpeedLow = Math.round(_mouseSpeed / 2); private int _mouseGravity = Calculations.random(4, 20); private int _mouseWind = Calculations.random(1, 10); @Override public boolean handleMovement(AbstractMouseDestination abstractMouseDestination) { //Get a suitable point for the mouse's destination Point suitPos = abstractMouseDestination.getSuitablePoint(); // Select which implementation of WindMouse you'd like to use // by uncommenting out the line you want to use below: //windMouse(suitPos.x, suitPos.y); //Original implementation windMouse2(suitPos); //Tweaked implementation return distance(Client.getMousePosition(), suitPos) < 2; } public static void sleep(int min, int max) { try { Thread.sleep(Calculations.random(min,max)); } catch (InterruptedException e) { log(e.getMessage()); } } public static void sleep(int ms) { try { Thread.sleep(ms); } catch (InterruptedException e) { log(e.getMessage()); } } /** * Tweaked implementation of WindMouse * Moves to a mid point on longer moves to seem a little more human-like * Remove the if statement below if you'd rather straighter movement * @param point The destination point */ public void windMouse2(Point point) { Point curPos = Client.getMousePosition(); if (distance(point, curPos) > 250 && Calculations.random(1) == 2) { Point rp = randomPoint(point, curPos); windMouse2(curPos.x, curPos.y, rp.x, rp.y, _mouseGravity, _mouseWind, _mouseSpeed, Calculations.random(5, 25)); sleep(1, 150); } windMouse2(curPos.x, curPos.y, point.x, point.y, _mouseGravity, _mouseWind, _mouseSpeed, Calculations.random(5, 25)); _mouseGravity = Calculations.random(4, 20); _mouseWind = Calculations.random(1, 10); _mouseSpeed = Calculations.random(_mouseSpeedLow, MouseSettings.getSpeed()); } /** * Tweaked implementation of WindMouse by holic * All credit to Benjamin J. Land for the original. (see below) * * @param xs The x start * @param ys The y start * @param xe The x destination * @param ye The y destination * @param gravity Strength pulling the position towards the destination * @param wind Strength pulling the position in random directions * @param targetArea Radius of area around the destination that should * trigger slowing, prevents spiraling */ private void windMouse2(double xs, double ys, double xe, double ye, double gravity, double wind, double speed, double targetArea) { double dist, veloX = 0, veloY = 0, windX = 0, windY = 0; double sqrt2 = Math.sqrt(2); double sqrt3 = Math.sqrt(3); double sqrt5 = Math.sqrt(5); int tDist = (int) distance(xs, ys, xe, ye); long t = System.currentTimeMillis() + 10000; while (!(Math.hypot((xs - xe), (ys - ye)) < 1)) { if (System.currentTimeMillis() > t) break; dist = Math.hypot((xs - xe), (ys - ye)); wind = Math.min(wind, dist); if ((dist < 1)) { dist = 1; } long d = (Math.round((Math.round(((double) (tDist))) * 0.3)) / 7); if ((d > 25)) { d = 25; } if ((d < 5)) { d = 5; } double rCnc = Calculations.random(6); if ((rCnc == 1)) { d = 2; } double maxStep = (Math.min(d, Math.round(dist))) * 1.5; if ((dist >= targetArea)) { windX = (windX / sqrt3) + ((Calculations.random((int) ((Math.round(wind) * 2) + 1)) - wind) / sqrt5); windY = (windY / sqrt3) + ((Calculations.random((int) ((Math.round(wind) * 2) + 1)) - wind) / sqrt5); } else { windX = (windX / sqrt2); windY = (windY / sqrt2); } veloX += windX + gravity * (xe - xs) / dist; veloY += windY + gravity * (ye - ys) / dist; if ((Math.hypot(veloX, veloY) > maxStep)) { maxStep = ((maxStep / 2) < 1) ? 2 : maxStep; double randomDist = (maxStep / 2) + Calculations.random((int) (Math.round(maxStep) / 2)); double veloMag = Math.sqrt(((veloX * veloX) + (veloY * veloY))); veloX = (veloX / veloMag) * randomDist; veloY = (veloY / veloMag) * randomDist; } int lastX = ((int) (Math.round(xs))); int lastY = ((int) (Math.round(ys))); xs += veloX; ys += veloY; if ((lastX != Math.round(xs)) || (lastY != Math.round(ys))) { Mouse.hop(new Point((int) Math.round(xs), (int) Math.round(ys))); } int w = Calculations.random((int) (Math.round(100 / speed))) * 6; if ((w < 5)) { w = 5; } w = (int) Math.round(w * 0.9); sleep(w); } if (((Math.round(xe) != Math.round(xs)) || (Math.round(ye) != Math.round(ys)))) { Mouse.hop(new Point(((int) (Math.round(xe))), ((int) (Math.round(ye))))); } } /** * Internal mouse movement algorithm from SMART. Do not use this without credit to either * Benjamin J. Land or BenLand100. This was originally synchronized to prevent multiple * motions and bannage but functions poorly with DB3. * * BEST USED IN FIXED MODE * * @param xs The x start * @param ys The y start * @param xe The x destination * @param ye The y destination * @param gravity Strength pulling the position towards the destination * @param wind Strength pulling the position in random directions * @param minWait Minimum relative time per step * @param maxWait Maximum relative time per step * @param maxStep Maximum size of a step, prevents out of control motion * @param targetArea Radius of area around the destination that should * trigger slowing, prevents spiraling * @result The actual end point */ private Point windMouseImpl(double xs, double ys, double xe, double ye, double gravity, double wind, double minWait, double maxWait, double maxStep, double targetArea) { final double sqrt3 = Math.sqrt(3); final double sqrt5 = Math.sqrt(5); double dist, veloX = 0, veloY = 0, windX = 0, windY = 0; while ((dist = Math.hypot(xs - xe, ys - ye)) >= 1) { wind = Math.min(wind, dist); if (dist >= targetArea) { windX = windX / sqrt3 + (2D * Math.random() - 1D) * wind / sqrt5; windY = windY / sqrt3 + (2D * Math.random() - 1D) * wind / sqrt5; } else { windX /= sqrt3; windY /= sqrt3; if (maxStep < 3) { maxStep = Math.random() * 3D + 3D; } else { maxStep /= sqrt5; } } veloX += windX + gravity * (xe - xs) / dist; veloY += windY + gravity * (ye - ys) / dist; double veloMag = Math.hypot(veloX, veloY); if (veloMag > maxStep) { double randomDist = maxStep / 2D + Math.random() * maxStep / 2D; veloX = (veloX / veloMag) * randomDist; veloY = (veloY / veloMag) * randomDist; } int lastX = ((int) (Math.round(xs))); int lastY = ((int) (Math.round(ys))); xs += veloX; ys += veloY; if ((lastX != Math.round(xs)) || (lastY != Math.round(ys))) { setMousePosition(new Point((int) Math.round(xs), (int) Math.round(ys))); } double step = Math.hypot(xs - lastX, ys - lastY); sleep((int) Math.round((maxWait - minWait) * (step / maxStep) + minWait)); } return new Point((int) xs, (int) ys); } /** * Moves the mouse from the current position to the specified position. * Approximates human movement in a way where smoothness and accuracy are * relative to speed, as it should be. * * @param x The x destination * @param y The y destination * @result The actual end point */ public Point windMouse(int x, int y) { Point c = Client.getMousePosition(); double speed = (Math.random() * 15D + 15D) / 10D; return windMouseImpl(c.x, c.y, x, y, 9D, 3D, 5D / speed, 10D / speed, 10D * speed, 8D * speed); } private void setMousePosition(Point p) { Mouse.hop(p.x, p.y); } private static double distance(double x1, double y1, double x2, double y2) { return Math.sqrt((Math.pow((Math.round(x2) - Math.round(x1)), 2) + Math.pow((Math.round(y2) - Math.round(y1)), 2))); } 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)); } public static float randomPointBetween(float corner1, float corner2) { if (corner1 == corner2) { return corner1; } float delta = corner2 - corner1; float offset = Calculations.getRandom().nextFloat() * delta; return corner1 + offset; } public Point randomPoint(Point p1, Point p2) { int randomX = (int) randomPointBetween(p1.x, p2.x); int randomY = (int) randomPointBetween(p1.y, p2.y); return new Point(randomX, randomY); } }  
      Happy botting!
    5. Like
      holic reacted to TheCloakdOne in WindMouse - Custom Mouse Movement Algorithm   
      The good old days of SCAR! RIP
       
      Thanks for sharing dude
    6. Like
      holic got a reaction from Aeglen in WindMouse - Custom Mouse Movement Algorithm   
      Hey all,
      Since DB3 officially supports custom mouse algorithms I thought I would port over a classic one: WindMouse.
      WindMouse was written by BenLand100 for SCAR some years back (maybe 10 years?) and has been used on so many damn bots throughout the years because it functions really well so it only seemed right to bring it here.
      In the source code below, there are two implementations of WindMouse:
      Point windMouse(int x, int y) Which comes directly from the SMART github with minor adjustments to work with DB3.
      Better in fixed mode.
        void windMouse2(Point point) My tweaked version from years back that supports all screen sizes.
      I've added a random point between the original and the destination point if the distance between them is large to feel more human but has a 50% chance of happening. By default my implementation is the active algorithm (as it handles all sizes), swap the comments in handleMovement to change to the original.
       
      To use it, simply add the file WindMouse.java to your project and add the following to your onStart method:
      Client.getInstance().setMouseMovementAlgorithm(new WindMouse());  
      All credits go to Benjamin J. Land a.k.a. BenLand100
      WindMouse.java:
      /** * WindMouse from SMART by Benland100 * Copyright to Benland100, (Benjamin J. Land) * * Prepped for DreamBot 3 **/ import org.dreambot.api.Client; import org.dreambot.api.input.Mouse; import org.dreambot.api.input.mouse.algorithm.MouseMovementAlgorithm; import org.dreambot.api.input.mouse.destination.AbstractMouseDestination; import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.input.mouse.MouseSettings; import java.awt.*; import static java.lang.Thread.sleep; public class WindMouse implements MouseMovementAlgorithm { private int _mouseSpeed = MouseSettings.getSpeed() > 15 ? MouseSettings.getSpeed() - 10 : 15; private int _mouseSpeedLow = Math.round(_mouseSpeed / 2); private int _mouseGravity = Calculations.random(4, 20); private int _mouseWind = Calculations.random(1, 10); @Override public boolean handleMovement(AbstractMouseDestination abstractMouseDestination) { //Get a suitable point for the mouse's destination Point suitPos = abstractMouseDestination.getSuitablePoint(); // Select which implementation of WindMouse you'd like to use // by uncommenting out the line you want to use below: //windMouse(suitPos.x, suitPos.y); //Original implementation windMouse2(suitPos); //Tweaked implementation return distance(Client.getMousePosition(), suitPos) < 2; } public static void sleep(int min, int max) { try { Thread.sleep(Calculations.random(min,max)); } catch (InterruptedException e) { log(e.getMessage()); } } public static void sleep(int ms) { try { Thread.sleep(ms); } catch (InterruptedException e) { log(e.getMessage()); } } /** * Tweaked implementation of WindMouse * Moves to a mid point on longer moves to seem a little more human-like * Remove the if statement below if you'd rather straighter movement * @param point The destination point */ public void windMouse2(Point point) { Point curPos = Client.getMousePosition(); if (distance(point, curPos) > 250 && Calculations.random(1) == 2) { Point rp = randomPoint(point, curPos); windMouse2(curPos.x, curPos.y, rp.x, rp.y, _mouseGravity, _mouseWind, _mouseSpeed, Calculations.random(5, 25)); sleep(1, 150); } windMouse2(curPos.x, curPos.y, point.x, point.y, _mouseGravity, _mouseWind, _mouseSpeed, Calculations.random(5, 25)); _mouseGravity = Calculations.random(4, 20); _mouseWind = Calculations.random(1, 10); _mouseSpeed = Calculations.random(_mouseSpeedLow, MouseSettings.getSpeed()); } /** * Tweaked implementation of WindMouse by holic * All credit to Benjamin J. Land for the original. (see below) * * @param xs The x start * @param ys The y start * @param xe The x destination * @param ye The y destination * @param gravity Strength pulling the position towards the destination * @param wind Strength pulling the position in random directions * @param targetArea Radius of area around the destination that should * trigger slowing, prevents spiraling */ private void windMouse2(double xs, double ys, double xe, double ye, double gravity, double wind, double speed, double targetArea) { double dist, veloX = 0, veloY = 0, windX = 0, windY = 0; double sqrt2 = Math.sqrt(2); double sqrt3 = Math.sqrt(3); double sqrt5 = Math.sqrt(5); int tDist = (int) distance(xs, ys, xe, ye); long t = System.currentTimeMillis() + 10000; while (!(Math.hypot((xs - xe), (ys - ye)) < 1)) { if (System.currentTimeMillis() > t) break; dist = Math.hypot((xs - xe), (ys - ye)); wind = Math.min(wind, dist); if ((dist < 1)) { dist = 1; } long d = (Math.round((Math.round(((double) (tDist))) * 0.3)) / 7); if ((d > 25)) { d = 25; } if ((d < 5)) { d = 5; } double rCnc = Calculations.random(6); if ((rCnc == 1)) { d = 2; } double maxStep = (Math.min(d, Math.round(dist))) * 1.5; if ((dist >= targetArea)) { windX = (windX / sqrt3) + ((Calculations.random((int) ((Math.round(wind) * 2) + 1)) - wind) / sqrt5); windY = (windY / sqrt3) + ((Calculations.random((int) ((Math.round(wind) * 2) + 1)) - wind) / sqrt5); } else { windX = (windX / sqrt2); windY = (windY / sqrt2); } veloX += windX + gravity * (xe - xs) / dist; veloY += windY + gravity * (ye - ys) / dist; if ((Math.hypot(veloX, veloY) > maxStep)) { maxStep = ((maxStep / 2) < 1) ? 2 : maxStep; double randomDist = (maxStep / 2) + Calculations.random((int) (Math.round(maxStep) / 2)); double veloMag = Math.sqrt(((veloX * veloX) + (veloY * veloY))); veloX = (veloX / veloMag) * randomDist; veloY = (veloY / veloMag) * randomDist; } int lastX = ((int) (Math.round(xs))); int lastY = ((int) (Math.round(ys))); xs += veloX; ys += veloY; if ((lastX != Math.round(xs)) || (lastY != Math.round(ys))) { Mouse.hop(new Point((int) Math.round(xs), (int) Math.round(ys))); } int w = Calculations.random((int) (Math.round(100 / speed))) * 6; if ((w < 5)) { w = 5; } w = (int) Math.round(w * 0.9); sleep(w); } if (((Math.round(xe) != Math.round(xs)) || (Math.round(ye) != Math.round(ys)))) { Mouse.hop(new Point(((int) (Math.round(xe))), ((int) (Math.round(ye))))); } } /** * Internal mouse movement algorithm from SMART. Do not use this without credit to either * Benjamin J. Land or BenLand100. This was originally synchronized to prevent multiple * motions and bannage but functions poorly with DB3. * * BEST USED IN FIXED MODE * * @param xs The x start * @param ys The y start * @param xe The x destination * @param ye The y destination * @param gravity Strength pulling the position towards the destination * @param wind Strength pulling the position in random directions * @param minWait Minimum relative time per step * @param maxWait Maximum relative time per step * @param maxStep Maximum size of a step, prevents out of control motion * @param targetArea Radius of area around the destination that should * trigger slowing, prevents spiraling * @result The actual end point */ private Point windMouseImpl(double xs, double ys, double xe, double ye, double gravity, double wind, double minWait, double maxWait, double maxStep, double targetArea) { final double sqrt3 = Math.sqrt(3); final double sqrt5 = Math.sqrt(5); double dist, veloX = 0, veloY = 0, windX = 0, windY = 0; while ((dist = Math.hypot(xs - xe, ys - ye)) >= 1) { wind = Math.min(wind, dist); if (dist >= targetArea) { windX = windX / sqrt3 + (2D * Math.random() - 1D) * wind / sqrt5; windY = windY / sqrt3 + (2D * Math.random() - 1D) * wind / sqrt5; } else { windX /= sqrt3; windY /= sqrt3; if (maxStep < 3) { maxStep = Math.random() * 3D + 3D; } else { maxStep /= sqrt5; } } veloX += windX + gravity * (xe - xs) / dist; veloY += windY + gravity * (ye - ys) / dist; double veloMag = Math.hypot(veloX, veloY); if (veloMag > maxStep) { double randomDist = maxStep / 2D + Math.random() * maxStep / 2D; veloX = (veloX / veloMag) * randomDist; veloY = (veloY / veloMag) * randomDist; } int lastX = ((int) (Math.round(xs))); int lastY = ((int) (Math.round(ys))); xs += veloX; ys += veloY; if ((lastX != Math.round(xs)) || (lastY != Math.round(ys))) { setMousePosition(new Point((int) Math.round(xs), (int) Math.round(ys))); } double step = Math.hypot(xs - lastX, ys - lastY); sleep((int) Math.round((maxWait - minWait) * (step / maxStep) + minWait)); } return new Point((int) xs, (int) ys); } /** * Moves the mouse from the current position to the specified position. * Approximates human movement in a way where smoothness and accuracy are * relative to speed, as it should be. * * @param x The x destination * @param y The y destination * @result The actual end point */ public Point windMouse(int x, int y) { Point c = Client.getMousePosition(); double speed = (Math.random() * 15D + 15D) / 10D; return windMouseImpl(c.x, c.y, x, y, 9D, 3D, 5D / speed, 10D / speed, 10D * speed, 8D * speed); } private void setMousePosition(Point p) { Mouse.hop(p.x, p.y); } private static double distance(double x1, double y1, double x2, double y2) { return Math.sqrt((Math.pow((Math.round(x2) - Math.round(x1)), 2) + Math.pow((Math.round(y2) - Math.round(y1)), 2))); } 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)); } public static float randomPointBetween(float corner1, float corner2) { if (corner1 == corner2) { return corner1; } float delta = corner2 - corner1; float offset = Calculations.getRandom().nextFloat() * delta; return corner1 + offset; } public Point randomPoint(Point p1, Point p2) { int randomX = (int) randomPointBetween(p1.x, p2.x); int randomY = (int) randomPointBetween(p1.y, p2.y); return new Point(randomX, randomY); } }  
      Happy botting!
    7. Like
      holic got a reaction from Gorn in WindMouse - Custom Mouse Movement Algorithm   
      Hey all,
      Since DB3 officially supports custom mouse algorithms I thought I would port over a classic one: WindMouse.
      WindMouse was written by BenLand100 for SCAR some years back (maybe 10 years?) and has been used on so many damn bots throughout the years because it functions really well so it only seemed right to bring it here.
      In the source code below, there are two implementations of WindMouse:
      Point windMouse(int x, int y) Which comes directly from the SMART github with minor adjustments to work with DB3.
      Better in fixed mode.
        void windMouse2(Point point) My tweaked version from years back that supports all screen sizes.
      I've added a random point between the original and the destination point if the distance between them is large to feel more human but has a 50% chance of happening. By default my implementation is the active algorithm (as it handles all sizes), swap the comments in handleMovement to change to the original.
       
      To use it, simply add the file WindMouse.java to your project and add the following to your onStart method:
      Client.getInstance().setMouseMovementAlgorithm(new WindMouse());  
      All credits go to Benjamin J. Land a.k.a. BenLand100
      WindMouse.java:
      /** * WindMouse from SMART by Benland100 * Copyright to Benland100, (Benjamin J. Land) * * Prepped for DreamBot 3 **/ import org.dreambot.api.Client; import org.dreambot.api.input.Mouse; import org.dreambot.api.input.mouse.algorithm.MouseMovementAlgorithm; import org.dreambot.api.input.mouse.destination.AbstractMouseDestination; import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.input.mouse.MouseSettings; import java.awt.*; import static java.lang.Thread.sleep; public class WindMouse implements MouseMovementAlgorithm { private int _mouseSpeed = MouseSettings.getSpeed() > 15 ? MouseSettings.getSpeed() - 10 : 15; private int _mouseSpeedLow = Math.round(_mouseSpeed / 2); private int _mouseGravity = Calculations.random(4, 20); private int _mouseWind = Calculations.random(1, 10); @Override public boolean handleMovement(AbstractMouseDestination abstractMouseDestination) { //Get a suitable point for the mouse's destination Point suitPos = abstractMouseDestination.getSuitablePoint(); // Select which implementation of WindMouse you'd like to use // by uncommenting out the line you want to use below: //windMouse(suitPos.x, suitPos.y); //Original implementation windMouse2(suitPos); //Tweaked implementation return distance(Client.getMousePosition(), suitPos) < 2; } public static void sleep(int min, int max) { try { Thread.sleep(Calculations.random(min,max)); } catch (InterruptedException e) { log(e.getMessage()); } } public static void sleep(int ms) { try { Thread.sleep(ms); } catch (InterruptedException e) { log(e.getMessage()); } } /** * Tweaked implementation of WindMouse * Moves to a mid point on longer moves to seem a little more human-like * Remove the if statement below if you'd rather straighter movement * @param point The destination point */ public void windMouse2(Point point) { Point curPos = Client.getMousePosition(); if (distance(point, curPos) > 250 && Calculations.random(1) == 2) { Point rp = randomPoint(point, curPos); windMouse2(curPos.x, curPos.y, rp.x, rp.y, _mouseGravity, _mouseWind, _mouseSpeed, Calculations.random(5, 25)); sleep(1, 150); } windMouse2(curPos.x, curPos.y, point.x, point.y, _mouseGravity, _mouseWind, _mouseSpeed, Calculations.random(5, 25)); _mouseGravity = Calculations.random(4, 20); _mouseWind = Calculations.random(1, 10); _mouseSpeed = Calculations.random(_mouseSpeedLow, MouseSettings.getSpeed()); } /** * Tweaked implementation of WindMouse by holic * All credit to Benjamin J. Land for the original. (see below) * * @param xs The x start * @param ys The y start * @param xe The x destination * @param ye The y destination * @param gravity Strength pulling the position towards the destination * @param wind Strength pulling the position in random directions * @param targetArea Radius of area around the destination that should * trigger slowing, prevents spiraling */ private void windMouse2(double xs, double ys, double xe, double ye, double gravity, double wind, double speed, double targetArea) { double dist, veloX = 0, veloY = 0, windX = 0, windY = 0; double sqrt2 = Math.sqrt(2); double sqrt3 = Math.sqrt(3); double sqrt5 = Math.sqrt(5); int tDist = (int) distance(xs, ys, xe, ye); long t = System.currentTimeMillis() + 10000; while (!(Math.hypot((xs - xe), (ys - ye)) < 1)) { if (System.currentTimeMillis() > t) break; dist = Math.hypot((xs - xe), (ys - ye)); wind = Math.min(wind, dist); if ((dist < 1)) { dist = 1; } long d = (Math.round((Math.round(((double) (tDist))) * 0.3)) / 7); if ((d > 25)) { d = 25; } if ((d < 5)) { d = 5; } double rCnc = Calculations.random(6); if ((rCnc == 1)) { d = 2; } double maxStep = (Math.min(d, Math.round(dist))) * 1.5; if ((dist >= targetArea)) { windX = (windX / sqrt3) + ((Calculations.random((int) ((Math.round(wind) * 2) + 1)) - wind) / sqrt5); windY = (windY / sqrt3) + ((Calculations.random((int) ((Math.round(wind) * 2) + 1)) - wind) / sqrt5); } else { windX = (windX / sqrt2); windY = (windY / sqrt2); } veloX += windX + gravity * (xe - xs) / dist; veloY += windY + gravity * (ye - ys) / dist; if ((Math.hypot(veloX, veloY) > maxStep)) { maxStep = ((maxStep / 2) < 1) ? 2 : maxStep; double randomDist = (maxStep / 2) + Calculations.random((int) (Math.round(maxStep) / 2)); double veloMag = Math.sqrt(((veloX * veloX) + (veloY * veloY))); veloX = (veloX / veloMag) * randomDist; veloY = (veloY / veloMag) * randomDist; } int lastX = ((int) (Math.round(xs))); int lastY = ((int) (Math.round(ys))); xs += veloX; ys += veloY; if ((lastX != Math.round(xs)) || (lastY != Math.round(ys))) { Mouse.hop(new Point((int) Math.round(xs), (int) Math.round(ys))); } int w = Calculations.random((int) (Math.round(100 / speed))) * 6; if ((w < 5)) { w = 5; } w = (int) Math.round(w * 0.9); sleep(w); } if (((Math.round(xe) != Math.round(xs)) || (Math.round(ye) != Math.round(ys)))) { Mouse.hop(new Point(((int) (Math.round(xe))), ((int) (Math.round(ye))))); } } /** * Internal mouse movement algorithm from SMART. Do not use this without credit to either * Benjamin J. Land or BenLand100. This was originally synchronized to prevent multiple * motions and bannage but functions poorly with DB3. * * BEST USED IN FIXED MODE * * @param xs The x start * @param ys The y start * @param xe The x destination * @param ye The y destination * @param gravity Strength pulling the position towards the destination * @param wind Strength pulling the position in random directions * @param minWait Minimum relative time per step * @param maxWait Maximum relative time per step * @param maxStep Maximum size of a step, prevents out of control motion * @param targetArea Radius of area around the destination that should * trigger slowing, prevents spiraling * @result The actual end point */ private Point windMouseImpl(double xs, double ys, double xe, double ye, double gravity, double wind, double minWait, double maxWait, double maxStep, double targetArea) { final double sqrt3 = Math.sqrt(3); final double sqrt5 = Math.sqrt(5); double dist, veloX = 0, veloY = 0, windX = 0, windY = 0; while ((dist = Math.hypot(xs - xe, ys - ye)) >= 1) { wind = Math.min(wind, dist); if (dist >= targetArea) { windX = windX / sqrt3 + (2D * Math.random() - 1D) * wind / sqrt5; windY = windY / sqrt3 + (2D * Math.random() - 1D) * wind / sqrt5; } else { windX /= sqrt3; windY /= sqrt3; if (maxStep < 3) { maxStep = Math.random() * 3D + 3D; } else { maxStep /= sqrt5; } } veloX += windX + gravity * (xe - xs) / dist; veloY += windY + gravity * (ye - ys) / dist; double veloMag = Math.hypot(veloX, veloY); if (veloMag > maxStep) { double randomDist = maxStep / 2D + Math.random() * maxStep / 2D; veloX = (veloX / veloMag) * randomDist; veloY = (veloY / veloMag) * randomDist; } int lastX = ((int) (Math.round(xs))); int lastY = ((int) (Math.round(ys))); xs += veloX; ys += veloY; if ((lastX != Math.round(xs)) || (lastY != Math.round(ys))) { setMousePosition(new Point((int) Math.round(xs), (int) Math.round(ys))); } double step = Math.hypot(xs - lastX, ys - lastY); sleep((int) Math.round((maxWait - minWait) * (step / maxStep) + minWait)); } return new Point((int) xs, (int) ys); } /** * Moves the mouse from the current position to the specified position. * Approximates human movement in a way where smoothness and accuracy are * relative to speed, as it should be. * * @param x The x destination * @param y The y destination * @result The actual end point */ public Point windMouse(int x, int y) { Point c = Client.getMousePosition(); double speed = (Math.random() * 15D + 15D) / 10D; return windMouseImpl(c.x, c.y, x, y, 9D, 3D, 5D / speed, 10D / speed, 10D * speed, 8D * speed); } private void setMousePosition(Point p) { Mouse.hop(p.x, p.y); } private static double distance(double x1, double y1, double x2, double y2) { return Math.sqrt((Math.pow((Math.round(x2) - Math.round(x1)), 2) + Math.pow((Math.round(y2) - Math.round(y1)), 2))); } 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)); } public static float randomPointBetween(float corner1, float corner2) { if (corner1 == corner2) { return corner1; } float delta = corner2 - corner1; float offset = Calculations.getRandom().nextFloat() * delta; return corner1 + offset; } public Point randomPoint(Point p1, Point p2) { int randomX = (int) randomPointBetween(p1.x, p2.x); int randomY = (int) randomPointBetween(p1.y, p2.y); return new Point(randomX, randomY); } }  
      Happy botting!
    8. Like
      holic got a reaction from Realistic in WindMouse - Custom Mouse Movement Algorithm   
      Hey all,
      Since DB3 officially supports custom mouse algorithms I thought I would port over a classic one: WindMouse.
      WindMouse was written by BenLand100 for SCAR some years back (maybe 10 years?) and has been used on so many damn bots throughout the years because it functions really well so it only seemed right to bring it here.
      In the source code below, there are two implementations of WindMouse:
      Point windMouse(int x, int y) Which comes directly from the SMART github with minor adjustments to work with DB3.
      Better in fixed mode.
        void windMouse2(Point point) My tweaked version from years back that supports all screen sizes.
      I've added a random point between the original and the destination point if the distance between them is large to feel more human but has a 50% chance of happening. By default my implementation is the active algorithm (as it handles all sizes), swap the comments in handleMovement to change to the original.
       
      To use it, simply add the file WindMouse.java to your project and add the following to your onStart method:
      Client.getInstance().setMouseMovementAlgorithm(new WindMouse());  
      All credits go to Benjamin J. Land a.k.a. BenLand100
      WindMouse.java:
      /** * WindMouse from SMART by Benland100 * Copyright to Benland100, (Benjamin J. Land) * * Prepped for DreamBot 3 **/ import org.dreambot.api.Client; import org.dreambot.api.input.Mouse; import org.dreambot.api.input.mouse.algorithm.MouseMovementAlgorithm; import org.dreambot.api.input.mouse.destination.AbstractMouseDestination; import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.input.mouse.MouseSettings; import java.awt.*; import static java.lang.Thread.sleep; public class WindMouse implements MouseMovementAlgorithm { private int _mouseSpeed = MouseSettings.getSpeed() > 15 ? MouseSettings.getSpeed() - 10 : 15; private int _mouseSpeedLow = Math.round(_mouseSpeed / 2); private int _mouseGravity = Calculations.random(4, 20); private int _mouseWind = Calculations.random(1, 10); @Override public boolean handleMovement(AbstractMouseDestination abstractMouseDestination) { //Get a suitable point for the mouse's destination Point suitPos = abstractMouseDestination.getSuitablePoint(); // Select which implementation of WindMouse you'd like to use // by uncommenting out the line you want to use below: //windMouse(suitPos.x, suitPos.y); //Original implementation windMouse2(suitPos); //Tweaked implementation return distance(Client.getMousePosition(), suitPos) < 2; } public static void sleep(int min, int max) { try { Thread.sleep(Calculations.random(min,max)); } catch (InterruptedException e) { log(e.getMessage()); } } public static void sleep(int ms) { try { Thread.sleep(ms); } catch (InterruptedException e) { log(e.getMessage()); } } /** * Tweaked implementation of WindMouse * Moves to a mid point on longer moves to seem a little more human-like * Remove the if statement below if you'd rather straighter movement * @param point The destination point */ public void windMouse2(Point point) { Point curPos = Client.getMousePosition(); if (distance(point, curPos) > 250 && Calculations.random(1) == 2) { Point rp = randomPoint(point, curPos); windMouse2(curPos.x, curPos.y, rp.x, rp.y, _mouseGravity, _mouseWind, _mouseSpeed, Calculations.random(5, 25)); sleep(1, 150); } windMouse2(curPos.x, curPos.y, point.x, point.y, _mouseGravity, _mouseWind, _mouseSpeed, Calculations.random(5, 25)); _mouseGravity = Calculations.random(4, 20); _mouseWind = Calculations.random(1, 10); _mouseSpeed = Calculations.random(_mouseSpeedLow, MouseSettings.getSpeed()); } /** * Tweaked implementation of WindMouse by holic * All credit to Benjamin J. Land for the original. (see below) * * @param xs The x start * @param ys The y start * @param xe The x destination * @param ye The y destination * @param gravity Strength pulling the position towards the destination * @param wind Strength pulling the position in random directions * @param targetArea Radius of area around the destination that should * trigger slowing, prevents spiraling */ private void windMouse2(double xs, double ys, double xe, double ye, double gravity, double wind, double speed, double targetArea) { double dist, veloX = 0, veloY = 0, windX = 0, windY = 0; double sqrt2 = Math.sqrt(2); double sqrt3 = Math.sqrt(3); double sqrt5 = Math.sqrt(5); int tDist = (int) distance(xs, ys, xe, ye); long t = System.currentTimeMillis() + 10000; while (!(Math.hypot((xs - xe), (ys - ye)) < 1)) { if (System.currentTimeMillis() > t) break; dist = Math.hypot((xs - xe), (ys - ye)); wind = Math.min(wind, dist); if ((dist < 1)) { dist = 1; } long d = (Math.round((Math.round(((double) (tDist))) * 0.3)) / 7); if ((d > 25)) { d = 25; } if ((d < 5)) { d = 5; } double rCnc = Calculations.random(6); if ((rCnc == 1)) { d = 2; } double maxStep = (Math.min(d, Math.round(dist))) * 1.5; if ((dist >= targetArea)) { windX = (windX / sqrt3) + ((Calculations.random((int) ((Math.round(wind) * 2) + 1)) - wind) / sqrt5); windY = (windY / sqrt3) + ((Calculations.random((int) ((Math.round(wind) * 2) + 1)) - wind) / sqrt5); } else { windX = (windX / sqrt2); windY = (windY / sqrt2); } veloX += windX + gravity * (xe - xs) / dist; veloY += windY + gravity * (ye - ys) / dist; if ((Math.hypot(veloX, veloY) > maxStep)) { maxStep = ((maxStep / 2) < 1) ? 2 : maxStep; double randomDist = (maxStep / 2) + Calculations.random((int) (Math.round(maxStep) / 2)); double veloMag = Math.sqrt(((veloX * veloX) + (veloY * veloY))); veloX = (veloX / veloMag) * randomDist; veloY = (veloY / veloMag) * randomDist; } int lastX = ((int) (Math.round(xs))); int lastY = ((int) (Math.round(ys))); xs += veloX; ys += veloY; if ((lastX != Math.round(xs)) || (lastY != Math.round(ys))) { Mouse.hop(new Point((int) Math.round(xs), (int) Math.round(ys))); } int w = Calculations.random((int) (Math.round(100 / speed))) * 6; if ((w < 5)) { w = 5; } w = (int) Math.round(w * 0.9); sleep(w); } if (((Math.round(xe) != Math.round(xs)) || (Math.round(ye) != Math.round(ys)))) { Mouse.hop(new Point(((int) (Math.round(xe))), ((int) (Math.round(ye))))); } } /** * Internal mouse movement algorithm from SMART. Do not use this without credit to either * Benjamin J. Land or BenLand100. This was originally synchronized to prevent multiple * motions and bannage but functions poorly with DB3. * * BEST USED IN FIXED MODE * * @param xs The x start * @param ys The y start * @param xe The x destination * @param ye The y destination * @param gravity Strength pulling the position towards the destination * @param wind Strength pulling the position in random directions * @param minWait Minimum relative time per step * @param maxWait Maximum relative time per step * @param maxStep Maximum size of a step, prevents out of control motion * @param targetArea Radius of area around the destination that should * trigger slowing, prevents spiraling * @result The actual end point */ private Point windMouseImpl(double xs, double ys, double xe, double ye, double gravity, double wind, double minWait, double maxWait, double maxStep, double targetArea) { final double sqrt3 = Math.sqrt(3); final double sqrt5 = Math.sqrt(5); double dist, veloX = 0, veloY = 0, windX = 0, windY = 0; while ((dist = Math.hypot(xs - xe, ys - ye)) >= 1) { wind = Math.min(wind, dist); if (dist >= targetArea) { windX = windX / sqrt3 + (2D * Math.random() - 1D) * wind / sqrt5; windY = windY / sqrt3 + (2D * Math.random() - 1D) * wind / sqrt5; } else { windX /= sqrt3; windY /= sqrt3; if (maxStep < 3) { maxStep = Math.random() * 3D + 3D; } else { maxStep /= sqrt5; } } veloX += windX + gravity * (xe - xs) / dist; veloY += windY + gravity * (ye - ys) / dist; double veloMag = Math.hypot(veloX, veloY); if (veloMag > maxStep) { double randomDist = maxStep / 2D + Math.random() * maxStep / 2D; veloX = (veloX / veloMag) * randomDist; veloY = (veloY / veloMag) * randomDist; } int lastX = ((int) (Math.round(xs))); int lastY = ((int) (Math.round(ys))); xs += veloX; ys += veloY; if ((lastX != Math.round(xs)) || (lastY != Math.round(ys))) { setMousePosition(new Point((int) Math.round(xs), (int) Math.round(ys))); } double step = Math.hypot(xs - lastX, ys - lastY); sleep((int) Math.round((maxWait - minWait) * (step / maxStep) + minWait)); } return new Point((int) xs, (int) ys); } /** * Moves the mouse from the current position to the specified position. * Approximates human movement in a way where smoothness and accuracy are * relative to speed, as it should be. * * @param x The x destination * @param y The y destination * @result The actual end point */ public Point windMouse(int x, int y) { Point c = Client.getMousePosition(); double speed = (Math.random() * 15D + 15D) / 10D; return windMouseImpl(c.x, c.y, x, y, 9D, 3D, 5D / speed, 10D / speed, 10D * speed, 8D * speed); } private void setMousePosition(Point p) { Mouse.hop(p.x, p.y); } private static double distance(double x1, double y1, double x2, double y2) { return Math.sqrt((Math.pow((Math.round(x2) - Math.round(x1)), 2) + Math.pow((Math.round(y2) - Math.round(y1)), 2))); } 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)); } public static float randomPointBetween(float corner1, float corner2) { if (corner1 == corner2) { return corner1; } float delta = corner2 - corner1; float offset = Calculations.getRandom().nextFloat() * delta; return corner1 + offset; } public Point randomPoint(Point p1, Point p2) { int randomX = (int) randomPointBetween(p1.x, p2.x); int randomY = (int) randomPointBetween(p1.y, p2.y); return new Point(randomX, randomY); } }  
      Happy botting!
    9. Like
      holic got a reaction from Stoned in WindMouse - Custom Mouse Movement Algorithm   
      Hey all,
      Since DB3 officially supports custom mouse algorithms I thought I would port over a classic one: WindMouse.
      WindMouse was written by BenLand100 for SCAR some years back (maybe 10 years?) and has been used on so many damn bots throughout the years because it functions really well so it only seemed right to bring it here.
      In the source code below, there are two implementations of WindMouse:
      Point windMouse(int x, int y) Which comes directly from the SMART github with minor adjustments to work with DB3.
      Better in fixed mode.
        void windMouse2(Point point) My tweaked version from years back that supports all screen sizes.
      I've added a random point between the original and the destination point if the distance between them is large to feel more human but has a 50% chance of happening. By default my implementation is the active algorithm (as it handles all sizes), swap the comments in handleMovement to change to the original.
       
      To use it, simply add the file WindMouse.java to your project and add the following to your onStart method:
      Client.getInstance().setMouseMovementAlgorithm(new WindMouse());  
      All credits go to Benjamin J. Land a.k.a. BenLand100
      WindMouse.java:
      /** * WindMouse from SMART by Benland100 * Copyright to Benland100, (Benjamin J. Land) * * Prepped for DreamBot 3 **/ import org.dreambot.api.Client; import org.dreambot.api.input.Mouse; import org.dreambot.api.input.mouse.algorithm.MouseMovementAlgorithm; import org.dreambot.api.input.mouse.destination.AbstractMouseDestination; import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.input.mouse.MouseSettings; import java.awt.*; import static java.lang.Thread.sleep; public class WindMouse implements MouseMovementAlgorithm { private int _mouseSpeed = MouseSettings.getSpeed() > 15 ? MouseSettings.getSpeed() - 10 : 15; private int _mouseSpeedLow = Math.round(_mouseSpeed / 2); private int _mouseGravity = Calculations.random(4, 20); private int _mouseWind = Calculations.random(1, 10); @Override public boolean handleMovement(AbstractMouseDestination abstractMouseDestination) { //Get a suitable point for the mouse's destination Point suitPos = abstractMouseDestination.getSuitablePoint(); // Select which implementation of WindMouse you'd like to use // by uncommenting out the line you want to use below: //windMouse(suitPos.x, suitPos.y); //Original implementation windMouse2(suitPos); //Tweaked implementation return distance(Client.getMousePosition(), suitPos) < 2; } public static void sleep(int min, int max) { try { Thread.sleep(Calculations.random(min,max)); } catch (InterruptedException e) { log(e.getMessage()); } } public static void sleep(int ms) { try { Thread.sleep(ms); } catch (InterruptedException e) { log(e.getMessage()); } } /** * Tweaked implementation of WindMouse * Moves to a mid point on longer moves to seem a little more human-like * Remove the if statement below if you'd rather straighter movement * @param point The destination point */ public void windMouse2(Point point) { Point curPos = Client.getMousePosition(); if (distance(point, curPos) > 250 && Calculations.random(1) == 2) { Point rp = randomPoint(point, curPos); windMouse2(curPos.x, curPos.y, rp.x, rp.y, _mouseGravity, _mouseWind, _mouseSpeed, Calculations.random(5, 25)); sleep(1, 150); } windMouse2(curPos.x, curPos.y, point.x, point.y, _mouseGravity, _mouseWind, _mouseSpeed, Calculations.random(5, 25)); _mouseGravity = Calculations.random(4, 20); _mouseWind = Calculations.random(1, 10); _mouseSpeed = Calculations.random(_mouseSpeedLow, MouseSettings.getSpeed()); } /** * Tweaked implementation of WindMouse by holic * All credit to Benjamin J. Land for the original. (see below) * * @param xs The x start * @param ys The y start * @param xe The x destination * @param ye The y destination * @param gravity Strength pulling the position towards the destination * @param wind Strength pulling the position in random directions * @param targetArea Radius of area around the destination that should * trigger slowing, prevents spiraling */ private void windMouse2(double xs, double ys, double xe, double ye, double gravity, double wind, double speed, double targetArea) { double dist, veloX = 0, veloY = 0, windX = 0, windY = 0; double sqrt2 = Math.sqrt(2); double sqrt3 = Math.sqrt(3); double sqrt5 = Math.sqrt(5); int tDist = (int) distance(xs, ys, xe, ye); long t = System.currentTimeMillis() + 10000; while (!(Math.hypot((xs - xe), (ys - ye)) < 1)) { if (System.currentTimeMillis() > t) break; dist = Math.hypot((xs - xe), (ys - ye)); wind = Math.min(wind, dist); if ((dist < 1)) { dist = 1; } long d = (Math.round((Math.round(((double) (tDist))) * 0.3)) / 7); if ((d > 25)) { d = 25; } if ((d < 5)) { d = 5; } double rCnc = Calculations.random(6); if ((rCnc == 1)) { d = 2; } double maxStep = (Math.min(d, Math.round(dist))) * 1.5; if ((dist >= targetArea)) { windX = (windX / sqrt3) + ((Calculations.random((int) ((Math.round(wind) * 2) + 1)) - wind) / sqrt5); windY = (windY / sqrt3) + ((Calculations.random((int) ((Math.round(wind) * 2) + 1)) - wind) / sqrt5); } else { windX = (windX / sqrt2); windY = (windY / sqrt2); } veloX += windX + gravity * (xe - xs) / dist; veloY += windY + gravity * (ye - ys) / dist; if ((Math.hypot(veloX, veloY) > maxStep)) { maxStep = ((maxStep / 2) < 1) ? 2 : maxStep; double randomDist = (maxStep / 2) + Calculations.random((int) (Math.round(maxStep) / 2)); double veloMag = Math.sqrt(((veloX * veloX) + (veloY * veloY))); veloX = (veloX / veloMag) * randomDist; veloY = (veloY / veloMag) * randomDist; } int lastX = ((int) (Math.round(xs))); int lastY = ((int) (Math.round(ys))); xs += veloX; ys += veloY; if ((lastX != Math.round(xs)) || (lastY != Math.round(ys))) { Mouse.hop(new Point((int) Math.round(xs), (int) Math.round(ys))); } int w = Calculations.random((int) (Math.round(100 / speed))) * 6; if ((w < 5)) { w = 5; } w = (int) Math.round(w * 0.9); sleep(w); } if (((Math.round(xe) != Math.round(xs)) || (Math.round(ye) != Math.round(ys)))) { Mouse.hop(new Point(((int) (Math.round(xe))), ((int) (Math.round(ye))))); } } /** * Internal mouse movement algorithm from SMART. Do not use this without credit to either * Benjamin J. Land or BenLand100. This was originally synchronized to prevent multiple * motions and bannage but functions poorly with DB3. * * BEST USED IN FIXED MODE * * @param xs The x start * @param ys The y start * @param xe The x destination * @param ye The y destination * @param gravity Strength pulling the position towards the destination * @param wind Strength pulling the position in random directions * @param minWait Minimum relative time per step * @param maxWait Maximum relative time per step * @param maxStep Maximum size of a step, prevents out of control motion * @param targetArea Radius of area around the destination that should * trigger slowing, prevents spiraling * @result The actual end point */ private Point windMouseImpl(double xs, double ys, double xe, double ye, double gravity, double wind, double minWait, double maxWait, double maxStep, double targetArea) { final double sqrt3 = Math.sqrt(3); final double sqrt5 = Math.sqrt(5); double dist, veloX = 0, veloY = 0, windX = 0, windY = 0; while ((dist = Math.hypot(xs - xe, ys - ye)) >= 1) { wind = Math.min(wind, dist); if (dist >= targetArea) { windX = windX / sqrt3 + (2D * Math.random() - 1D) * wind / sqrt5; windY = windY / sqrt3 + (2D * Math.random() - 1D) * wind / sqrt5; } else { windX /= sqrt3; windY /= sqrt3; if (maxStep < 3) { maxStep = Math.random() * 3D + 3D; } else { maxStep /= sqrt5; } } veloX += windX + gravity * (xe - xs) / dist; veloY += windY + gravity * (ye - ys) / dist; double veloMag = Math.hypot(veloX, veloY); if (veloMag > maxStep) { double randomDist = maxStep / 2D + Math.random() * maxStep / 2D; veloX = (veloX / veloMag) * randomDist; veloY = (veloY / veloMag) * randomDist; } int lastX = ((int) (Math.round(xs))); int lastY = ((int) (Math.round(ys))); xs += veloX; ys += veloY; if ((lastX != Math.round(xs)) || (lastY != Math.round(ys))) { setMousePosition(new Point((int) Math.round(xs), (int) Math.round(ys))); } double step = Math.hypot(xs - lastX, ys - lastY); sleep((int) Math.round((maxWait - minWait) * (step / maxStep) + minWait)); } return new Point((int) xs, (int) ys); } /** * Moves the mouse from the current position to the specified position. * Approximates human movement in a way where smoothness and accuracy are * relative to speed, as it should be. * * @param x The x destination * @param y The y destination * @result The actual end point */ public Point windMouse(int x, int y) { Point c = Client.getMousePosition(); double speed = (Math.random() * 15D + 15D) / 10D; return windMouseImpl(c.x, c.y, x, y, 9D, 3D, 5D / speed, 10D / speed, 10D * speed, 8D * speed); } private void setMousePosition(Point p) { Mouse.hop(p.x, p.y); } private static double distance(double x1, double y1, double x2, double y2) { return Math.sqrt((Math.pow((Math.round(x2) - Math.round(x1)), 2) + Math.pow((Math.round(y2) - Math.round(y1)), 2))); } 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)); } public static float randomPointBetween(float corner1, float corner2) { if (corner1 == corner2) { return corner1; } float delta = corner2 - corner1; float offset = Calculations.getRandom().nextFloat() * delta; return corner1 + offset; } public Point randomPoint(Point p1, Point p2) { int randomX = (int) randomPointBetween(p1.x, p2.x); int randomY = (int) randomPointBetween(p1.y, p2.y); return new Point(randomX, randomY); } }  
      Happy botting!
    10. Like
      holic got a reaction from Pseudo in WindMouse - Custom Mouse Movement Algorithm   
      Hey all,
      Since DB3 officially supports custom mouse algorithms I thought I would port over a classic one: WindMouse.
      WindMouse was written by BenLand100 for SCAR some years back (maybe 10 years?) and has been used on so many damn bots throughout the years because it functions really well so it only seemed right to bring it here.
      In the source code below, there are two implementations of WindMouse:
      Point windMouse(int x, int y) Which comes directly from the SMART github with minor adjustments to work with DB3.
      Better in fixed mode.
        void windMouse2(Point point) My tweaked version from years back that supports all screen sizes.
      I've added a random point between the original and the destination point if the distance between them is large to feel more human but has a 50% chance of happening. By default my implementation is the active algorithm (as it handles all sizes), swap the comments in handleMovement to change to the original.
       
      To use it, simply add the file WindMouse.java to your project and add the following to your onStart method:
      Client.getInstance().setMouseMovementAlgorithm(new WindMouse());  
      All credits go to Benjamin J. Land a.k.a. BenLand100
      WindMouse.java:
      /** * WindMouse from SMART by Benland100 * Copyright to Benland100, (Benjamin J. Land) * * Prepped for DreamBot 3 **/ import org.dreambot.api.Client; import org.dreambot.api.input.Mouse; import org.dreambot.api.input.mouse.algorithm.MouseMovementAlgorithm; import org.dreambot.api.input.mouse.destination.AbstractMouseDestination; import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.input.mouse.MouseSettings; import java.awt.*; import static java.lang.Thread.sleep; public class WindMouse implements MouseMovementAlgorithm { private int _mouseSpeed = MouseSettings.getSpeed() > 15 ? MouseSettings.getSpeed() - 10 : 15; private int _mouseSpeedLow = Math.round(_mouseSpeed / 2); private int _mouseGravity = Calculations.random(4, 20); private int _mouseWind = Calculations.random(1, 10); @Override public boolean handleMovement(AbstractMouseDestination abstractMouseDestination) { //Get a suitable point for the mouse's destination Point suitPos = abstractMouseDestination.getSuitablePoint(); // Select which implementation of WindMouse you'd like to use // by uncommenting out the line you want to use below: //windMouse(suitPos.x, suitPos.y); //Original implementation windMouse2(suitPos); //Tweaked implementation return distance(Client.getMousePosition(), suitPos) < 2; } public static void sleep(int min, int max) { try { Thread.sleep(Calculations.random(min,max)); } catch (InterruptedException e) { log(e.getMessage()); } } public static void sleep(int ms) { try { Thread.sleep(ms); } catch (InterruptedException e) { log(e.getMessage()); } } /** * Tweaked implementation of WindMouse * Moves to a mid point on longer moves to seem a little more human-like * Remove the if statement below if you'd rather straighter movement * @param point The destination point */ public void windMouse2(Point point) { Point curPos = Client.getMousePosition(); if (distance(point, curPos) > 250 && Calculations.random(1) == 2) { Point rp = randomPoint(point, curPos); windMouse2(curPos.x, curPos.y, rp.x, rp.y, _mouseGravity, _mouseWind, _mouseSpeed, Calculations.random(5, 25)); sleep(1, 150); } windMouse2(curPos.x, curPos.y, point.x, point.y, _mouseGravity, _mouseWind, _mouseSpeed, Calculations.random(5, 25)); _mouseGravity = Calculations.random(4, 20); _mouseWind = Calculations.random(1, 10); _mouseSpeed = Calculations.random(_mouseSpeedLow, MouseSettings.getSpeed()); } /** * Tweaked implementation of WindMouse by holic * All credit to Benjamin J. Land for the original. (see below) * * @param xs The x start * @param ys The y start * @param xe The x destination * @param ye The y destination * @param gravity Strength pulling the position towards the destination * @param wind Strength pulling the position in random directions * @param targetArea Radius of area around the destination that should * trigger slowing, prevents spiraling */ private void windMouse2(double xs, double ys, double xe, double ye, double gravity, double wind, double speed, double targetArea) { double dist, veloX = 0, veloY = 0, windX = 0, windY = 0; double sqrt2 = Math.sqrt(2); double sqrt3 = Math.sqrt(3); double sqrt5 = Math.sqrt(5); int tDist = (int) distance(xs, ys, xe, ye); long t = System.currentTimeMillis() + 10000; while (!(Math.hypot((xs - xe), (ys - ye)) < 1)) { if (System.currentTimeMillis() > t) break; dist = Math.hypot((xs - xe), (ys - ye)); wind = Math.min(wind, dist); if ((dist < 1)) { dist = 1; } long d = (Math.round((Math.round(((double) (tDist))) * 0.3)) / 7); if ((d > 25)) { d = 25; } if ((d < 5)) { d = 5; } double rCnc = Calculations.random(6); if ((rCnc == 1)) { d = 2; } double maxStep = (Math.min(d, Math.round(dist))) * 1.5; if ((dist >= targetArea)) { windX = (windX / sqrt3) + ((Calculations.random((int) ((Math.round(wind) * 2) + 1)) - wind) / sqrt5); windY = (windY / sqrt3) + ((Calculations.random((int) ((Math.round(wind) * 2) + 1)) - wind) / sqrt5); } else { windX = (windX / sqrt2); windY = (windY / sqrt2); } veloX += windX + gravity * (xe - xs) / dist; veloY += windY + gravity * (ye - ys) / dist; if ((Math.hypot(veloX, veloY) > maxStep)) { maxStep = ((maxStep / 2) < 1) ? 2 : maxStep; double randomDist = (maxStep / 2) + Calculations.random((int) (Math.round(maxStep) / 2)); double veloMag = Math.sqrt(((veloX * veloX) + (veloY * veloY))); veloX = (veloX / veloMag) * randomDist; veloY = (veloY / veloMag) * randomDist; } int lastX = ((int) (Math.round(xs))); int lastY = ((int) (Math.round(ys))); xs += veloX; ys += veloY; if ((lastX != Math.round(xs)) || (lastY != Math.round(ys))) { Mouse.hop(new Point((int) Math.round(xs), (int) Math.round(ys))); } int w = Calculations.random((int) (Math.round(100 / speed))) * 6; if ((w < 5)) { w = 5; } w = (int) Math.round(w * 0.9); sleep(w); } if (((Math.round(xe) != Math.round(xs)) || (Math.round(ye) != Math.round(ys)))) { Mouse.hop(new Point(((int) (Math.round(xe))), ((int) (Math.round(ye))))); } } /** * Internal mouse movement algorithm from SMART. Do not use this without credit to either * Benjamin J. Land or BenLand100. This was originally synchronized to prevent multiple * motions and bannage but functions poorly with DB3. * * BEST USED IN FIXED MODE * * @param xs The x start * @param ys The y start * @param xe The x destination * @param ye The y destination * @param gravity Strength pulling the position towards the destination * @param wind Strength pulling the position in random directions * @param minWait Minimum relative time per step * @param maxWait Maximum relative time per step * @param maxStep Maximum size of a step, prevents out of control motion * @param targetArea Radius of area around the destination that should * trigger slowing, prevents spiraling * @result The actual end point */ private Point windMouseImpl(double xs, double ys, double xe, double ye, double gravity, double wind, double minWait, double maxWait, double maxStep, double targetArea) { final double sqrt3 = Math.sqrt(3); final double sqrt5 = Math.sqrt(5); double dist, veloX = 0, veloY = 0, windX = 0, windY = 0; while ((dist = Math.hypot(xs - xe, ys - ye)) >= 1) { wind = Math.min(wind, dist); if (dist >= targetArea) { windX = windX / sqrt3 + (2D * Math.random() - 1D) * wind / sqrt5; windY = windY / sqrt3 + (2D * Math.random() - 1D) * wind / sqrt5; } else { windX /= sqrt3; windY /= sqrt3; if (maxStep < 3) { maxStep = Math.random() * 3D + 3D; } else { maxStep /= sqrt5; } } veloX += windX + gravity * (xe - xs) / dist; veloY += windY + gravity * (ye - ys) / dist; double veloMag = Math.hypot(veloX, veloY); if (veloMag > maxStep) { double randomDist = maxStep / 2D + Math.random() * maxStep / 2D; veloX = (veloX / veloMag) * randomDist; veloY = (veloY / veloMag) * randomDist; } int lastX = ((int) (Math.round(xs))); int lastY = ((int) (Math.round(ys))); xs += veloX; ys += veloY; if ((lastX != Math.round(xs)) || (lastY != Math.round(ys))) { setMousePosition(new Point((int) Math.round(xs), (int) Math.round(ys))); } double step = Math.hypot(xs - lastX, ys - lastY); sleep((int) Math.round((maxWait - minWait) * (step / maxStep) + minWait)); } return new Point((int) xs, (int) ys); } /** * Moves the mouse from the current position to the specified position. * Approximates human movement in a way where smoothness and accuracy are * relative to speed, as it should be. * * @param x The x destination * @param y The y destination * @result The actual end point */ public Point windMouse(int x, int y) { Point c = Client.getMousePosition(); double speed = (Math.random() * 15D + 15D) / 10D; return windMouseImpl(c.x, c.y, x, y, 9D, 3D, 5D / speed, 10D / speed, 10D * speed, 8D * speed); } private void setMousePosition(Point p) { Mouse.hop(p.x, p.y); } private static double distance(double x1, double y1, double x2, double y2) { return Math.sqrt((Math.pow((Math.round(x2) - Math.round(x1)), 2) + Math.pow((Math.round(y2) - Math.round(y1)), 2))); } 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)); } public static float randomPointBetween(float corner1, float corner2) { if (corner1 == corner2) { return corner1; } float delta = corner2 - corner1; float offset = Calculations.getRandom().nextFloat() * delta; return corner1 + offset; } public Point randomPoint(Point p1, Point p2) { int randomX = (int) randomPointBetween(p1.x, p2.x); int randomY = (int) randomPointBetween(p1.y, p2.y); return new Point(randomX, randomY); } }  
      Happy botting!
    11. Like
      holic got a reaction from MrJooj in WindMouse - Custom Mouse Movement Algorithm   
      Hey all,
      Since DB3 officially supports custom mouse algorithms I thought I would port over a classic one: WindMouse.
      WindMouse was written by BenLand100 for SCAR some years back (maybe 10 years?) and has been used on so many damn bots throughout the years because it functions really well so it only seemed right to bring it here.
      In the source code below, there are two implementations of WindMouse:
      Point windMouse(int x, int y) Which comes directly from the SMART github with minor adjustments to work with DB3.
      Better in fixed mode.
        void windMouse2(Point point) My tweaked version from years back that supports all screen sizes.
      I've added a random point between the original and the destination point if the distance between them is large to feel more human but has a 50% chance of happening. By default my implementation is the active algorithm (as it handles all sizes), swap the comments in handleMovement to change to the original.
       
      To use it, simply add the file WindMouse.java to your project and add the following to your onStart method:
      Client.getInstance().setMouseMovementAlgorithm(new WindMouse());  
      All credits go to Benjamin J. Land a.k.a. BenLand100
      WindMouse.java:
      /** * WindMouse from SMART by Benland100 * Copyright to Benland100, (Benjamin J. Land) * * Prepped for DreamBot 3 **/ import org.dreambot.api.Client; import org.dreambot.api.input.Mouse; import org.dreambot.api.input.mouse.algorithm.MouseMovementAlgorithm; import org.dreambot.api.input.mouse.destination.AbstractMouseDestination; import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.input.mouse.MouseSettings; import java.awt.*; import static java.lang.Thread.sleep; public class WindMouse implements MouseMovementAlgorithm { private int _mouseSpeed = MouseSettings.getSpeed() > 15 ? MouseSettings.getSpeed() - 10 : 15; private int _mouseSpeedLow = Math.round(_mouseSpeed / 2); private int _mouseGravity = Calculations.random(4, 20); private int _mouseWind = Calculations.random(1, 10); @Override public boolean handleMovement(AbstractMouseDestination abstractMouseDestination) { //Get a suitable point for the mouse's destination Point suitPos = abstractMouseDestination.getSuitablePoint(); // Select which implementation of WindMouse you'd like to use // by uncommenting out the line you want to use below: //windMouse(suitPos.x, suitPos.y); //Original implementation windMouse2(suitPos); //Tweaked implementation return distance(Client.getMousePosition(), suitPos) < 2; } public static void sleep(int min, int max) { try { Thread.sleep(Calculations.random(min,max)); } catch (InterruptedException e) { log(e.getMessage()); } } public static void sleep(int ms) { try { Thread.sleep(ms); } catch (InterruptedException e) { log(e.getMessage()); } } /** * Tweaked implementation of WindMouse * Moves to a mid point on longer moves to seem a little more human-like * Remove the if statement below if you'd rather straighter movement * @param point The destination point */ public void windMouse2(Point point) { Point curPos = Client.getMousePosition(); if (distance(point, curPos) > 250 && Calculations.random(1) == 2) { Point rp = randomPoint(point, curPos); windMouse2(curPos.x, curPos.y, rp.x, rp.y, _mouseGravity, _mouseWind, _mouseSpeed, Calculations.random(5, 25)); sleep(1, 150); } windMouse2(curPos.x, curPos.y, point.x, point.y, _mouseGravity, _mouseWind, _mouseSpeed, Calculations.random(5, 25)); _mouseGravity = Calculations.random(4, 20); _mouseWind = Calculations.random(1, 10); _mouseSpeed = Calculations.random(_mouseSpeedLow, MouseSettings.getSpeed()); } /** * Tweaked implementation of WindMouse by holic * All credit to Benjamin J. Land for the original. (see below) * * @param xs The x start * @param ys The y start * @param xe The x destination * @param ye The y destination * @param gravity Strength pulling the position towards the destination * @param wind Strength pulling the position in random directions * @param targetArea Radius of area around the destination that should * trigger slowing, prevents spiraling */ private void windMouse2(double xs, double ys, double xe, double ye, double gravity, double wind, double speed, double targetArea) { double dist, veloX = 0, veloY = 0, windX = 0, windY = 0; double sqrt2 = Math.sqrt(2); double sqrt3 = Math.sqrt(3); double sqrt5 = Math.sqrt(5); int tDist = (int) distance(xs, ys, xe, ye); long t = System.currentTimeMillis() + 10000; while (!(Math.hypot((xs - xe), (ys - ye)) < 1)) { if (System.currentTimeMillis() > t) break; dist = Math.hypot((xs - xe), (ys - ye)); wind = Math.min(wind, dist); if ((dist < 1)) { dist = 1; } long d = (Math.round((Math.round(((double) (tDist))) * 0.3)) / 7); if ((d > 25)) { d = 25; } if ((d < 5)) { d = 5; } double rCnc = Calculations.random(6); if ((rCnc == 1)) { d = 2; } double maxStep = (Math.min(d, Math.round(dist))) * 1.5; if ((dist >= targetArea)) { windX = (windX / sqrt3) + ((Calculations.random((int) ((Math.round(wind) * 2) + 1)) - wind) / sqrt5); windY = (windY / sqrt3) + ((Calculations.random((int) ((Math.round(wind) * 2) + 1)) - wind) / sqrt5); } else { windX = (windX / sqrt2); windY = (windY / sqrt2); } veloX += windX + gravity * (xe - xs) / dist; veloY += windY + gravity * (ye - ys) / dist; if ((Math.hypot(veloX, veloY) > maxStep)) { maxStep = ((maxStep / 2) < 1) ? 2 : maxStep; double randomDist = (maxStep / 2) + Calculations.random((int) (Math.round(maxStep) / 2)); double veloMag = Math.sqrt(((veloX * veloX) + (veloY * veloY))); veloX = (veloX / veloMag) * randomDist; veloY = (veloY / veloMag) * randomDist; } int lastX = ((int) (Math.round(xs))); int lastY = ((int) (Math.round(ys))); xs += veloX; ys += veloY; if ((lastX != Math.round(xs)) || (lastY != Math.round(ys))) { Mouse.hop(new Point((int) Math.round(xs), (int) Math.round(ys))); } int w = Calculations.random((int) (Math.round(100 / speed))) * 6; if ((w < 5)) { w = 5; } w = (int) Math.round(w * 0.9); sleep(w); } if (((Math.round(xe) != Math.round(xs)) || (Math.round(ye) != Math.round(ys)))) { Mouse.hop(new Point(((int) (Math.round(xe))), ((int) (Math.round(ye))))); } } /** * Internal mouse movement algorithm from SMART. Do not use this without credit to either * Benjamin J. Land or BenLand100. This was originally synchronized to prevent multiple * motions and bannage but functions poorly with DB3. * * BEST USED IN FIXED MODE * * @param xs The x start * @param ys The y start * @param xe The x destination * @param ye The y destination * @param gravity Strength pulling the position towards the destination * @param wind Strength pulling the position in random directions * @param minWait Minimum relative time per step * @param maxWait Maximum relative time per step * @param maxStep Maximum size of a step, prevents out of control motion * @param targetArea Radius of area around the destination that should * trigger slowing, prevents spiraling * @result The actual end point */ private Point windMouseImpl(double xs, double ys, double xe, double ye, double gravity, double wind, double minWait, double maxWait, double maxStep, double targetArea) { final double sqrt3 = Math.sqrt(3); final double sqrt5 = Math.sqrt(5); double dist, veloX = 0, veloY = 0, windX = 0, windY = 0; while ((dist = Math.hypot(xs - xe, ys - ye)) >= 1) { wind = Math.min(wind, dist); if (dist >= targetArea) { windX = windX / sqrt3 + (2D * Math.random() - 1D) * wind / sqrt5; windY = windY / sqrt3 + (2D * Math.random() - 1D) * wind / sqrt5; } else { windX /= sqrt3; windY /= sqrt3; if (maxStep < 3) { maxStep = Math.random() * 3D + 3D; } else { maxStep /= sqrt5; } } veloX += windX + gravity * (xe - xs) / dist; veloY += windY + gravity * (ye - ys) / dist; double veloMag = Math.hypot(veloX, veloY); if (veloMag > maxStep) { double randomDist = maxStep / 2D + Math.random() * maxStep / 2D; veloX = (veloX / veloMag) * randomDist; veloY = (veloY / veloMag) * randomDist; } int lastX = ((int) (Math.round(xs))); int lastY = ((int) (Math.round(ys))); xs += veloX; ys += veloY; if ((lastX != Math.round(xs)) || (lastY != Math.round(ys))) { setMousePosition(new Point((int) Math.round(xs), (int) Math.round(ys))); } double step = Math.hypot(xs - lastX, ys - lastY); sleep((int) Math.round((maxWait - minWait) * (step / maxStep) + minWait)); } return new Point((int) xs, (int) ys); } /** * Moves the mouse from the current position to the specified position. * Approximates human movement in a way where smoothness and accuracy are * relative to speed, as it should be. * * @param x The x destination * @param y The y destination * @result The actual end point */ public Point windMouse(int x, int y) { Point c = Client.getMousePosition(); double speed = (Math.random() * 15D + 15D) / 10D; return windMouseImpl(c.x, c.y, x, y, 9D, 3D, 5D / speed, 10D / speed, 10D * speed, 8D * speed); } private void setMousePosition(Point p) { Mouse.hop(p.x, p.y); } private static double distance(double x1, double y1, double x2, double y2) { return Math.sqrt((Math.pow((Math.round(x2) - Math.round(x1)), 2) + Math.pow((Math.round(y2) - Math.round(y1)), 2))); } 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)); } public static float randomPointBetween(float corner1, float corner2) { if (corner1 == corner2) { return corner1; } float delta = corner2 - corner1; float offset = Calculations.getRandom().nextFloat() * delta; return corner1 + offset; } public Point randomPoint(Point p1, Point p2) { int randomX = (int) randomPointBetween(p1.x, p2.x); int randomY = (int) randomPointBetween(p1.y, p2.y); return new Point(randomX, randomY); } }  
      Happy botting!
    12. Upvote
      holic reacted to PhilBox in [FREE] The Wild Lootaholic - Wilderness Looter - Reuploaded   
      As holic said, bans are almost guaranteed with wilderness looting. It was like this back in 2018 as well with a lot of the looting scripts.
    13. Like
      holic got a reaction from tjet in [FREE] The Wild Lootaholic - Wilderness Looter - Reuploaded   
      What version? Is it only swordfishes in the pile? If not, is a swordfish on the top of the pile?
      You can most likely thank the 25+ bots looting daily. It's becoming a highly botted area so people have caught on and are reporting accounts. User reports seem to almost guarantee that you get banned. 
      For now do everything in your power to not seem like a bot and use this script wisely. Babysit it if you're worried.
    14. Like
      holic reacted to Hashtag in Visual Scripting for DreamBot   
      Visual Scripting for DreamBot 3 Build your own 100% unique scripts with ease
       
      Making scripts has never been this easy.
      No programming knowledge required.
      Visual Scripting empowers regular users to create OSRS bots they have always wanted to use. You don't have to know anything about programming, the desire to experiment is enough!
      Don't worry about coding syntax, misspelling keywords or using the wrong brackets. Focus on building your own scripts instead. Visual Scripting allows you to build your 100% customized scripts with ease.
      Instead of writing line-by-line code you use graphical nodes to make the bot do what you want. In fact, you can create very high quality and unique scripts for your own use without writing a single line of code! Everything running under the hood is designed by Hashtag, the author of DreamBot's reputable # Scripts.
      Take full control of the scripts you run.
      The sample scripts provide a lot of information to get you started.
      Hashtag provides you with multiple high quality sample scripts to learn from, to modify for your needs or for you to use as is! The scripts showcase how you can interact with a variety of OSRS game mechanics. These include interacting with entities and items, handling dialogues, trading with other players, banking, shopping, restocking at Grand Exchange and many more. The library of sample scripts is ever growing. All requests for sample scripts are welcome.
      Everything in the scripts is 100% customizable by you. Do you want the scripts to be faster or slower? No problem, tweak the script parameters to suit your needs. Do you believe something could be done more efficient? Nothing is stopping you from making changes to the scripts. This degree of freedom will assist your bots to survive longer due to the ability to create fully unique scripts. Think of them as private scripts, except you have access to the source and you won't be dependant on another scripter fullfilling your needs.
      Your time is not wasted trying to figure out errors.
      Debugging your scripts is designed to be easy for you.
      If you have ever tried coding, you might have encountered errors. The description of these is often very confusing and you might end up wasting a lot of time trying to figure them out. Say goodbye to NullPointerException, StackOverflowError, ArrayIndexOutOfBoundsException and others! These won't haunt you in Visual Scripting.
      When you encounter an error in your script, you are immediately given a human-friendly description of the problem and the node that is causing the error is highlighted in the editor. Testing your script is as easy as clicking a button. Literally, it's a single click of a button in the editor! This is faster than compiling Java code into a JAR file that is fed to the client to execute.
       
      Try Visual Scripting free while it's in preview.
      Start your trial now, pick a plan later.
      No credit card required. No obligation. No risk.
       
      Get Started
       
      Join the Discord server.
      The Discord server is the easiest way to stay in touch.
      In Hashtag's Discord server you can chat with others, share your ideas or projects and get assistance in using the tool.
      Join Discord
      View the user manual.
      The extensive user manual helps you to get started.
      Learn more about Visual Scripting by reading the user manual. It contains how-to guides, information about best practises and more.
      View Manual
       
      Feel free to show the project some love by liking this thread!

    15. Like
      holic reacted to PhilBox in [FREE] The Wild Lootaholic - Wilderness Looter - Reuploaded   
      Unfortunately, I was away from my computer at the time and only managed to catch it after it had been like that for ~30 mins. "All" in console showed nothing but all the relogins, nothing in "errors" and "Script" didn't show anything except the usual "Sorting/Picking up/Target" info.
    16. Like
      holic got a reaction from iPray3ternity in [FREE] The Wild Lootaholic - Wilderness Looter - Reuploaded   
      Script is now on SDN, thread here:
      The Wild Lootaholic beta
      About
      A wilderness looter with a bunch of nifty features, banks and eats when necessary. Two click start!
      Looking for testers and feedback. 
      This is my first script since ARGA was alive, COVID pulled me back into this world.
      Features
      Script automatically sets up Turns off auto-retaliate Hides "Attack" option Hops to desired world Finds it way to the wilderness Dismisses wilderness warning All fields pre-defined with optimal F2P settings Multiple looting modes Smart Mixed (Random-ish) Value Amount Distance Simple and informative paint Loot list, including total profit Profit per hour Small action log to keep you updated At-a-glance Attack Warning, gamescreen flashes when attacked for easy babysitting (see screenshots) Customizable inventory value limit, banks when reached Customizable loot list, full matches only Customizable valuable list, partial and matches Customizable pickup limits for Value Amount Auto-add valuables to search list Smart banking Banks when inventory value limit reached or valuable looted Searches for more valuables in pile then banks if none Banks after a close call Withdraws food while banking, may rest if necessary Smart safing Runs when attacked Crosses ditch, when necessary Moves away from attacker, when necessary Avoids poachers, builds a "shit list" but needs improvement Rests when necessary Pauses break handler until safe to prevent attempting to take a break while in combat, failing to log out but still sleeping and signing your bot's life away. Force-bank, click the bank button on screen  Force-click, double-click anywhere to queue a click Pulse-running, knows when to run and when to walk Prioritizes valuables and runs to make sure you get the loot Eats food when HP is low and being attacked, may rest when safe Supports world-hopping when struggling to loot Supports death walking with alternative routes, avoids ban doors Rests on death Pauses break handler and logouts sometimes on death Auto-saves preferences on script start Loot log, shows on script finish Anti-ban, does various human-like things and has randomized actions to create variances between script users. Probably more that I've forgotten to write down Screenshots
      Account 1 - Roughly 5 hours on a Friday, no breaks
       
      Account 2 - Roughly 7 hours, no breaks
       
      Looting Results, 9 and a half hours on a Monday straight from Tutorial Island
       
      Known bugs
      Sometimes crosses the ditch twice when banking Sometimes double-clicks or loots while already looting Certain items cause loot log on screen to disappear, mostly fixed Sometime doesn't choose the closest item if all the reachable ground items are of the same value/amount  

    17. Like
      holic got a reaction from PhilBox in [FREE] The Wild Lootaholic - Wilderness Looter - Reuploaded   
      Minor Release! v0.994
      ####### DOWNLOAD VERSION 0.994 #######
      New: Chaotic handegg handler - removes chaotic handeggs when equipped and attempts to handoff to another player. (Semi tested) Improved: onPaint - Tweaks to colours and how it's displayed Fixed: Bug with sleeping after safing Untested: Tweaks to walk paths to prevent getting stuck between two different paths. I haven't been able to recreate the bug @PhilBox ran into but I made some changes to hopefully prevent it from happening again.
    18. Like
      holic got a reaction from PhilBox in [FREE] The Wild Lootaholic - Wilderness Looter - Reuploaded   
      Copy copy. Thank you, that's very helpful. I believe I have resolved those issues but I don't have the time to test it right now so expect an update in a bit.
    19. Like
      holic reacted to PhilBox in [FREE] The Wild Lootaholic - Wilderness Looter - Reuploaded   
      If I see it again, no problem! Here are some proggies I thought i'd share


    20. Like
      holic reacted to BLSDJ in [FREE] The Wild Lootaholic - Wilderness Looter - Reuploaded   
      It's running beautiful thankyou man  

      To explain my situation a little IRL, month ago house burnt down and was out at the time thankfully, lost everything but the clothes on my back. So in the meantime have resorted to trying to bot on OSRS again.. I've got myself a steady 40-60k F2P method, however due to starting from scratch I don't have VIP on any bot clients or any scripts etc, so I'm only able to run 4 accounts at the moment, 2 per client on free licenses. I bot tutorial island, then do a couple quests (hoping to try find a free script to automate this more) and then run the wildy looting script to get some starting cash on each of the accounts. I run it for 10-20 minutes per account fresh out of tutorial island and that almost ALWAYS lands me 10-20k which is more than enough for me to do the couple quests needed and then to start my method.

      Your script has been amazing in assisting me thus far and don't see that changing. Im making slow progress but hopefully by the end of this weekend ill have enough for 1/3 things.. VIP on one of the botting clients, a premium script or a couple bonds. Unsure which of these will help best tbh, I dont see it being the bonds as Ill probably get banned with free scripts before making enough GP back? Premium script would be pointless F2P, so im thinking its VIP to keep adding more and more bots to this F2P method until can then  afford a premium script & bond(s).

      Know not really the place to be asking but if anyone had any advice on where I should head from here, im all ears But once again special thanks to the man holic here, without this script id be picking potatoes or some chit to get that starting GP  
    21. Upvote
      holic got a reaction from tjet in [FREE] The Wild Lootaholic - Wilderness Looter - Reuploaded   
      Hah well I feel like that's to be expected after 21+ hours but still yeah damn!
      I would love to see some more proggies or loot lists from you guys, I'm very curious how it's working for people. @PhilBox @BLSDJ
    22. Like
      holic got a reaction from tjet in [FREE] The Wild Lootaholic - Wilderness Looter - Reuploaded   
      That's impressive! I think that's the longest runtime I've seen yet. Here's hoping that your haul increases.
    23. Like
      holic reacted to tjet in [FREE] The Wild Lootaholic - Wilderness Looter - Reuploaded   
      I just left it going.... Holy shit!! Almost 21 hours and going. 

    24. Like
      holic got a reaction from tjet in [FREE] The Wild Lootaholic - Wilderness Looter - Reuploaded   
      Minor Release! v0.993
      ####### DOWNLOAD 0.993 #######
      Fixed: Another banking issue, no longer gets stuck at the ditch.  
      I uncommented something I shouldn't have and it took me forever to realize. On a cursory look-over it all seemed like it should work, my bad!  Here's a fix.
    25. Like
      holic got a reaction from PhilBox in [FREE] The Wild Lootaholic - Wilderness Looter - Reuploaded   
      Minor Release! v0.993
      ####### DOWNLOAD 0.993 #######
      Fixed: Another banking issue, no longer gets stuck at the ditch.  
      I uncommented something I shouldn't have and it took me forever to realize. On a cursory look-over it all seemed like it should work, my bad!  Here's a fix.
    ×
    ×
    • 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.