A diep.io mod menu that farms shapes for you.

Hexlock reads the game canvas pixel by pixel, finds the nearest shape, and aims and fires at it automatically. You keep control of upgrades.

Chrome extension, Manifest V3, version 1.0. The menu in the demo works, so change the target and watch the tank.

Features

Everything lives in one small panel. The demo at the top of the page runs the same options.

Auto-Farm
Locks onto the closest shape and fires at it about every 60 ms.
Target picker
Farm everything, or only squares, triangles or hexagons.
Show Targets
Draws a crosshair, label and dashed line to the current target.
Spinner
Sweeps your aim in a circle around your tank while firing.
Avoids players
Skips the red player color so it won't lock onto tanks.
Draggable
Grab the menu by its title and park it anywhere on screen.

How it works

No game files or network packets are touched. It just looks at the screen and moves the mouse.

  1. Scan the canvas

    Every frame it grabs the game canvas with getImageData and samples every 3rd pixel.

  2. Classify by color

    Each sampled pixel is checked against color ranges for squares, triangles and hexagons. Player red is filtered out first.

  3. Pick the nearest

    Distance is measured from the center of the screen, which is your tank. The closest match wins.

  4. Aim and fire

    It dispatches synthetic mousemove, mousedown and mouseup events at that spot. The loop runs every 30 ms.

Color ranges it matches
SquaresR>180 G>180 B<120
TrianglesR>150 G 50–130 B 30–130
HexagonsR<130 G<130 B>180
Player, skippedrgb(241, 78, 84) ± range
// find the closest shape to your tank
for (const target of targets) {
  const dx = target.x - centerX;
  const dy = target.y - centerY;
  const dist = dx*dx + dy*dy;
  if (dist < nearestDist && dist > 100) {
    nearestDist = dist;
    nearest = target;
  }
}

Install

Takes about a minute in Chrome or any Chromium browser.

  1. Download hexlock-extension.zip and unzip it.
  2. Go to chrome://extensions.
  3. Turn on Developer mode in the top right.
  4. Click Load unpacked and pick the unzipped extension folder.
  5. Open diep.io. The gold menu shows up on the right side of the screen.

Made as a personal learning project in browser extensions and canvas image processing. Using bots may break a game's rules, so use it at your own risk.