Skip to content

ohnogaurav/PianoTilesBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Piano Tiles Bot πŸŽΉπŸ€–

An automated bot that plays Piano Tiles (or similar black-tile clicking games) by detecting black tiles inside a selected game window region and clicking them in real time.


πŸ“Œ Features

  • Select your game window region manually by clicking the 4 corners of the screen area.
  • Automatically detects black tiles inside the region and clicks them.
  • Works at high speed (no artificial delays).
  • Supports safe exit with Q key.
  • Clean separation of modules:
    • coordinates.py β†’ Selects & saves region coordinates.
    • bot.py β†’ Loads saved region and runs the bot.

πŸ› οΈ Requirements

Make sure you have Python installed (>=3.7).
Install dependencies:

pip install pyautogui pillow keyboard

πŸš€ Usage

Step 1: Select Game Region

Run the following to select your game window region:

python coordinates.py
  • The program will wait for 4 mouse clicks:

    1. Top-left corner
    2. Top-right corner
    3. Bottom-right corner
    4. Bottom-left corner
  • After 4 clicks, it will save the rectangle coordinates in coords.txt.

Example coords.txt:

392,171,698,694

Step 2: Run the Bot

Start the bot with:

python bot.py
  • The bot will load the saved region.
  • It will divide the area into 4 columns.
  • Continuously scans the bottom area of each column.
  • If a black tile is found, the bot clicks it.

Stop anytime by pressing Q.


βš™οΈ How It Works

  1. bot.py loads the region from coords.txt.
  2. Captures the region using Pillow (ImageGrab).
  3. Divides the region into 4 columns.
  4. Scans each column bottom β†’ upward for black pixels.
  5. If detected (r,g,b < 50), simulates a mouse click using pyautogui.

πŸ“‚ Project Structure

πŸ“ piano-tiles-bot
 ┣ πŸ“„ coordinates.py   # Save game window coordinates
 ┣ πŸ“„ bot.py           # Main bot logic
 ┣ πŸ“„ coords.txt       # Saved coordinates (auto-generated)
 ┣ πŸ“„ README.md        # Documentation

⚠️ Notes

  • Works best when the game window is clearly visible (not obstructed).
  • Accuracy depends on contrast (dark tiles vs background).
  • May require tuning the black detection threshold (r,g,b < 50) if your game looks different.

πŸ›‘ Safety

  • The bot clicks inside the selected region only.
  • Press Q anytime to stop safely.

🎯 Example

βœ… Game region loaded: (392,171,698,694)
πŸ€– Bot running... Press Q to stop

πŸ“œ License

This project is for educational purposes only.
Use responsibly and at your own risk.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages