mirror of
https://github.com/sui-feng-cb/AzurLaneAutoScript1.git
synced 2026-07-27 22:33:12 +08:00
Opt: share screenshot for oil and coin reading, and cache limit
This commit is contained in:
@@ -180,29 +180,13 @@ class CampaignBase(CampaignBase_):
|
||||
self._prev_oil = oil
|
||||
return checked
|
||||
|
||||
def auto_search_watch_oil(self, checked=False):
|
||||
def _check_oil(self, oil):
|
||||
"""
|
||||
Watch oil.
|
||||
This will set auto_search_oil_limit_triggered.
|
||||
Override to check oil threshold of one battle before normal oil handling.
|
||||
"""
|
||||
if not checked:
|
||||
oil = self.get_oil()
|
||||
if oil == 0:
|
||||
logger.warning('Oil not found')
|
||||
else:
|
||||
if self.check_oil_threshold(oil):
|
||||
self._interrupt = True
|
||||
if oil < max(500, self.config.StopCondition_OilLimit):
|
||||
logger.info('Reach oil limit')
|
||||
self.auto_search_oil_limit_triggered = True
|
||||
else:
|
||||
if self.auto_search_oil_limit_triggered:
|
||||
logger.warning('auto_search_oil_limit_triggered but oil recovered, '
|
||||
'probably because of wrong OCR result before')
|
||||
self.auto_search_oil_limit_triggered = False
|
||||
checked = True
|
||||
|
||||
return checked
|
||||
if oil > 0 and self.check_oil_threshold(oil):
|
||||
self._interrupt = True
|
||||
super()._check_oil(oil)
|
||||
|
||||
def auto_search_combat(self, emotion_reduce=None, fleet_index=1, battle=None):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user