CWU7 - Can't Wake Up at 7am
A Python automation script for reserving badminton courts at precisely 7:00 AM. This bot navigates through the reservation interface, handles CAPTCHA challenges, and logs the entire process.
Features
- Precise Timing: Waits until exactly 7:00 AM to start the reservation process
- Automated Navigation: Clicks through the reservation interface automatically
- CAPTCHA Solving: Uses OCR to recognize and solve CAPTCHA challenges
- Retry Logic: Automatically retries on failure with configurable attempts
- Comprehensive Logging: Logs all actions and errors to file and console
- Mouse Tracking Utility: Includes a helper tool for finding UI coordinates
Requirements
-
Python 3.6+
-
Windows operating system
-
Required Python packages:
pyautogui ddddocr numpy Pillow
Installation
-
Clone this repository:
git clone https://github.com/xixu-me/CWU7.git cd CWU7 -
Install required dependencies:
pip install pyautogui ddddocr numpy Pillow
Usage
Running the Reservation Bot
-
Configure the reservation time and coordinates in
run.pyif needed -
Run the main script:
python run.py
The bot will wait until 7:00 AM and then automatically attempt to reserve a badminton court.
Mouse Position Tracker
Use the tracker utility to find coordinates for UI elements:
python tracker.py
This will display the current mouse position and pixel color in real-time. Press Ctrl+C to exit.
Configuration
Time Settings
Modify these constants in run.py to change the reservation time:
RESERVATION_HOUR = 7 # Target hour (24-hour format)
RESERVATION_MINUTE = 0 # Target minute
Coordinates
The COORDINATES dictionary in run.py contains all click positions. Use tracker.py to find the correct coordinates for your screen resolution and interface.
Retry Settings
MAX_RETRY_ATTEMPTS = 100 # Maximum retry attempts
How It Works
- Wait for Target Time: The script waits until the configured reservation time
- Open Mini-Program: Clicks on the reservation interface
- Navigate Interface: Automatically clicks through the reservation steps
- Handle CAPTCHA: Uses OCR to solve any CAPTCHA challenges
- Retry on Failure: Automatically retries if any step fails
- Log Results: Records all actions and results
File Structure
run.py- Main reservation bot scripttracker.py- Mouse position tracking utilityLICENSE- GNU GPL v3 license.gitignore- Git ignore filereservation.log- Generated log file (created during execution)
Troubleshooting
Common Issues
- Wrong Coordinates: Use
tracker.pyto find the correct click positions - CAPTCHA Failures: The OCR may need adjustment for different CAPTCHA styles
- Timing Issues: Adjust the
check_intervalin pixel checking functions - Screen Resolution: Coordinates may need adjustment for different screen sizes
Logs
Check reservation.log for detailed execution logs and error messages.
Legal Notice
This software is provided for educational purposes only. Users are responsible for compliance with the terms of service of the reservation system. The authors are not responsible for any misuse or violations.
License
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
Contributing
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
Disclaimer
This is an automation tool designed to help with legitimate reservations. Please use responsibly and in accordance with the reservation system's terms of service.