2020-03-28 17:22:46 +00:00
|
|
|
from module.handler.assets import *
|
|
|
|
from module.handler.info_bar import InfoBarHandler
|
|
|
|
from module.logger import logger
|
|
|
|
|
|
|
|
|
|
|
|
class UrgentCommissionHandler(InfoBarHandler):
|
|
|
|
def handle_urgent_commission(self, save_get_items=None):
|
|
|
|
"""
|
|
|
|
Args:
|
|
|
|
save_get_items (bool):
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
bool:
|
|
|
|
"""
|
|
|
|
if save_get_items is None:
|
|
|
|
save_get_items = self.config.ENABLE_SAVE_GET_ITEMS
|
|
|
|
|
2020-04-15 13:44:11 +00:00
|
|
|
appear = self.appear(GET_MISSION, offset=True, interval=2)
|
2020-03-28 17:22:46 +00:00
|
|
|
if appear:
|
|
|
|
logger.info('Get urgent commission')
|
|
|
|
if save_get_items:
|
|
|
|
if self.handle_info_bar():
|
|
|
|
self.device.screenshot()
|
|
|
|
self.device.save_screenshot('get_mission')
|
2020-04-15 13:44:11 +00:00
|
|
|
self.device.click(GET_MISSION)
|
2020-03-28 17:22:46 +00:00
|
|
|
return appear
|