What this life really is : we are on a fucking giant ball thats spinning in space and no one talks about it ,its going 1600Km/h , floating in the sky above us is a giant fire ball a million times bigger than earth ,
and you need it for vitamin D , if you stare at it you will go blind , its trying to give you cancer , and if its not there you get sad
We are spinning in infinity and it never comes up
I used to be a huge stoner. Now I rarely smoke because it keeps me from being social and productive. Every couple weeks or every month, I'll smoke alone after a long day at work. I always think life is weird when I'm baked.
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!
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!
Whatever we do, we are just creating more and more chaos. We think that we have figured it all out but the truth is we are making life more and more complicated.
There is a hope somewhere that one day we will make this planet a paradise and all the conflicts and chaos will be over and humans would be satisfied but ain't gonna happen.
We are driven by hormones and controlled by the desires of this body.
The #1 farming script. Unmatched.
TRY FREE FOR 4 HOURS | PURCHASE SCRIPT
Features
Starts From Level 1, Takes You To 99
It's easy to setup for progressive leveling, as comes with the option to choose the best available crop.
Make millions per day at high levels with under an hour of playtime total!
Fully Customizable
The robust yet intuitive GUI enables you to customize your farm runs in every aspect.
You can plan out exactly what to plant, at which levels, which patches to visit, and how to get there, whether to protect or fertilize patches, and much more!
Grand Exchange Support
With automatic restocking of seeds, saplings, patch protection items, compost, teleports, runes, it's easier than ever!
With the release AIO Farming v2.0 items can automatically be sold
Grows Almost Anything, Anywhere
Does allotments, flowers, herbs, hops, bushes, trees, fruit trees, cacti, just about anything!
Supports 24 locations and 34 teleportation methods, plenty of places to go, and plenty of way to get there!
Next-Generation Anti-Ban
Integrated with Chameleon, a next-level cloud based service designed to help you blend in while botting
Enhanced with data modeled after human play, now including mouse paths
Supported Locations
Allotment/Flower/Herb: Ardougne, Catherby, Falador, Hosidius, Port Phasmatys
Hops: Champion's Guild, Seers' Village, Yanille
Bush: Champion's Guild, Rimmington, Ardougne Monastery, Miscellania, Farming Guild
Tree: Lumbridge, Falador park, Taverley, Varrock courtyard, Tree Gnome Stronghold, Farming Guild
Fruit Tree: Catherby, Brimhaven, Tree Gnome Stronghold, Farming Guild
Cactus: Al Kharid, Farming Guild
...more will be supported soon!
Supported Quests:
1. Animal Magnetism 21. Knight's Sword 40. The Tourist Trap
2. Biohazard 22. Lost City 41. The Golem
3. Big Chompy Bird Hunting 23. Mountain Daughter 42. The Gnome Village
4. Client Of Kourend 24. Nature Spirit 43. Tutorial Island (Old)
5. Cook's Assistant 25. Plague City 44. Tutorial Island (New)
6. Death Plateau 26. Priest In Peril 45. Vampire Slayer
7. Demon Slayer 27. Prince Ali Rescue 46. Waterfall
8. Doric's Quest 28. RFD: Cook 47. Witch's House
9. Dragon Slayer 29. RFD: Evil Dave 48. Witch's Potion
10. Druidic Ritual 30. RFD: Dwarf 49. Miniquest: Varrock Museum Quiz
11. Dwarf Cannon 31. RFD: Goblin 50. Miniquest: Barcrawl
12. Eagle's Peak 32. RFD: Ogre
13. Ernest The Chicken 33. RFD: Pirate Pete
14. Fight Arena 34. Romeo & Juliet
15. Fishing Contest 35. Rune Mysteries
16. Gertrude's Cat 36. Sheep Shearer
17. Goblin Diplomacy 37. The Grand Tree
18. Imp Catcher 38. Shadow Of The Storm
19. Jungle Potion 39. The Restless Ghost
You can modify the way the bot is grabbing the prices by editing the "rquester prices" file in your dreambot/scripts folder. Instructions can be found within the file.
14 Methods in 1 script | Low level methods | Very advanced |
Did you know this script is also part of Dreamy AIO Skiller Elite? See here
Welcome to Dreamy AIO Goldfarmer,
This script contains the following money making methods
Tanner ( All hides, Potion support! )
AIO Tab maker.
AIO Fungus collector.
AIO Air orber.
Spiders eggs (kour
Plank maker ( All planks, Potion support!)
Plank collector
Enchanter ( All items / enchant LVL spells )
Cannonballer
Climbing boots collector
Item combiner ( Almost all items supported. )
Bowstringer ( Level to 10 with wool supported)
Shopper ( Buy and sell items with banking, NOW SUPPORTS SAVE & LOAD, Packing supported now !)
WineGrabber (Upstairs only, Smart mouse movements, pre-hovering)
Impling jar ( Currently hidden).
Banana collector / Basket filler ( Currently hidden).
Instruction on every method:
Air orbs (Start in edgeville with glory(6) and supplies in your bank).
Tab Maker(Start at the castle wars bank or your house with the required items).
Tanner: Start at Al-kharid bank with coins in your inventory.
Plank maker: Start in varrock east bank with coins in your inventory.
Plank collector: Start at Barbarian outpost.
Enchanter: Start at any bank with cosmic runes in your inventory and required staff for the spell.
Cannonballer: Start at Edgeville with mould in your inventory.
Climbing boots collector: Start at Start at Barbarian outpost with coins in your inventory and games necklace(8) in bank.
Item combiner: Start at any bank with required items in the bank.
Bow stringer: Start at Lumbridge bank with flax in your inventory or bank.
Shopper: Start with shop open at ANY location.
Winegrabber: Start at falador with law & water runes in inventory(Air staff equipped).
Spider's eggs collector (Start at Ferox enclave with duel rings & skills necklace in your bank, this script NEED atleast 43 prayer).
Gallery:
Features
Completes Tutorial Island
Gets 10 quest points for your accounts fast
Completes Cook's Assistant for 1 QP
Completes Romeo & Juliet for 5 QP
Completes Ernest the Chicken for 4 QP
Collects required items
Almost all actions are randomized
Takes a list of accounts
Supports DreamBot's QuickStart
Active customer support
Gallery
@death dead
Tutorial Island finished in 6 minutes 32 seconds
Account file
QuickStart
Seems to be a bit better today. Maybe it runs worse if there are multiple accounts running? Could mess with the timings or something. Another point to make is that it constantly runs too far in to the Edgeville bank, before correcting and going to the same banker each time. This makes the pattern look extremely botty in my opinion, could you prevent the overrun in the bank or alternatively let it select the nearest banker as opposed to the same banker each time? Thanks dude
Edit: getting around 1600/1700 made an hour, though I have had it top 2k.
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.