mirror of
https://github.com/TheFunny/ArisuAutoSweeper
synced 2025-12-17 00:15:13 +00:00
feat(bounty): detect ticket and end when zero
This commit is contained in:
parent
eb8048ccd6
commit
5e4abc147e
@ -39,7 +39,7 @@ class Bounty(BountyUI):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def is_ticket_enough(self) -> bool:
|
def is_ticket_enough(self) -> bool:
|
||||||
return self.config.stored.BountyTicket.value >= self.current_count
|
return self.current_ticket >= self.current_count
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def current_bounty(self):
|
def current_bounty(self):
|
||||||
@ -53,6 +53,10 @@ class Bounty(BountyUI):
|
|||||||
def current_count(self):
|
def current_count(self):
|
||||||
return self.task[0][3]
|
return self.task[0][3]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def current_ticket(self):
|
||||||
|
return self.config.stored.BountyTicket.value
|
||||||
|
|
||||||
def handle_bounty(self, status):
|
def handle_bounty(self, status):
|
||||||
match status:
|
match status:
|
||||||
case BountyStatus.OCR:
|
case BountyStatus.OCR:
|
||||||
@ -60,6 +64,9 @@ class Bounty(BountyUI):
|
|||||||
return BountyStatus.SELECT
|
return BountyStatus.SELECT
|
||||||
case BountyStatus.SELECT:
|
case BountyStatus.SELECT:
|
||||||
if not self.is_ticket_enough:
|
if not self.is_ticket_enough:
|
||||||
|
if self.current_ticket == 0:
|
||||||
|
logger.info('Bounty ticket empty')
|
||||||
|
return BountyStatus.FINISH
|
||||||
logger.warning('Bounty ticket not enough')
|
logger.warning('Bounty ticket not enough')
|
||||||
raise RequestHumanTakeover
|
raise RequestHumanTakeover
|
||||||
if self.select_bounty(*self.current_bounty):
|
if self.select_bounty(*self.current_bounty):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user