Jump to content

Welcome to DreamBot

VIP Enhancement

Want to upgrade your DreamBot experience? Consider signing up for VIP!
VIP allows you to run as many accounts as you want, view the forums ad-free, receive 10% off all script purchases, and so much more!
Visit the store to learn about all of these great features!

Upgrade to VIP Now
News Ticker
  • New Forum Theme!
  • New Forum Chatbox (on the way)
  • Chatbox Mods Soon Needed
  • Suggest Forum Rank Colors
  • Forum Updates

DreamBot is the only Deadman Mode supported bot on the market!

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...