Skip to content

ayushh8/ChessBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chess.com Bot

An automated chess bot that can play against Chess.com's computer opponent using Stockfish engine for move calculations. The bot features a user-friendly GUI interface and can automatically make moves on Chess.com.

Features

  • 🤖 Automated chess gameplay against Chess.com's computer opponent
  • 🧠 Powered by Stockfish chess engine for strong move calculations
  • 🖥️ User-friendly GUI interface for easy control
  • 🔄 Real-time move detection and response
  • 🎮 Support for both manual and automatic play modes
  • 📊 Move history tracking and display

Tech Stack

  • Python 3.x
  • Libraries:
    • python-chess: Chess move generation and validation
    • stockfish: Integration with Stockfish chess engine
    • selenium: Web automation for Chess.com interaction
    • tkinter: GUI interface
    • threading: Concurrent operations handling

Prerequisites

  1. Python 3.x installed on your system
  2. Stockfish chess engine (Windows x86-64 AVX2 version)
  3. Chrome WebDriver compatible with your Chrome browser version

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/chess-bot.git
cd chess-bot
  1. Create and activate a virtual environment (recommended):
python -m venv .venv
# On Windows
.venv\Scripts\activate
# On Unix/MacOS
source .venv/bin/activate
  1. Install required packages:
pip install -r req.txt
  1. Download and set up Stockfish:

    • Download Stockfish for Windows x86-64 AVX2 from the official website
    • Place the executable in your preferred location
    • Update the stockfish_path in bot_gui.py with your Stockfish path
  2. Download and set up ChromeDriver:

    • Download ChromeDriver compatible with your Chrome version
    • Place the executable in your preferred location
    • Update the chromedriver_path in bot_gui.py with your ChromeDriver path

Usage

  1. Run the GUI application:
python bot_gui.py
  1. Using the GUI:
    • Click "Open Chess.com" to launch Chess.com in your browser
    • Navigate to the computer play section on Chess.com
    • Click "Start Auto Play" to begin automated gameplay
    • Use "Stop Auto Play" to pause the bot
    • The current best move will be displayed in the GUI

Project Structure

  • chess_bot.py: Core bot functionality and Chess.com interaction
  • bot_gui.py: GUI interface and user controls
  • req.txt: Project dependencies
  • README.md: Project documentation

Features in Detail

Chess Bot Core (chess_bot.py)

  • Move detection and validation
  • Stockfish integration for move calculation
  • Chess.com board interaction
  • Move execution automation

GUI Interface (bot_gui.py)

  • Simple and intuitive controls
  • Real-time move display
  • Thread management for concurrent operations
  • Auto-play controls

Contributing

Feel free to submit issues and enhancement requests!

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Stockfish chess engine
  • Chess.com for providing the platform
  • Python-chess library
  • Selenium WebDriver

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages