Updated README files to reflect the modular design of the toolkit and provide detailed descriptions for each tool. Refactored file structure by moving scripts to the 'tools/' directory for better organization.
CWU7 - Can't Wake Up at 7am
A modular Python automation toolkit featuring multiple independent tools for various automation and development tasks. The toolkit is designed with equal-status tools that can be used individually or together, with easy expansion capabilities for new automation tools.
🚀 Toolkit Overview
CWU7 consists of multiple standalone tools, each serving a specific automation purpose:
🏸 Court Reservation Tool (tools/court_reservation.py)
An automated badminton court reservation system with intelligent timing and error handling:
- ⏰ 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 technology 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 Position Tracker (mouse_tracker.py)
A development utility for UI automation coordinate discovery:
- 📍 Real-time Coordinates: Displays live mouse position and pixel color information
- 🖱️ Developer-Friendly: Essential for determining click coordinates for automation scripts
- ⚡ Low Latency: Configurable refresh rate for optimal performance
- 🎨 Color Detection: Shows RGB values for precise color-based automation
💬 Copilot Resumption Tool (tools/copilot_resumption.py)
An intelligent session management tool for automated development assistance:
- 👁️ Screen Monitoring: Watches specific screen regions for color changes
- 🤖 Auto-Response: Automatically inputs text when interaction is needed
- 🔄 Session Continuity: Helps maintain active Copilot sessions without manual intervention
- 📊 Activity Logging: Tracks all monitoring and response activities
📋 Requirements
- Python 3.6+
- Windows OS
- Python packages:
- pyautogui
- ddddocr
- numpy
- Pillow
🛠️ Installation
# Clone the repository
git clone https://github.com/xixu-me/CWU7.git
cd CWU7
# Install dependencies
pip install pyautogui ddddocr numpy Pillow
📖 Tool Usage
Each tool in the CWU7 toolkit can be used independently. Choose the tool that fits your current automation needs:
🏸 Court Reservation Tool
Automate badminton court reservations at precise timing:
-
Configure reservation settings in
tools/court_reservation.pyif needed -
Run the tool:
python tools/court_reservation.py
The tool will wait until the configured time and automatically handle the entire reservation process.
🎯 Mouse Position Tracker
Discover UI coordinates for automation scripts:
python tools/mouse_tracker.py
The tracker displays real-time mouse position and pixel color information. Press Ctrl+C to exit when you've found the coordinates you need.
💬 Copilot Resumption Tool
Automatically maintain active Copilot sessions:
python tools/copilot_resumption.py
The tool monitors screen regions and automatically responds to interaction prompts to keep Copilot sessions active.
⚙️ Tool Configuration
Each tool has its own configuration options. Refer to the specific tool's documentation within its source file:
Court Reservation Tool
- Timing: Edit
RESERVATION_HOURandRESERVATION_MINUTEintools/court_reservation.py - UI Coordinates: Update the
COORDINATESdictionary using coordinates found with the tracker tool - Retry Settings: Configure
MAX_RETRY_ATTEMPTSfor error handling
Mouse Position Tracker
- Refresh Rate: Modify the
refresh_rateparameter for update frequency - Display Format: Customize output format in the tracker function
Copilot Resumption Tool
- Monitor Region: Set the screen coordinates for color monitoring
- Target Colors: Configure the RGB values to detect interaction needs
- Response Text: Customize the automated input text
🔧 How It Works
The toolkit employs different automation strategies for each tool:
Court Reservation Workflow
- Waits for the target time
- Opens the reservation interface
- Navigates steps automatically
- Handles CAPTCHA with OCR
- Retries on failure
- Logs all actions and results
Mouse Tracker Operation
- Captures mouse position continuously
- Reads pixel color at cursor location
- Displays formatted coordinate and color data
- Updates at configurable intervals
Copilot Resumption Process
- Monitors specified screen region
- Detects color changes indicating interaction needs
- Automatically inputs configured response text
- Logs all monitoring activities
🔧 Troubleshooting
General Issues
- Python Dependencies: Ensure all required packages are installed via pip
- Screen Resolution: Update coordinates for your specific display configuration
- Permission Issues: Run with appropriate privileges if automation is blocked
Tool-Specific Issues
Court Reservation Tool
- Wrong Coordinates: Use
mouse_tracker.pyto find correct UI element positions - CAPTCHA Failures: OCR may need adjustment for different CAPTCHA styles
- Timing Issues: Adjust
check_intervalin the tool configuration
Mouse Position Tracker
- High CPU Usage: Increase refresh rate interval for lower resource consumption
- Coordinate Accuracy: Ensure display scaling is considered in measurements
Copilot Resumption Tool
- Color Detection: Verify RGB values match the actual screen colors
- Response Timing: Adjust monitoring intervals for better responsiveness
For detailed logs, check the respective log files: reservation.log and copilot_resumption.log.
🚀 Extending the Toolkit
CWU7 is designed for easy expansion. To add new automation tools:
Adding New Tools
- Create Tool File: Add your new tool to the
tools/directory - Follow Structure: Use existing tools as templates for logging and configuration
- Update Documentation: Add tool description to both README files
- Test Integration: Ensure the tool works independently and with others
Development Guidelines
- Modular Design: Each tool should be self-contained and independently executable
- Consistent Logging: Use the established logging format for consistency
- Configuration: Make settings easily configurable for different use cases
- Error Handling: Implement robust error handling and retry mechanisms
⚖️ Legal Notice
This software is for educational purposes only. Users are responsible for compliance with the terms of service of any systems they interact with. The authors are not responsible for misuse or any consequences of using this toolkit.
📄 License
GNU General Public License v3.0 - see LICENSE.
🤝 Contributing
We welcome contributions to expand the CWU7 toolkit:
- Fork the repository
- Create a feature branch (
git checkout -b feature/new-tool) - Commit your changes with clear messages
- Push to your branch (
git push origin feature/new-tool) - Create a Pull Request with detailed description
Contribution Guidelines
- Follow the existing code style and structure
- Add comprehensive documentation for new tools
- Include error handling and logging
- Test thoroughly on Windows environments
- Update both English and Chinese README files
⚠️ Disclaimer
This toolkit is designed for legitimate automation purposes only. Users must:
- Respect terms of service of target systems
- Use tools responsibly and ethically
- Comply with applicable laws and regulations
- Take full responsibility for their usage
The authors assume no liability for misuse or any consequences arising from the use of this toolkit.