Skip to content

Commit

Permalink
v6.051 优化消耗品
Browse files Browse the repository at this point in the history
  • Loading branch information
CHNZYX committed Nov 30, 2023
1 parent f8000c8 commit 2fb8667
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
Binary file added imgs/use_star.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion info_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ config:
speed_mode: 0
slow_mode: 0
#use_consumable:0代表不使用消耗品,1代表最终boss使用消耗品,2代表最后两个boss使用消耗品,3代表所有boss都使用消耗品
#自动使用第一个攻击/防御消耗品,可以收藏消耗品(星星标记)来改变背包中消耗品的顺序
#自动使用第一个已星标的攻击/防御消耗品,必须收藏消耗品(星星标记)
#如果不希望使用防御消耗品,可以取消所有防御消耗品的星标
use_consumable: 0
force_update: 0
timezone: Default
Expand Down
4 changes: 2 additions & 2 deletions states.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import utils.keyops as keyops

# 版本号
version = "v6.05 E"
version = "v6.051 E"


class SimulatedUniverse(UniverseUtils):
Expand Down Expand Up @@ -171,7 +171,7 @@ def route(self):
if self._stop:
break
self.get_screen()
#self.click_target('imgs/use_package.jpg',0.9,True) # 如果需要输出某张图片在游戏窗口中的坐标,可以用这个
#self.click_target('imgs/use_star.jpg',0.9,True) # 如果需要输出某张图片在游戏窗口中的坐标,可以用这个
"""
if begin and not self.check("f", 0.4437,0.4231) and not self.check("abyss/1",0.8568,0.6769):
begin = 0
Expand Down
22 changes: 15 additions & 7 deletions utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,16 +210,24 @@ def use_it(self, x, y):
# 使用x排,y列的消耗品
def use_consumable(self, x=1, y=1):
self.press("b")
print("!!!!!!!!!!!!!!!!!")
if self.wait_fig(lambda:not self.check("use_atk",0.3677,0.0861), 3):
time.sleep(0.4)
self.click((0.3677,0.0861))
self.use_it(x, y)
if self.wait_fig(lambda:not self.check("use_def",0.3198,0.0880), 2.2):
time.sleep(0.3)
self.click((0.3198,0.0880))
time.sleep(0.4)
self.get_screen()
if self.wait_fig(lambda:not self.check("use_star",0.8828,0.8648,threshold=0.9), 0.8):
self.use_it(x, y)
self.wait_fig(lambda:not self.check("use_package",0.9417,0.9398), 2)
time.sleep(0.3)
if self.wait_fig(lambda:not self.check("use_def",0.3198,0.0880), 2.2):
time.sleep(0.4)
self.click((0.3198,0.0880))
time.sleep(0.4)
self.get_screen()
if self.wait_fig(lambda:not self.check("use_star",0.8828,0.8648,threshold=0.9), 0.6):
self.use_it(x, y)
self.wait_fig(lambda:not self.check("use_package",0.9417,0.9398), 2)
time.sleep(0.3)
self.press("esc")
else:
self.press("esc")
if not self.isrun():
for _ in range(3):
Expand Down

0 comments on commit 2fb8667

Please sign in to comment.