A high-performance, intelligent automation suite for Whiteout Survival
Built with Python ยท OpenCV ยท PaddleOCR ยท FastAPI OCR Server ยท Real-time Screen Mirroring
How It Works โข Quick Start โข Features โข Structure โข Roadmap
๐ก Platform Note: High-speed streaming mode is optimized for Linux using
v4l2loopback. Windows users fall back to standard ADB screen capture with reduced performance.
โ ๏ธ Security Note: Never commitdb/account.jsonto version control. It contains sensitive credentials. Make sure it's listed in your.gitignore.
- How It Works
- Resolution Requirements
- Quick Start โ Linux
- Quick Start โ Windows
- Task Scheduling
- Features
- Project Structure
- Configuration
- Security
- Troubleshooting
- Platform Support
- Roadmap
- Contributing
- Changelog
- Disclaimer
The bot operates on a Research โ Strategy โ Execution loop:
-
Vision Engine ๐๏ธ Instead of simple coordinate clicking, the bot "sees" the game using a hybrid approach of PaddleOCR (for reading text) and OpenCV Template Matching (for identifying icons).
-
Fuzzy Logic ๐ฏ Uses
rapidfuzzto handle OCR misreads (e.g., reading'0'as'O'), ensuring actions don't fail due to tiny text variations. -
Local OCR Server โก A dedicated FastAPI server handles heavy lifting for image processing, keeping the main bot logic lightweight and fast.
-
FSM Navigation ๐บ๏ธ (In Development) A navigation graph that calculates the shortest path between game screens (e.g., jumping from "World Map" directly to "Alliance Tech").
๐ด CRITICAL: This bot is hardcoded for 1080ร2460 resolution.
If your device uses a different resolution:
- โ ROI detection will fail
- โ Clicks will land in incorrect locations
- โ The bot may perform unintended actions
Verify your device resolution:
adb shell wm sizeAn Auto-Calibration Suite is under development. In a future release, the bot will:
- โ Auto-detect your device resolution on first run
- โ Execute a guided "World Tour" of all game screens
- โ
Dynamically generate resolution-specific coordinates in
references/TextArea/
Status: Coming soon
- Android device or emulator with Whiteout Survival installed
- Arch Linux system (or equivalent distro with
pacman) - ADB debugging enabled on your Android device
- USB cable (if using a physical device)
- Python 3.10+
sudo pacman -Syu scrcpy v4l2loopback-dkms v4l2loopback-utils android-tools uv| Package | Purpose |
|---|---|
scrcpy |
High-speed screen mirroring |
v4l2loopback |
Virtual video device driver |
uv |
Fast Python package manager |
android-tools |
ADB utilities |
Enable the virtual video device for high-speed OCR streaming:
sudo modprobe v4l2loopback video_nr=10 card_label="scrcpy" exclusive_caps=1๐ก Tip: To auto-load on every boot, add the following to
/etc/modules-load.d/v4l2loopback.conf:v4l2loopbackAnd create
/etc/modprobe.d/v4l2loopback.confwith:options v4l2loopback video_nr=10 card_label="scrcpy" exclusive_caps=1
cd ~/wos
uv venv # Create virtual environment
uv sync # Install all dependencies from pyproject.tomlOpen a dedicated terminal and run:
cd ~/wos
uv run core/ocr.pyThis launches the FastAPI OCR server at http://localhost:8000. Keep this terminal open.
cp db/account.json.example db/account.jsonEdit db/account.json with your actual credentials:
{
"your_email@gmail.com": {
"priority": 1,
"player": [
{
"id": "12345678",
"name": "Your Chief Name"
}
]
}
}| Field | Description |
|---|---|
priority |
Processing order โ lower number runs first |
id |
Player ID found in-game via Chief Profile (top-left corner) |
name |
Character name used for account switching |
โ ๏ธ Important: Adddb/account.jsonto your.gitignoreimmediately. See Security.
In a separate terminal:
cd ~/wos
python Main/main.pyThe bot will:
- โ Auto-detect your device via ADB
- โ Launch Whiteout Survival if not already running
- โ Initialize your player profile
- โ Open the interactive task selection menu
- โ Begin running selected daily tasks
Note: Windows support is limited. High-speed V4L2 streaming is not natively available. ADB-only mode is slower but functional.
- Python 3.10+ installed from python.org
- ADB installed โ download Android Platform Tools
- USB debugging enabled on your Android device
pip install uv
cd wos
uv venv
uv sync# Add platform-tools folder to your system PATH, then verify:
adb versionuv run core/ocr.pyFollow the same steps as Linux โ Step 5 and Step 6 above.
Performance note: Without V4L2 streaming, screen capture uses ADB screencap which is significantly slower. For best results, use Linux or WSL2.
Task scheduling uses an interactive selector at startup.
When you run python Main/main.py, the bot opens a menu from Main/task_menu.py. You can select tasks by:
| Input Method | Example |
|---|---|
| Number | 1,3,6 |
| Task key | vip,mail,heal |
| Task title | VIP Rewards, Mail Rewards |
Press Enter (or type all / default / *) to run the full default task list.
| # | Task |
|---|---|
| 1 | VIP Rewards |
| 2 | Exploration Idle Income |
| 3 | Continue Exploring |
| 4 | Mail Rewards |
| 5 | Life Essence |
| 6 | Train Troops |
| 7 | Arena |
| 8 | Chief Order |
| 9 | Ally Treasure |
| 10 | Pet Exploration |
| 11 | Labyrinth |
| 12 | Alliance Auto Join |
| 13 | Alliance Chests |
| 14 | Alliance Tech |
| 15 | Alliance Help |
| 16 | Alliance Triumph |
| 17 | Heal |
| 18 | World Gather |
| 19 | Missions Reward |
Notes:
- Tasks run in the exact order shown unless you provide a custom subset.
- Invalid selections are rejected and the menu is re-shown.
- Completion is tracked per player in
db/completion_log.txt.- Players completed within the 3-hour skip window are automatically skipped.
- Gathering โ Intelligent resource search (Meat/Wood/Coal/Iron) with troop equalization and recall logic
- Healing โ Auto-heal wounded troops with optimal item usage
- Tech Contribution โ Contribute to tech trees automatically
- Help Members โ Provide help to alliance members in need
- Chests โ Collect alliance chests on cooldown
- Rallies โ Auto-join war rallies and contribute
- Triumph Collection โ Harvest alliance triumph rewards
- Arena Battles โ Daily automated arena fights
- Labyrinth Runs โ Complete labyrinth dungeons
- Intel Missions โ Auto-complete Beast hunts, Survivor rescues, Exploration intel
- Troop Training โ Auto-train Infantry, Lancers, and Marksmen
- Pet Exploration โ Auto-start pet expeditions and claim rewards
- Chief Order โ Activate and track chief order progression
- VIP Rewards โ Collect daily VIP bonuses and auto-buy VIP time when profitable
- Mail โ Auto-collect all mail rewards
- Missions โ Collect mission rewards
- Life Essence โ Harvest life essence drops
- Events โ Collect event-specific rewards
wos/
โโโ Main/
โ โโโ main.py # Entry point, account loop, and task execution
โ โโโ task_menu.py # Interactive task selection and task registry
โโโ core/
โ โโโ ocr.py # FastAPI OCR server
โ โโโ core.py # Vision engine (template matching, OCR)
โ โโโ change_player.py # Account/character switching
โ โโโ recalibrate.py # Auto-calibration tools
โ โโโ backup/ # Legacy versions
โโโ cmd_program/
โ โโโ screen_action.py # ADB touch/swipe actions
โ โโโ screen_stream.py # scrcpy streaming setup
โ โโโ scrcpy_config.json # Stream configuration
โโโ usecases/ # Feature modules
โ โโโ gather.py # Resource gathering
โ โโโ alliance.py # Alliance tasks
โ โโโ arena.py # Arena battles
โ โโโ exploration.py # Exploration intel
โ โโโ labyrinth.py # Labyrinth runs
โ โโโ pet.py # Pet mechanics
โ โโโ [other features].py
โโโ db/
โ โโโ account.json # โ ๏ธ Account/player config โ NEVER commit this
โ โโโ account.json.example # Safe template โ commit this
โ โโโ completion_log.txt # Daily task completion tracking
โ โโโ players/ # Per-player data
โโโ references/
โ โโโ icon/ # PNG templates for icon matching
โ โ โโโ alliance/
โ โ โโโ arena/
โ โ โโโ [other categories]/
โ โโโ TextArea/ # JSON ROI definitions
โ โโโ Home.json
โ โโโ Home.Alliance.json
โ โโโ [all screen definitions].json
โโโ test/ # Debug & testing utilities
The main configuration file for accounts and players. Located at db/account.json.
{
"email@example.com": {
"priority": 1,
"player": [
{
"id": "12345678",
"name": "ChiefName"
}
]
},
"second_account@example.com": {
"priority": 2,
"player": [
{
"id": "87654321",
"name": "AnotherChief"
}
]
}
}Multiple accounts are supported. Set priority values to control execution order.
Controls the screen mirroring stream. Located at cmd_program/scrcpy_config.json. Adjust bitrate, resolution, and device serial here if needed.
Your db/account.json contains sensitive account credentials. Protect it.
Make sure your .gitignore includes:
db/account.json
db/players/
db/completion_log.txtNever share your account.json publicly or commit it to any repository. Use db/account.json.example as a safe template for sharing.
| Feature | Linux | Windows |
|---|---|---|
| ADB Support | โ | โ |
| Standard Screencap | โ | โ |
| High-Speed Scrcpy Stream | โ Native | โ Requires WSL2 + v4l2 |
| V4L2 Direct Streaming | โ Native | โ Not Available |
| Performance | ๐ Ultra Fast | ๐ข Standard |
| Setup Complexity | โญ Straightforward | โญโญ Extra steps needed |
Recommended: Linux (full native support) Fallback: Windows with ADB only (slower but functional)
Error: ModuleNotFoundError or port already in use
# Check if port 8000 is occupied
lsof -i :8000
# Kill the existing process
kill -9 <PID>
# Reinstall dependencies and retry
cd ~/wos
uv sync
uv run core/ocr.pyCause: Resolution mismatch โ bot is hardcoded for 1080ร2460
# Verify your device resolution
adb shell wm size
# Expected output:
# Physical size: 1080x2460If your resolution differs, the Auto-Calibration Suite is in development. In the meantime, manually update ROI coordinates in references/TextArea/ (advanced).
# Restart ADB daemon
adb kill-server
adb start-server
# List connected devices
adb devices
# If device shows as unauthorized, re-accept the prompt on your device# Check if the module is loaded
lsmod | grep v4l2loopback
# Reinstall and reload if missing
sudo dkms remove v4l2loopback/0.12.7 --all
sudo pacman -S v4l2loopback-dkms
sudo modprobe -r v4l2loopback
sudo modprobe v4l2loopback video_nr=10 card_label="scrcpy" exclusive_caps=1PaddleOCR requires Python 3.10+. Verify your version:
python --version
# Should be 3.10 or higherIf using uv, ensure your venv uses the right Python:
uv venv --python 3.10
uv sync- โ Core daily task automation
- โ Multi-account support
- โ Interactive task selector
- โณ Auto-calibration suite
- โณ Windows setup guide
- ๐ Advanced FSM navigation (Dijkstra-based pathfinding)
- ๐ Event-specific strategies (Tundra Adventure, Sunfire Castle)
- ๐ Enhanced anti-detection (human-like click patterns)
- ๐ฎ Multi-device simultaneous control
- ๐ฎ Web dashboard for monitoring
- ๐ฎ Community script marketplace
Core Requirements:
- Python 3.10+
- OpenCV (
cv2) - PaddleOCR
- FastAPI & Uvicorn
- RapidFuzz
- Requests
- Rich (CLI output)
See pyproject.toml for the full pinned dependency list.
Contributions are welcome! Here's how to get started:
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes and test thoroughly
- Submit a Pull Request with a clear description of what you changed and why
- Follow PEP 8 style guidelines
- Add docstrings to all new functions
- Test with multiple accounts where applicable
- Document any new game screen modules in
references/TextArea/ - Never commit
db/account.json
- Added interactive task selector (
Main/task_menu.py) - Added per-player completion tracking with 3-hour skip window
- Added multi-account priority ordering
- Improved OCR fuzzy matching accuracy
- Core daily task automation
- FastAPI OCR server
- ADB screen capture and touch actions
- Linux V4L2 high-speed streaming support
- Multi-account support
This project is released under the MIT License. See the LICENSE file for details.
Use this bot at your own risk.
This project is for educational purposes only. Using automation tools may violate the Terms of Service of Whiteout Survival. The authors are not responsible for:
- Account suspension or bans
- In-game penalties
- Loss of progress or items
- Any violation of game terms
Always read the game's ToS before using automation tools.
- Bugs: Open an issue via GitHub Issues
- Ideas: Start a thread in GitHub Discussions
- Docs: Check the wiki for advanced topics
Made with โ๏ธ by the WOS Bot community
โญ Star this repo if you find it useful!