A script to "SHUA" H1-2 map of Mercenaries mode of Hearthstone

Overview

lushi_script

Introduction

This script is to "SHUA" H1-2 map of Mercenaries mode of Hearthstone

Installation

Make sure you installed python>=3.6. To install python, we recommand Anaconda Make sure you added python path into your $PATH system environment/variables

Run the following in your commandline/terminal

pip install opencv-python numpy pyautogui pillow pywin32

Run

In your commandline/terminal, CD to this folder, run the following

python lushi.py 
Comments
  • 当随机奖励为召唤物时,下一次战斗选择技能会卡死

    当随机奖励为召唤物时,下一次战斗选择技能会卡死

    比如队伍里有晨拥或者吉安娜的时候,随机出的嘲讽冰墙奖励,会使场上有四个单位

    https://github.com/zhoubin-me/lushi_script/blob/2156e07327b67cec4c9b40192b648c1758c67622/lushi.py#L182 这一行估计要加一个blacklist image,防止选择类似的奖励。

    opened by cncndl 9
  • 运行错误

    运行错误

    C:\Users\Administrator\Desktop\lushi_script-main>python lushi.py --lang chs Traceback (most recent call last): File "C:\Users\Administrator\Desktop\lushi_script-main\lushi.py", line 11, in from util import find_lushi_window, find_icon_location, restart_game, set_top_window File "C:\Users\Administrator\Desktop\lushi_script-main\util.py", line 6, in import psutil ModuleNotFoundError: No module named 'psutil'

    opened by mmnmm2021 6
  • 在加载的时候出现以下代码,并且退出进程,请问怎么解决?

    在加载的时候出现以下代码,并且退出进程,请问怎么解决?

    Traceback (most recent call last): File "E:/炉石/lushi_script-main/lushi.py", line 309, in main() File "E:/炉石/lushi_script-main/lushi.py", line 304, in main agent.run() File "E:/炉石/lushi_script-main/lushi.py", line 144, in run states, rect = self.check_state() File "E:/炉石/lushi_script-main/lushi.py", line 255, in check_state lushi, image = find_lushi_window() File "E:/炉石/lushi_script-main/lushi.py", line 27, in find_lushi_window win32gui.SetWindowPos(hwnd, win32con.HWND_TOPMOST, 0,0,0,0, win32con.SWP_NOMOVE | win32con.SWP_NOSIZE) pywintypes.error: (5, 'SetWindowPos', '拒绝访问。')

    进程已结束,退出代码为 1

    opened by adf123 6
  • script works fine right until the combat starts. what to do?

    script works fine right until the combat starts. what to do?

    I installed python 3.7 and visual basic and did alll the things and got the latest script and all that. It even starts the game for me and goes into the fight. And then it doesn't try to do the combat and stay clicking on the bottom right doing nothing. I don't know why exactly tho so any help would be appreciated. thanks for the program btw it has been great saving my time and sanity. (It has been working on my laptop, but not on my desktop, same 1920x1080 resolution monitor and 1600x900 simplified chinese versions)

    opened by cachai 5
  • ModuleNotFoundError: No module named 'hearthstone'

    ModuleNotFoundError: No module named 'hearthstone'

    C:\Users\Administrator\Desktop\lushi_script-0.3.0>python lushi.py --lang chs Traceback (most recent call last): File "lushi.py", line 12, in from log_util.log_util import LogUtil File "C:\Users\Administrator\Desktop\lushi_script-0.3.0\log_util\log_util.py", line 1, in from hearthstone.enums import CardType, Zone, GameTag ModuleNotFoundError: No module named 'hearthstone'

    opened by ColinZYL 4
  • 改配置文件后出错

    改配置文件后出错

    用记事本编辑config.txt后运行会出现如下错误: C:\lushi>python lushi.py Traceback (most recent call last): File "lushi.py", line 292, in main() File "lushi.py", line 278, in main team_id, hero_cnt = [int(s.strip()) for s in team_id.strip().split(' ') if not s.startswith('#')] File "lushi.py", line 278, in team_id, hero_cnt = [int(s.strip()) for s in team_id.strip().split(' ') if not s.startswith('#')] ValueError: invalid literal for int() with base 10: '\ufeff2'

    编辑后的config.txt内容我也贴上来: 2 6 #出场队伍序号和队伍英雄数量,2为第三支队伍,6为队伍中有六个英雄 0 4 5 #出场英雄的序号,0为第一个,1为第二个 1 0 0 #英雄技能编号,0为第一个,1为第二个 1 1 1 #指向目标编号,-1为无指向性的随机或AOE,1为第二个目标 1 #再领取奖励后是否立即提前结束副本,0为继续打完,1为提前结束 0.8 #连续两个操作之间的延迟,跟网速有关,有时候太快会点不到就宕机了

    是保存格式的原因吗?试了ANSI、UTF-8、Unicode 都不行

    opened by BrianLx 4
  • 填完选项发现main函数初始化失败

    填完选项发现main函数初始化失败

    Traceback (most recent call last): File "c:\Users\Desktop\python\lushi_script-main\lushi.py", line 298, in main() File "c:\Users\Desktop\python\lushi_script-main\lushi.py", line 293, in main agent = Agent(team_id=team_id, heros_id=heros_id, skills_id=skills_id, targets_id=targets_id) File "c:\Users\Desktop\python\lushi_script-main\lushi.py", line 70, in init self.icons = Icons() File "c:\Users\Desktop\python\lushi_script-main\lushi.py", line 18, in init setattr(self, k, self.fname2img(v)) File "c:\Users\Desktop\python\lushi_script-main\lushi.py", line 22, in fname2img return cv2.cvtColor(cv2.imread(fname), cv2.COLOR_BGR2GRAY) cv2.error: OpenCV(4.5.4-dev) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

    opened by 519247893 4
Releases(v0.4.6)
  • v0.4.6(Jun 3, 2022)

    Note

    工作路径不能含有中文字符 The working path cannot contain non-ASCII 常规更新 Regular update 更新只需要将GitHub上代码下载下来进行替换,之后执行cn_update_requirements.bat即可。 To update, you only need to download and replace the code on GitHub, and then execute update_requirements.bat.


    What's Changed

    • 新英雄;max_dmg 战斗策略调整 by @littlewrite in https://github.com/zhoubin-me/lushi_script/pull/179
    • 新英雄加入,适应无2、3技能佣兵,不选择免疫、隐身佣兵。 by @littlewrite in https://github.com/zhoubin-me/lushi_script/pull/184
    • 英雄\宝藏 黑白名单;英文版素材更新 by @littlewrite in https://github.com/zhoubin-me/lushi_script/pull/185
    • 添加新英雄,调整截图策略 by @littlewrite in https://github.com/zhoubin-me/lushi_script/pull/191
    • 修复max_dmg会选择 隐身、免疫 佣兵问题 by @littlewrite in https://github.com/zhoubin-me/lushi_script/pull/193
      1. 新英雄。2. 图标更新。3 bug修复与优化 by @littlewrite in https://github.com/zhoubin-me/lushi_script/pull/194
    • 更改ui、后备队伍、参数保存等 by @lskyzero in https://github.com/zhoubin-me/lushi_script/pull/195
    • 修复add,按钮bug by @lskyzero in https://github.com/zhoubin-me/lushi_script/pull/196

    Full Changelog: https://github.com/zhoubin-me/lushi_script/compare/v0.4.5...v0.4.6

    Source code(tar.gz)
    Source code(zip)
    script_with_python37-0.4.6.7z(98.47 MB)
  • v0.4.5(Feb 28, 2022)

    What's Changed

    • 修复无旋涡的地图bug;尤朵拉炮台技能;支持抉择技能 by @littlewrite in https://github.com/zhoubin-me/lushi_script/pull/165
    • 添加新英雄,更新炉石包版本 by @littlewrite in https://github.com/zhoubin-me/lushi_script/pull/172
    • 新增英雄,修复bug by @littlewrite in https://github.com/zhoubin-me/lushi_script/pull/174
    • 优化战斗策略,抉择,休眠支持配置 by @littlewrite in https://github.com/zhoubin-me/lushi_script/pull/175
    • 坐标偏移修复。当任务栏位于屏幕非底部时,可修正按键坐标。 by @ioxv

    Note

    默认策略可以通过普通难度4-13。default configuration can be used to pass 4-13. 如果无法正常点击关卡,可尝试将空白坐标empty更新为travel的坐标值。If you cannot click the level normally, you can try to update the blank coordinate empty to the coordinate value of travel. 英语翻译尚未更新。 English translate may not update.

    Full Changelog: https://github.com/zhoubin-me/lushi_script/compare/v0.4.3...v0.4.5

    Source code(tar.gz)
    Source code(zip)
    script_with_python37-0.4.5.7z(88.33 MB)
  • v0.4.4-beta(Feb 5, 2022)

    What's Changed

    • 修复无旋涡的地图bug;尤朵拉炮台技能;支持抉择技能 by @littlewrite in https://github.com/zhoubin-me/lushi_script/pull/165
    • 添加新英雄,更新lu包版本 by @littlewrite in https://github.com/zhoubin-me/lushi_script/pull/172

    Note

    英文版本和翻译可能尚未更新。 English version and translation may not update.

    Full Changelog: https://github.com/zhoubin-me/lushi_script/compare/v0.4.3...v0.4.4

    Source code(tar.gz)
    Source code(zip)
    script_with_python37-0.4.4.7z(92.52 MB)
  • v0.4.3(Dec 19, 2021)

    修复了许多bug,默认的配置可以用来通过4-13,非常强大与智能,万分感谢@littlewrite Many bugs have been fixed and the default configuration can be used to pass 4-13. New version is very powerful and intelligent. Thank you so much @littlewrite

    What's Changed

    • 自动领宝藏调整,拼地图算法 by @littlewrite in https://github.com/zhoubin-me/lushi_script/pull/145
    • 指定 opencv 版本 by @littlewrite in https://github.com/zhoubin-me/lushi_script/pull/146
    • 添加opencv相关依赖 by @fulln in https://github.com/zhoubin-me/lushi_script/pull/148
    • feat:add hearth window functionality for macOS by @burning489 in https://github.com/zhoubin-me/lushi_script/pull/150
    • 路线直指神秘人;领任务前新增判断 by @littlewrite in https://github.com/zhoubin-me/lushi_script/pull/153
    • 更新素材, 移除opencv 版本依赖 by @littlewrite in https://github.com/zhoubin-me/lushi_script/pull/155
    • 修复地图寻找bug修复,win32api 修复,地图支持13上限 by @littlewrite in https://github.com/zhoubin-me/lushi_script/pull/156
    • 颜色克制;en英雄素材;宝藏黑名单优先级;1-13关卡坐标;boss策略 by @littlewrite in https://github.com/zhoubin-me/lushi_script/pull/159
    • fix check_and_screen return value when exception by @harryhare in https://github.com/zhoubin-me/lushi_script/pull/160
    • fix typo by @harryhare in https://github.com/zhoubin-me/lushi_script/pull/161
    • 修复boss关卡判断问题,调整默认配置 by @littlewrite in https://github.com/zhoubin-me/lushi_script/pull/162

    New Contributors

    • @fulln made their first contribution in https://github.com/zhoubin-me/lushi_script/pull/148
    • @burning489 made their first contribution in https://github.com/zhoubin-me/lushi_script/pull/150

    Full Changelog: https://github.com/zhoubin-me/lushi_script/compare/v0.4.2...v0.4.3

    Source code(tar.gz)
    Source code(zip)
    script_with_python37-0.4.3.zip(149.53 MB)
  • v0.4.2(Nov 20, 2021)

    写在前面(Write in Front)

    12月1日更新,请下载附件内hero_data.csv,替换到/resource路径下,即可添加新佣兵 final_reward.png和final_reward2.png替换到\resource\imgs_chs_1600x900\icons\下

    新版本必须要保存配置后运行才可保证不会出错 The new version must be run after saving the configuration to ensure that no errors occur 有问题请优先查看FAQ Please check the FAQ if you have any questions

    新的变动

    • 宝藏黑白名单,boss奖励截图统计,关卡奖励领取优化。 by @littlewrite in https://github.com/zhoubin-me/lushi_script/pull/138
    • 英文版支持自动提交任务 by @x014 in https://github.com/zhoubin-me/lushi_script/pull/141
    • 黑白名单重新加入,改进代码结构,各种优化 by @littlewrite in https://github.com/zhoubin-me/lushi_script/pull/143
    • bug修复,稳定性改进,增加多种截图选项,方便查询错误与白名单截图 by @Huangyan0804
    • ui改进 @ioxv
    • bug修复s by #blacksilvergeek

    What's changed

    • Treasure black and white list, boss reward screenshot stats, level reward collection optimization. by @littlewrite in https://github.com/zhoubin-me/lushi_script/pull/138
    • English version supports automatic quest submission by @x014 in https://github.com/zhoubin-me/lushi_script/pull/141
    • Black and white list re-added, improved code structure, various optimizations by @littlewrite in https://github.com/zhoubin-me/lushi_script/pull/143
    • Bug fixes, stability improvements, multiple screenshot options for error checking and whitelisting screenshots by @Huangyan0804
    • UI improvements by @ioxv
    • Bug fixes by @blacksilvergeek

    New Contributors

    • @littlewrite made their first contribution in https://github.com/zhoubin-me/lushi_script/pull/138
    • @x014 made their first contribution in https://github.com/zhoubin-me/lushi_script/pull/141
    • @Huangyan0804
    • @ioxv
    • @blacksilvergeek

    附件说明(Annex Notes)

    电脑没有python或者不愿意倒腾的情况下,优先选择下载script_with_python37(傻瓜版),解压运行"run.bat"即可

    如果不能正常运行可以下载source code通过自己电脑上的python运行

    If you don't have python on your computer, you can download script_with_python37, unzip it and run "run.bat".

    If it doesn't work, you can download the source code and run it with python on your computer.

    Full Changelog: https://github.com/zhoubin-me/lushi_script/compare/0.4.1...v0.4.2

    Source code(tar.gz)
    Source code(zip)
    FAQ_CN.html(40.06 KB)
    FAQ_CN.md(5.97 KB)
    final_reward.png(3.06 KB)
    final_reward2.png(2.94 KB)
    hero_data.csv(9.24 KB)
    script_with_python37-0.4.2.7z(94.51 MB)
  • 0.4.1(Nov 14, 2021)

    Update information

    1. Solve the memory leak problem
    2. Add automatic task submission function
    3. Add automatic screenshot function when an error is reported (under logs folder)
    4. Separate log and error files are provided
    5. Support search when selecting heroes
    6. Add 7,8,9 boss levels to the selection
    7. Press ctrl+Q to stop the script from running

    If you have questions, please check the FAQ first.

    Annex Notes

    If you don't have python on your computer, you can download script_with_python37, unzip it and run "run.bat".

    If it doesn't work, you can download the source code and run it with python on your computer.

    更新信息

    1. 解决了内存泄漏问题
    2. 增加了自动提交任务功能
    3. 增加了报错时自动截图功能(log文件夹下)
    4. 提供了单独的log和error文件
    5. 支持选择英雄时进行搜索
    6. 增加了7,8,9关的选择
    7. 按住ctrl+Q停止脚本运行

    有问题请优先查看FAQ

    附件说明

    电脑没有python的情况下,优先选择下载script_with_python37,解压运行"run.bat"即可

    如果不能正常运行可以下载source code通过自己电脑上的python运行

    Source code(tar.gz)
    Source code(zip)
    FAQ_CN.html(41.92 KB)
    FAQ_CN.md(5.64 KB)
    script_with_python37-0.4.1.7z(95.36 MB)
  • v0.4.0(Nov 5, 2021)

  • v0.3.0(Oct 30, 2021)

    • Thanks for the contribution from @Huangyan0804 with Power.log reading and battle AI function
    • Update Chinese Q&A Page, English version is ongoing, thanks for contribution from @dhnynu9xrf
    • Fix bugs of being stuck at spell selection
    • OpenCV based information reading for battle is abandoned
    Source code(tar.gz)
    Source code(zip)
  • v0.2.6.1(Oct 29, 2021)

  • v0.2.6(Oct 29, 2021)

    -修复了若干bug -加入了中控系统 -支持读取英雄血量,颜色,战斗更智能了 -但是识别不了带圣盾的英雄 -死英雄卡地图能自动投降了

    计划

    -加入地图识别功能,更好的寻路 -读取Power.log,获得更多信息

    Source code(tar.gz)
    Source code(zip)
  • v0.2.5(Oct 26, 2021)

    -Addded support for English Hearthstone, but can only run in 1024x768 resolution, convenient to run in virtual machine -中文用户暂时只能运行1600x900分辨率,但是我们更新了中文版的README和配置文件config_chs.yaml -英文版本对面偶数选不中目标的问题,请更改这里

    Next major update will support

    • Hearthstone process management
    • Smarter Battle Mode
    Source code(tar.gz)
    Source code(zip)
  • v0.2.4(Oct 26, 2021)

  • v0.2.3(Oct 25, 2021)

    Update

    • Fixed the bug when team number is 3, 4, 5
    • Fixed the bug that early stop not working

    Next Release Plan

    • Whitelist of Hero for collecting rewards
    • PVP mode support
    Source code(tar.gz)
    Source code(zip)
  • v0.2.2(Oct 24, 2021)

  • v0.2(Oct 24, 2021)

    • Fixed problem for boss selection
    • Support multi round battle skill choice
    • Use YAML for better configurations
    • Restructured for better coding reading
    Source code(tar.gz)
    Source code(zip)
Ejercicios Panda usando Pandas

Readme Below we add configuration details to locally test your application To co

1 Jan 22, 2022
HyperSpy is an open source Python library for the interactive analysis of multidimensional datasets

HyperSpy is an open source Python library for the interactive analysis of multidimensional datasets that can be described as multidimensional arrays o

HyperSpy 411 Dec 27, 2022
This repo is dedicated to the data extraction and manipulation of the World Bank's database called STEP.

Overview Welcome to the Step-X repository. This repo is dedicated to the data extraction and manipulation of the World Bank's database called STEP. Be

Keanu Pang 0 Jan 20, 2022
.npy, .npz, .mtx converter.

npy-converter Matrix Data Converter. Expand matrix for multi-thread, multi-process Divid matrix for multi-thread, multi-process Support: .mtx, .npy, .

taka 1 Feb 07, 2022
A 2-dimensional physics engine written in Cairo

A 2-dimensional physics engine written in Cairo

Topology 38 Nov 16, 2022
Flexible HDF5 saving/loading and other data science tools from the University of Chicago

deepdish Flexible HDF5 saving/loading and other data science tools from the University of Chicago. This repository also host a Deep Learning blog: htt

UChicago - Department of Computer Science 255 Dec 10, 2022
Visions provides an extensible suite of tools to support common data analysis operations

Visions And these visions of data types, they kept us up past the dawn. Visions provides an extensible suite of tools to support common data analysis

168 Dec 28, 2022
Weather Image Recognition - Python weather application using series of data

Weather Image Recognition - Python weather application using series of data

Kushal Shingote 1 Feb 04, 2022
Catalogue data - A Python Scripts to prepare catalogue data

catalogue_data Scripts to prepare catalogue data. Setup Clone this repo. Install

BigScience Workshop 3 Mar 03, 2022
Using Python to scrape some basic player information from www.premierleague.com and then use Pandas to analyse said data.

PremiershipPlayerAnalysis Using Python to scrape some basic player information from www.premierleague.com and then use Pandas to analyse said data. No

5 Sep 06, 2021
Active Learning demo using two small datasets

ActiveLearningDemo How to run step one put the dataset folder and use command below to split the dataset to the required structure run utils.py For ea

3 Nov 10, 2021
Techdegree Data Analysis Project 2

Basketball Team Stats Tool In this project you will be writing a program that reads from the "constants" data (PLAYERS and TEAMS) in constants.py. Thi

2 Oct 23, 2021
Extract Thailand COVID-19 Cluster data from daily briefing pdf.

Thailand COVID-19 Cluster Data Extraction About Extract Clusters from Thailand Daily COVID-19 briefing PDF Download latest data Here. Data will be upd

Noppakorn Jiravaranun 5 Sep 27, 2021
Stochastic Gradient Trees implementation in Python

Stochastic Gradient Trees - Python Stochastic Gradient Trees1 by Henry Gouk, Bernhard Pfahringer, and Eibe Frank implementation in Python. Based on th

John Koumentis 2 Nov 18, 2022
A script to "SHUA" H1-2 map of Mercenaries mode of Hearthstone

lushi_script Introduction This script is to "SHUA" H1-2 map of Mercenaries mode of Hearthstone Installation Make sure you installed python=3.6. To in

210 Jan 02, 2023
BigDL - Evaluate the performance of BigDL (Distributed Deep Learning on Apache Spark) in big data analysis problems

Evaluate the performance of BigDL (Distributed Deep Learning on Apache Spark) in big data analysis problems.

Vo Cong Thanh 1 Jan 06, 2022
Data processing with Pandas.

Processing-data-with-python This is a simple example showing how to use Pandas to create a dataframe and the processing data with python. The jupyter

1 Jan 23, 2022
Tools for analyzing data collected with a custom unity-based VR for insects.

unityvr Tools for analyzing data collected with a custom unity-based VR for insects. Organization: The unityvr package contains the following submodul

Hannah Haberkern 1 Dec 14, 2022
Sample code for Harry's Airflow online trainng course

Sample code for Harry's Airflow online trainng course You can find the videos on youtube or bilibili. I am working on adding below things: the slide p

102 Dec 30, 2022
Data Competition: automated systems that can detect whether people are not wearing masks or are wearing masks incorrectly

Table of contents Introduction Dataset Model & Metrics How to Run Quickstart Install Training Evaluation Detection DATA COMPETITION The COVID-19 pande

Thanh Dat Vu 1 Feb 27, 2022