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.
- 🤖 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
- Python 3.x
- Libraries:
python-chess: Chess move generation and validationstockfish: Integration with Stockfish chess engineselenium: Web automation for Chess.com interactiontkinter: GUI interfacethreading: Concurrent operations handling
- Python 3.x installed on your system
- Stockfish chess engine (Windows x86-64 AVX2 version)
- Chrome WebDriver compatible with your Chrome browser version
- Clone the repository:
git clone https://github.com/yourusername/chess-bot.git
cd chess-bot- Create and activate a virtual environment (recommended):
python -m venv .venv
# On Windows
.venv\Scripts\activate
# On Unix/MacOS
source .venv/bin/activate- Install required packages:
pip install -r req.txt-
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_pathinbot_gui.pywith your Stockfish path
-
Download and set up ChromeDriver:
- Download ChromeDriver compatible with your Chrome version
- Place the executable in your preferred location
- Update the
chromedriver_pathinbot_gui.pywith your ChromeDriver path
- Run the GUI application:
python bot_gui.py- 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
chess_bot.py: Core bot functionality and Chess.com interactionbot_gui.py: GUI interface and user controlsreq.txt: Project dependenciesREADME.md: Project documentation
- Move detection and validation
- Stockfish integration for move calculation
- Chess.com board interaction
- Move execution automation
- Simple and intuitive controls
- Real-time move display
- Thread management for concurrent operations
- Auto-play controls
Feel free to submit issues and enhancement requests!
This project is licensed under the MIT License - see the LICENSE file for details.
- Stockfish chess engine
- Chess.com for providing the platform
- Python-chess library
- Selenium WebDriver