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)
Renato 214 Jan 02, 2023
Data pipelines built with polars

valves Warning: the project is very much work in progress. Valves is a collection of functions for your data .pipe()-lines. This project aimes to host

14 Jan 03, 2023
This cosmetics generator allows you to generate the new Fortnite cosmetics, Search pak and search cosmetics!

COSMETICS GENERATOR This cosmetics generator allows you to generate the new Fortnite cosmetics, Search pak and search cosmetics! Remember to put the l

ᴅᴊʟᴏʀ3xᴢᴏ 11 Dec 13, 2022
CRISP: Critical Path Analysis of Microservice Traces

CRISP: Critical Path Analysis of Microservice Traces This repo contains code to compute and present critical path summary from Jaeger microservice tra

Uber Research 110 Jan 06, 2023
Analysiscsv.py for extracting analysis and exporting as CSV

wcc_analysis Lichess page documentation: https://lichess.org/page/world-championships Each WCC has a study, studies are fetched using: https://lichess

32 Apr 25, 2022
Functional tensors for probabilistic programming

Funsor Funsor is a tensor-like library for functions and distributions. See Functional tensors for probabilistic programming for a system description.

208 Dec 29, 2022
DaCe is a parallel programming framework that takes code in Python/NumPy and other programming languages

aCe - Data-Centric Parallel Programming Decoupling domain science from performance optimization. DaCe is a parallel programming framework that takes c

SPCL 330 Dec 30, 2022
Fitting thermodynamic models with pycalphad

ESPEI ESPEI, or Extensible Self-optimizing Phase Equilibria Infrastructure, is a tool for thermodynamic database development within the CALPHAD method

Phases Research Lab 42 Sep 12, 2022
PyTorch implementation for NCL (Neighborhood-enrighed Contrastive Learning)

NCL (Neighborhood-enrighed Contrastive Learning) This is the official PyTorch implementation for the paper: Zihan Lin*, Changxin Tian*, Yupeng Hou* Wa

RUCAIBox 73 Jan 03, 2023
Gathering data of likes on Tinder within the past 7 days

tinder_likes_data Gathering data of Likes Sent on Tinder within the past 7 days. Versions November 25th, 2021 - Functionality to get the name and age

Alex Carter 12 Jan 05, 2023
Datashredder is a simple data corruption engine written in python. You can corrupt anything text, images and video.

Datashredder is a simple data corruption engine written in python. You can corrupt anything text, images and video. You can chose the cha

2 Jul 22, 2022
track your GitHub statistics

GitHub-Stalker track your github statistics 👀 features find new followers or unfollowers find who got a star on your project or remove stars find who

Bahadır Araz 34 Nov 18, 2022
a tool that compiles a csv of all h1 program stats

h1stats - h1 Program Stats Scraper This python3 script will call out to HackerOne's graphql API and scrape all currently active programs for informati

Evan 40 Oct 27, 2022
PyEmits, a python package for easy manipulation in time-series data.

PyEmits, a python package for easy manipulation in time-series data. Time-series data is very common in real life. Engineering FSI industry (Financial

Thompson 5 Sep 23, 2022
cLoops2: full stack analysis tool for chromatin interactions

cLoops2: full stack analysis tool for chromatin interactions Introduction cLoops2 is an extension of our previous work, cLoops. From loop-calling base

YaqiangCao 25 Dec 14, 2022
Advanced Pandas Vault — Utilities, Functions and Snippets (by @firmai).

PandasVault ⁠— Advanced Pandas Functions and Code Snippets The only Pandas utility package you would ever need. It has no exotic external dependencies

Derek Snow 374 Jan 07, 2023
Office365 (Microsoft365) audit log analysis tool

Office365 (Microsoft365) audit log analysis tool The header describes it all WHY?? The first line of code was written long time before other colleague

Anatoly 1 Jul 27, 2022
Synthetic data need to preserve the statistical properties of real data in terms of their individual behavior and (inter-)dependences

Synthetic data need to preserve the statistical properties of real data in terms of their individual behavior and (inter-)dependences. Copula and functional Principle Component Analysis (fPCA) are st

32 Dec 20, 2022
Detecting Underwater Objects (DUO)

Underwater object detection for robot picking has attracted a lot of interest. However, it is still an unsolved problem due to several challenges. We take steps towards making it more realistic by ad

27 Dec 12, 2022
Statistical Rethinking course winter 2022

Statistical Rethinking (2022 Edition) Instructor: Richard McElreath Lectures: Uploaded Playlist and pre-recorded, two per week Discussion: Online, F

Richard McElreath 3.9k Dec 31, 2022