Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”“ Pick the Lock Bot โ€” Auto-Player for Dota 2 "Pick the Lock" (Dark Carnival Minigame)

A free, open-source computer-vision bot that automatically plays the Dota 2 Pick the Lock mini-game from the Dark Carnival event. It tracks the rotating lock-pick around the dial and left-clicks the instant it crosses a highlighted bar โ€” scoring points hands-free โ€” while holding right-click to keep the pick at max speed.

Download the latest release Platform: Windows Python 3.12 MIT License

Keywords: Dota 2 Pick the Lock bot ยท Dark Carnival minigame auto-player ยท rotating lock-pick auto-clicker ยท Dota 2 event script ยท OpenCV screen-capture game bot ยท Python Windows game automation ยท Slark emoji minigame.

โญ If it helps you rack up points, please star the repo โ€” it helps others find it!

๐Ÿฅพ Also check out its sibling: Boot Breaker Bot for the other Dark Carnival minigame.


๐ŸŽฏ The game (how Pick the Lock works)

A lock-pick rotates around a circular dial. You left-click the moment it passes over a highlighted bar:

  • Yellow bar โ†’ +1,000 points
  • Blue bar โ†’ +1.5 seconds on the timer
  • The pick reverses direction after each bonus hit.
  • Holding right-click speeds the pick up.
  • Clicking off a bar slows the pick and briefly disables picking โ€” so timing is everything.

Point goals: 6,000 to advance, 12k / 18k for tickets, 24,000 for the Slark emoji.

This bot does the timing for you.


โœจ Features

  • ๐ŸŽฏ Angle tracking โ€” locks onto the spinning pick and measures its angle + speed every frame.
  • โšก Lead-predicted clicks โ€” fires the left-click a hair early to beat capture + click latency, so it lands on the bar.
  • ๐ŸŸก๐Ÿ”ต Bar detection โ€” finds the yellow and blue bars by colour around the ring.
  • ๐Ÿš€ Right-click speed boost โ€” holds RMB for max spin (configurable: always / smart / off).
  • ๐Ÿ‘๏ธ Live preview โ€” shows the dial, detected bars, the pick, and the predicted click point.
  • ๐Ÿ”ง One-time calibration โ€” click the dial's centre and edge once; saved for next time.
  • ๐Ÿ–ฑ๏ธ Global hotkeys โ€” start/stop with F8.

๐Ÿš€ Quick Start โ€” Two Easy Ways

๐ŸŸข Option 1 โ€” The easy way (no Python, no setup)

  1. โฌ‡๏ธ Download pick-the-lock-bot.exe from the latest release.
  2. Double-click it. (Windows SmartScreen may warn about an unrecognized app โ€” click More info โ†’ Run anyway. The full source is in this repo.)
  3. Follow the on-screen calibration (below), then press F8 in Dota to let it play.

๐Ÿ”ต Option 2 โ€” Run from source (auto-installs everything)

Don't have Python? The launcher installs it for you.

  1. Click the green < > Code button above โ†’ Download ZIP, and unzip anywhere.
  2. Double-click run.bat โ€” the first launch auto-installs Python (if missing) and all packages into a local folder.
  3. Follow calibration, then press F8.

๐Ÿ’ก Nothing is installed system-wide โ€” everything lives in a local .venv folder next to the bot.


๐ŸŽฎ Before You Start (Dota settings)

  1. Dota console: fps_max_ui 30 โ€” the bars are FPS-timed; lower FPS makes them catchable (and the bot far more accurate).
  2. Run Dota in Borderless / Windowed-Fullscreen.
  3. Open the Pick the Lock mini-game so the dial is visible.

๐Ÿ› ๏ธ Calibration (one time, ~15 seconds)

Run calibrate.bat (or press F7 in the bot). With the dial on screen:

Step Do this
1 Mouse to the top-left of the dial area โ†’ F1
2 Mouse to the bottom-right of the dial area โ†’ F2
3 Mouse to the centre of the dial โ†’ F3
4 Mouse onto the ring where the pick travels (any point on the circle) โ†’ F4

Saved to config.json. Then run run.bat, put your cursor over the dial, focus Dota, and press F8.

Preview markers: ๐ŸŸข green = the pick (with a line to centre) ยท ๐ŸŸก yellow dots = detected bars ยท ๐ŸŸฃ magenta cross = predicted click point.


โŒจ๏ธ Hotkeys (work anywhere)

Key Action
F8 Toggle bot ON / OFF (starts OFF)
F10 Show / hide the preview
F7 Re-run calibration
F9 / Esc Quit

โš™๏ธ Tuning (config.json)

Field Meaning
boost_mode "always" (max speed), "smart" (release before a bar), or "off"
sat_min / v_min How "colourful"/bright a pixel must be to count as a bar โ€” lower these if bars aren't detected
bar_inner_margin / bar_outer_margin Width of the ring band searched for bars (around the calibrated radius)
bar_persist_frames Frames a bar must persist to count (rejects the moving pick/sparks); lower for faster reaction
latency_frames How far ahead the click is predicted โ€” raise if it clicks late, lower if early
click_margin_deg Click window width in degrees around a bar
click_cooldown Min seconds between clicks (raise if it double-clicks one pass)
smart_release_deg (smart mode) how far ahead of a bar to ease off the boost

๐Ÿฉบ Troubleshooting

Problem Fix
Nothing clicks / bars=0 in preview Bars aren't bright enough to register. Lower sat_min and v_min, or widen bar_inner_margin / bar_outer_margin. Re-check calibration (F4 should be on the bar ring).
Clicks land just before/after the bar Adjust latency_frames (raise = later, lower = earlier).
The green pick marker jitters / is lost Lower diff_thresh, or widen pick_inner_margin / pick_outer_margin. Make sure fps_max_ui 30 is set.
It double-clicks one pass Raise click_cooldown.
Too many misses at max speed Set boost_mode to "smart" or "off".
Still stuck? Run capture.bat and open an issue with the image.

๐Ÿง  How It Works

The bot screen-captures the calibrated dial, then each frame: (1) frame-differences inside the ring to find the moving pick and compute its angle + angular velocity; (2) samples colours around the ring to locate the yellow/blue bars; (3) predicts the pick's angle a couple of frames ahead and left-clicks when that prediction lands on a bar; (4) holds right-click for the speed boost. Pure OpenCV + NumPy โ€” no game memory reading or injection; it only looks at the screen and clicks, like a human.


๐Ÿงฉ Requirements (source install)

Handled automatically by run.bat. For reference: Windows, Python 3.12, and the packages in requirements.txt (numpy, opencv-python, mss, pywin32, keyboard).


โš ๏ธ Disclaimer

A hobby / educational computer-vision project for a single-player mini-game. Use at your own risk and in accordance with the Dota 2 / Steam Terms of Service. Not affiliated with or endorsed by Valve.

๐Ÿ“„ License

Released under the MIT License. Contributions welcome โ€” open an issue or PR!

About

๐Ÿ”“ Auto-player bot for the Dota 2 Pick the Lock (Dark Carnival) minigame โ€” tracks the rotating pick and left-clicks the bars with OpenCV. Free, open-source, one-click for non-technical players.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages