This script automates the process of entering secret unlock codes in Zwift by simulating keyboard inputs. It reads codes from a text file (codes.txt
), opens the code entry window in Zwift, types each code, and submits it.
Inspired by https://github.com/pete911/zwift-jersey
- Reads unlock codes from a text file, where each line contains one code.
- Simulates the keyboard presses required to enter the codes in Zwift.
- Includes timing adjustments to ensure smooth operation.
- Python 3.6 or higher
pyautogui
git clone https://github.com/mwikala/zwiftunlocks.git
cd zwiftunlocks
Make sure you have Python 3 installed. Then, install the required library:
pip install pyautogui
Switch to the Zwift application and make sure it is in focus. Then, run the script:
python zwift_code_entry.py
The script will:
- Simulate pressing
P
to open the unlock code window. - Enter each code from the
codes.txt
file. - Press
Enter
to submit the code. - Wait briefly before moving to the next code.
- Ensure Zwift is in focus when running the script, as
pyautogui
sends keyboard inputs to the active window. - Adjust the delay times in the script if Zwift requires more time to process inputs.
- If the
codes.txt
file is missing or empty, the script will notify you and exit.
- "Error: The file 'codes.txt' was not found."
- Ensure the
codes.txt
file exists in the same directory as the script and contains valid codes.
- Ensure the
- The script types codes too fast.
- Increase the delay times in the
time.sleep()
calls within the script.
- Increase the delay times in the
- Keyboard input doesn't work.
- Verify Zwift is the active window before starting the script.
This project is licensed under the MIT License. See the LICENSE
file for details.