WoWsBot is a modular automation script for the online game World of Warships. It uses template matching, OCR, and YOLO models to recognize game states (e.g., in port, in battle) and automatically performs actions like entering battle or managing combat scenarios.
This project is designed with a clear, component-based architecture for easy customization and extension.
⚠️ Disclaimer: This bot is for educational and research purposes only. Using automation software in online games may violate the game's Terms of Service and can result in account suspension. Use at your own risk.
- Hotkey Control: Start/stop with
F10/F11. - Window Management: Automatically sets the game window to borderless mode at a specified resolution.
- Advanced State Detection: Uses image template matching, OCR, and YOLO models to identify game UI elements and game states.
- Modular Design: Separates logic into
MainController,HotkeyManager,AreaLocator,Bot, and other modules. - Configurable: All templates, areas, and thresholds are defined in
config.json. - Scheduled Tasks: Support for scheduling automated tasks during specific time periods.
- GUI Interface: User-friendly graphical interface for monitoring and configuration.
- Gameplay Automation: Supports both port operations and in-battle behaviors.
- Python 3.12 or higher
- Windows operating system (due to Windows-specific libraries)
- World of Warships installed and configured
- Clone the repository:
git clone https://github.com/yourusername/wowsbot.git
cd wowsbot- Install dependencies:
pip install -e .-
Configure the bot by modifying
resources/config.jsonandresources/user.json. -
Prepare template images and region settings according to your game resolution.
- Ensure World of Warships is installed and can run on your system.
- Configure the game to run in windowed mode with a fixed resolution.
- Update the
regionand template images in theresources/folder to match your setup. - Run the script:
python main.py- Press
F10to start andF11to stop the automation.
main.py: Entry point of the applicationsrc/HkMgr.py: Hotkey managementsrc/MCtrl.py: Main controller coordinating different modulessrc/ArLctr.py: Area locator for identifying screen regionssrc/Bot.py: Bot behaviors for in-port and in-battle actionssrc/GUI.py: Graphical user interfacesrc/WinMgr.py: Window management utilitiesresources/config.json: Configuration file for detection areas and parametersresources/user.json: User preferences and scheduled tasks
This project is licensed under the GNU General Public License v3.0 (GPL-3.0). See the LICENSE file for details.
WoWsBot 是一款为网络游戏《战舰世界》设计的模块化自动化脚本。它通过模板匹配、OCR技术和YOLO模型识别游戏状态(例如:在港口、在战斗中),并自动执行诸如进入战斗等操作。
本项目采用清晰的组件化架构,便于自定义和扩展。
⚠️ 免责声明:本工具仅用于学习和研究目的。在在线游戏中使用自动化软件可能违反游戏服务条款,并导致账号被封禁。使用风险自负。
- 热键控制:按
F10启动,F11暂停。 - 窗口管理:自动将游戏窗口设置为无边框模式,并调整至指定分辨率。
- 高级状态识别:通过图像模板匹配、OCR和YOLO模型识别游戏内的UI元素和游戏状态。
- 模块化设计:逻辑分离,包含
MainController、HotkeyManager、AreaLocator、Bot等模块。 - 高度可配置:所有模板、区域和阈值均在
config.json文件中定义。 - 定时任务:支持在特定时间段内执行自动化任务。
- 图形界面:友好的用户界面用于监控和配置。
- 游戏自动化:支持港口操作和战斗内行为。
- Python 3.12 或更高版本
- Windows 操作系统(由于使用了Windows特定的库)
- 已安装并配置好的战舰世界游戏
- 克隆代码仓库:
git clone https://github.com/yourusername/wowsbot.git
cd wowsbot- 安装依赖:
pip install -e .-
通过修改
resources/config.json和resources/user.json来配置机器人。 -
根据您的游戏分辨率准备模板图像和区域设置。
- 确保战舰世界已安装且能在您的系统上正常运行。
- 将游戏配置为固定分辨率的窗口模式。
- 根据你的屏幕设置,更新
resources/文件夹中的region参数和模板图片。 - 运行脚本:
python main.py- 按下
F10键来启动,按下F11键来暂停自动化。
main.py: 应用程序入口点src/HkMgr.py: 热键管理src/MCtrl.py: 主控制器,协调各个模块src/ArLctr.py: 区域定位器,用于识别屏幕区域src/Bot.py: 机器人行为,包括港口和战斗中的操作src/GUI.py: 图形用户界面src/WinMgr.py: 窗口管理工具resources/config.json: 检测区域和参数的配置文件resources/user.json: 用户偏好设置和定时任务
本项目采用 GNU General Public License v3.0 (GPL-3.0) 开源许可证。详情请见 LICENSE 文件。
