GithubHelp home page GithubHelp logo

zhoubin-me / lushi_script Goto Github PK

View Code? Open in Web Editor NEW
197.0 197.0 74.0 23.44 MB

This script is to save your time from Mercenaries mode of Hearthstone

License: MIT License

Python 99.95% Batchfile 0.05%
hearthstone mercenaries python

lushi_script's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lushi_script's Issues

分辨率问题

炉石默认没有1600900的分辨率
我调整了配置文件,修改到了1600
900,画质为高
进入炉石运行之后点的位置都不对
然后也识别不了界面
我把识别阈值调低后可以识别,但是点击的位置不对。。
屏幕分辨率2560*1600
缩放我125%试过不行
100%也不行
请问这是什么问题所导致的?

召唤物问题

召唤物那段改成
if ('summoned_demon' in states) and (states['summoned_demon'][0][1] > self.locs.resolution[1] / 2):
print('Found Summoned Demon, checking coordinates', states)
print("Surrendering due to extra minion on our side", states)
pyautogui.click(rect[0] + self.locs.options[0], rect[1] + self.locs.options[1])
pyautogui.click(rect[0] + self.locs.surrender[0], rect[1] + self.locs.surrender[1])
continue
可以避免对面出现召唤物时卡住,反复输出Found Summoned Demon, checking coordinates。
另外,在选路的三次点击操作后再加一个神秘人为横坐标的点击,这样不容易选错路。在出现炸弹或传送门时,可以先点选择再投降,增加投降产出。

点击确定后没有反应

提示
D:\Program Files (x86)\lushi_script-main>python lushi.py
Traceback (most recent call last):
File "D:\Program Files (x86)\lushi_script-main\lushi.py", line 292, in
main()
File "D:\Program Files (x86)\lushi_script-main\lushi.py", line 283, in main
assert(team_id in [0, 1, 2] and hero_cnt <= 6)
AssertionError

依赖已经安装了

运行错误

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'

输入第一条指令的时候显示warning怎么解决

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1125)'))': /simple/opencv-python/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1125)'))': /simple/opencv-python/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1125)'))': /simple/opencv-python/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1125)'))': /simple/opencv-python/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1125)'))': /simple/opencv-python/
Could not fetch URL https://pypi.org/simple/opencv-python/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/opencv-python/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1125)'))) - skipping
ERROR: Could not find a version that satisfies the requirement opencv-python
ERROR: No matching distribution found for opencv-python
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1125)'))) - skipping

pvp开始游戏界面卡死

pvp开始游戏界面,出现对手无法连接的情况,因为不能点确定,一直点开始,卡住不动
-9909e74a1aa8bd0

不能正确选择地图内关卡

出现位置H2-5如下图
image

现象: 重复在刀油左右点击但是无法选中,然后鼠标点击初始位置,然后再回来在导游左右点击

后台信息:
{'map_not_ready': ((1521, 792), 0.9922804832458496)}, surprise side: right, surprise in middle: False, last battle info : win
{'map_not_ready': ((1521, 792), 0.9922800064086914)}, surprise side: right, surprise in middle: False, last battle info : win
{'map_not_ready': ((1521, 792), 0.9922794699668884)}, surprise side: right, surprise in middle: False, last battle info : win
{'map_not_ready': ((1521, 792), 0.992278516292572)}, surprise side: right, surprise in middle: False, last battle info : win
{'map_not_ready': ((1521, 792), 0.9922800064086914)}, surprise side: right, surprise in middle: False, last battle info : win
{'map_not_ready': ((1521, 792), 0.9922800064086914)}, surprise side: right, surprise in middle: False, last battle info : win
{'map_not_ready': ((1521, 792), 0.9922794699668884)}, surprise side: right, surprise in middle: False, last battle info : win
{'map_not_ready': ((1521, 792), 0.9922804832458496)}, surprise side: right, surprise in middle: False, last battle info : win

目前版本稳定性似乎变差了,左键点击过快造成拖动

连续两个操作之间的延迟,这个配置并不是对所有操作生效,战斗接受后点击下一场战斗时,左键点的非常快,没有延迟,有时会拖动路线图,然后就卡在那里了,基本打几把就会遇到。目前发现这个延迟生效只在选择佣兵上场的时候有用。选择技能,放弃战斗,这些操作都是瞬间完成的,没有延迟,有几次就卡在点放弃那里,点的太快,反应不过来,电脑配置应该没问题(4800h rtx2060 16g)。

领取奖励后结束游戏,这个配置也并不总是生效,有时会卡在选择神秘人那里不动,就是要三选一的时候不选择,有时选择完后不会放弃,继续打完,有时会。

我有一个idea,我之前用按键精灵刷

我之前用按键精灵刷2-5,进去AOE之后就走,但是发现有白嫖的路线多走在放弃东西会多。
本来把那个冰霜的图改成那个27的本,以为能刷。TnT
这个放弃会出紫碎片跟橙,适合挂机弄新碎片。

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

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

任务完成收取

现版本会主动做任务吗,不会的话希望加上
还有就是先做上检测到完成任务去收取一下,毕竟有些任务第一个技能就能完成

炸弹投降的位置我试出来了

  # option button
  options: [1580, 970] # [x, y]
  # surrender button
  surrender: [815, 393] # [x, y]
  # view team members button
  view_team: [647, 885]
  # give up button
  give_up: [929, 906]
  # give up confirm button
  give_up_cfm: [712, 260]

PVE 3-1 BOSS卡住

打3-1boss的时候,火焰队全体技能选完之后不点结束,会点到BOSS头上,然后循环重新选技能,打了好几遍都是这样

改配置文件后出错

用记事本编辑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 都不行

发现开场有时佣兵排列会变化

我两天前开始使用这个脚本,今天开始发现有些战斗开始时,佣兵的排位发生了变化,似乎是随机的。队伍满6个英雄,前两天没有这个问题,不知是否有遇到同样情况的。

bug

没截图 当出现三个英雄技能释放不一致(比如1释放 23没释放)时会卡住 (循环变为1没释放 23释放)<->(1释放 23没释放)

增加PVP互投功能

互投区人已经多起来了,能不能加一个PVP投降的功能,也可以刷很多碎片

填完选项发现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'

bug

分辨率改配置解决了,但是发现只要队伍里多一个角色(比如与炸弹和晨拥冰墙)时,程序就和陷入死循环,是否可以通过不选择这类宝藏来避免

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.