Jump to content

Welcome to DreamBot!

Download for Free

Supercharge Your Bots

Run unlimited bots today using DreamBot's Covert Mode and
stay more protected.

Upgrade Now
Frequently Asked Questions
  • Are you not able to open the client? Make sure you have Java installed
  • 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 gold? You can purchase vouchers from other users
  • Try asking for help in the chatbox
osrs gold
Bottinghub.com

Interested in advertising your business? Reach out today!

Download the DreamBot client today!
Sign in to follow this  
Zoe

HeatMap Plugin

Recommended Posts

HeatMap Plugin 1.0

About This Plugin:

Adds a simple paint overlay of the mouse-heatmap.csv that is generated by the client whilst botting. Useful for checking how human-like your bot clicks are. This also saves the heatmap as a PNG file in the same file directory as your DBLauncher. Please excuse the sloppiness x)

RMp8oEm.png

 

Changelog:

1.0 

  • Initial release.

 

Download Link: 

https://www.dropbox.com/s/vqj9g5h8y20dkly/HeatMap.jar?dl=0

 

Source:

HeatMap.java

 

 

 


package zoe.dreambot.plugin;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.imageio.ImageIO;

import org.dreambot.api.plugin.Plugin;
import org.dreambot.api.plugin.PluginManifest;

@PluginManifest(author = "Zoe", name = "HeatMap", version = 1.0)
public class HeatMap extends Plugin {

	String filepath = System.getProperty("user.home") + "/DreamBot/mouse-heatmap.csv";

	BufferedImage i;
	
	int screenWidth = 765;
	int screenHeight = 503;

	int max;
	int rectDiameter = 2;
	int amplification = 100;

	boolean paintOnce = true;

	int counts[][] = new int[screenWidth][screenHeight];

	Scanner scanner = null;

	public void onStart() {
		try {
			scanner = new Scanner(new File(filepath));
		} catch (Exception e) {
		}
		Pattern p = Pattern.compile("(\\d+),(\\d+)");
		do {
			if (!scanner.hasNext())
				break;
			String line = scanner.next();
			Matcher m = p.matcher(line);
			if (m.matches()) {
				int x = Integer.parseInt(m.group(1));
				int y = Integer.parseInt(m.group(2));
				if (x < screenWidth && y < screenHeight)
					counts[x][y]++;
				else {
				}
			}
		} while (true);
		max = 0;
		for (int x = 0; x < screenWidth; x++) {
			for (int y = 0; y < screenHeight; y++) {
				int curCount = counts[x][y];
				if (curCount > max) {
					max = curCount;
				}
			}

		}

		scanner.close();

		i = new BufferedImage(screenWidth, screenHeight, 2);
		Graphics2D g = i.createGraphics();

		//g.setColor(Color.DARK_GRAY);
		//g.fillRect(0, 0, screenWidth, screenHeight);
		for (int x = 0; x < screenWidth; x++) {
			for (int y = 0; y < screenHeight; y++) {
				int intensity = (int) ((double) (amplification * 255) * ((double) counts[x][y] / (double) max));
				if (intensity > 255)
					intensity = 255;
				g.setColor(new Color(255, 100, 100, intensity));
				g.fillRect(x - (rectDiameter - 1) / 2, y - (rectDiameter - 1) / 2, rectDiameter, rectDiameter);
			}
		}

		String outputFilename = "mouse-heatmap.png";
		try {
			ImageIO.write(i, "PNG", new File(outputFilename));
		} catch (Exception e) {
		}
	}

	public void onPaint(Graphics g) {
		g.drawImage(i, 0, 0, null);
	}

}

 

 

Edited by Zoe
Added a cute picture (:

Share this post


Link to post
Share on other sites
Sign in to follow this  

×
×
  • Create New...