Skip to content

Commit

Permalink
feat(Restart): runhey#425
Browse files Browse the repository at this point in the history
  • Loading branch information
runhey committed Sep 30, 2024
1 parent 967f84f commit ce79ca5
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 4 deletions.
8 changes: 8 additions & 0 deletions tasks/Restart/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ class RestartAssets:
I_HARVEST_SIGN_3 = RuleImage(roi_front=(291,495,33,36), roi_back=(100,473,1014,91), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_sign_3.png")
# description
I_HARVEST_SIGN_4 = RuleImage(roi_front=(587,151,100,228), roi_back=(547,123,185,281), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_sign_4.png")
# 点击随机御魂
I_HARVEST_SOUL_1 = RuleImage(roi_front=(248,501,34,37), roi_back=(165,389,929,168), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_soul_1.png")
# 选择第一个御魂
I_HARVEST_SOUL_2 = RuleImage(roi_front=(586,561,112,47), roi_back=(570,547,139,71), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_soul_2.png")
# description
I_HARVEST_SOUL_3 = RuleImage(roi_front=(313,489,188,33), roi_back=(302,472,216,60), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_soul_3.png")
# 寮包
I_HARVEST_GUILD_REWARD = RuleImage(roi_front=(244,498,41,42), roi_back=(200,403,817,157), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_guild_reward.png")


# Image Rule Assets
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tasks/Restart/harvest/harvest_harvest_soul_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tasks/Restart/harvest/harvest_harvest_soul_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tasks/Restart/harvest/harvest_harvest_soul_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions tasks/Restart/harvest/image.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,41 @@
"method": "Template matching",
"threshold": 0.8,
"description": "description"
},
{
"itemName": "harvest_soul_1",
"imageName": "harvest_harvest_soul_1.png",
"roiFront": "248,501,34,37",
"roiBack": "165,389,929,168",
"method": "Template matching",
"threshold": 0.8,
"description": "点击随机御魂"
},
{
"itemName": "harvest_soul_2",
"imageName": "harvest_harvest_soul_2.png",
"roiFront": "586,561,112,47",
"roiBack": "570,547,139,71",
"method": "Template matching",
"threshold": 0.8,
"description": "选择第一个御魂"
},
{
"itemName": "harvest_soul_3",
"imageName": "harvest_harvest_soul_3.png",
"roiFront": "313,489,188,33",
"roiBack": "302,472,216,60",
"method": "Template matching",
"threshold": 0.8,
"description": "description"
},
{
"itemName": "harvest_guild_reward",
"imageName": "harvest_harvest_guild_reward.png",
"roiFront": "244,498,41,42",
"roiBack": "200,403,817,157",
"method": "Template matching",
"threshold": 0.8,
"description": "寮包"
}
]
19 changes: 15 additions & 4 deletions tasks/Restart/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ def harvest(self):
continue

# 勾玉
if self.appear_then_click(self.I_HARVEST_JADE, interval=1):
if self.appear_then_click(self.I_HARVEST_JADE, interval=1.5):
timer_harvest.reset()
continue
# 签到
if self.appear_then_click(self.I_HARVEST_SIGN, interval=1):
if self.appear_then_click(self.I_HARVEST_SIGN, interval=1.5):
timer_harvest.reset()
continue
# 某些活动的特殊签到,有空看到就删掉
Expand All @@ -144,11 +144,11 @@ def harvest(self):
if self.appear_then_click(self.I_HARVEST_SIGN_4, interval=1):
timer_harvest.reset()
continue
if self.appear_then_click(self.I_HARVEST_SIGN_2, interval=1):
if self.appear_then_click(self.I_HARVEST_SIGN_2, interval=1.5):
timer_harvest.reset()
continue
# 999天的签到福袋
if self.appear_then_click(self.I_HARVEST_SIGN_999, interval=1):
if self.appear_then_click(self.I_HARVEST_SIGN_999, interval=1.5):
timer_harvest.reset()
continue
# 邮件
Expand Down Expand Up @@ -186,6 +186,17 @@ def harvest(self):
if self.appear_then_click(self.I_HARVEST_SOUL, interval=1):
timer_harvest.reset()
continue
# 寮包
if self.appear_then_click(self.I_HARVEST_GUILD_REWARD, interval=2):
timer_harvest.reset()
continue
# 自选御魂
if self.appear(self.I_HARVEST_SOUL_1):
logger.info('Select soul 1')
self.ui_click(self.I_HARVEST_SOUL_1, stop=self.I_HARVEST_SOUL_2)
self.ui_click(self.I_HARVEST_SOUL_2, stop=self.I_HARVEST_SOUL_3, interval=3)
self.ui_click_until_disappear(click=self.I_HARVEST_SOUL_3)
timer_harvest.reset()


# 红色的关闭
Expand Down

0 comments on commit ce79ca5

Please sign in to comment.