Skip to content

Commit

Permalink
结界收取经验适配开启招财上宾
Browse files Browse the repository at this point in the history
  • Loading branch information
yiliangxiajiao committed Aug 30, 2024
1 parent 0bf19cc commit f5f8123
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tasks/KekkaiUtilize/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,10 @@ class KekkaiUtilizeAssets:
# Ocr Rule Assets
# 这个寄养的剩余时间
O_UTILIZE_RES_TIME = RuleOcr(roi=(1140,117,100,30), area=(1140,117,100,30), mode="Duration", method="Default", keyword="", name="utilize_res_time")
# 今日以领取经验
# 今日已领取经验
O_BOX_EXP = RuleOcr(roi=(654,538,179,39), area=(654,538,179,39), mode="DigitCounter", method="Default", keyword="", name="box_exp")
# 今日已领取经验(招财上宾)
O_BOX_EXP_ZCSB = RuleOcr(roi=(584,542,181,35), area=(584,542,181,35), mode="DigitCounter", method="Default", keyword="", name="box_exp_zcsb")


# Swipe Rule Assets
Expand Down
7 changes: 7 additions & 0 deletions tasks/KekkaiUtilize/script_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,13 @@ def _check_exp_box(appear: bool=False):
if cur == totol and cur + res == totol:
logger.info('Exp box reach max do not collect')
break
# 开启招财上宾后,上限增加20%,数值位置有偏移
cur, res, totol = self.O_BOX_EXP_ZCSB.ocr(self.device.image)
if cur == res == totol == 0:
continue
if cur == totol * 1.2 and cur + res == totol:
logger.info('Exp box reach max do not collect')
break
if self.appear_then_click(self.I_BOX_EXP, threshold=0.6, interval=1):
continue
if self.appear_then_click(self.I_EXP_EXTRACT, interval=1):
Expand Down
11 changes: 10 additions & 1 deletion tasks/KekkaiUtilize/utilize/ocr.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
"mode": "DigitCounter",
"method": "Default",
"keyword": "",
"description": "今日以领取经验"
"description": "今日已领取经验"
},
{
"itemName": "box_exp_zcsb",
"roiFront": "584,542,181,35",
"roiBack": "584,542,181,35",
"mode": "DigitCounter",
"method": "Default",
"keyword": "",
"description": "今日已领取经验(招财上宾)"
}
]

0 comments on commit f5f8123

Please sign in to comment.