Esempio n. 1
0
    def action_point_limit_override(self):
        """
        Override user config at the end of every month.
        To consume all action points without manual configuration.

        Returns:
            bool: If overrode
        """
        remain = get_os_reset_remain()
        if remain <= 0:
            logger.info('Just less than 1 day to OpSi reset, '
                        'set OpsiMeowfficerFarming.ActionPointPreserve to 0 temporarily')
            self.config.override(OpsiMeowfficerFarming_ActionPointPreserve=0)
            return True
        elif remain <= 2:
            logger.info('Just less than 3 days to OpSi reset, '
                        'set OpsiMeowfficerFarming.ActionPointPreserve < 200 temporarily')
            self.config.override(
                OpsiMeowfficerFarming_ActionPointPreserve=min(
                    self.config.OpsiMeowfficerFarming_ActionPointPreserve,
                    200)
            )
            return True
        else:
            logger.info('Not close to OpSi reset')
            return False
Esempio n. 2
0
    def clear_obscure(self):
        """
        Raises:
            ActionPointLimit:
        """
        logger.hr('OS clear obscure', level=1)
        if self.config.OpsiObscure_ForceRun:
            logger.info('OS obscure finish is under force run')

        result = self.storage_get_next_item(
            'OBSCURE', use_logger=self.config.OpsiGeneral_UseLogger)
        if not result:
            # No obscure coordinates, delay next run to tomorrow.
            if get_os_reset_remain() > 0:
                self.config.task_delay(server_update=True)
            else:
                logger.info(
                    'Just less than 1 day to OpSi reset, delay 2.5 hours')
                self.config.task_delay(minute=150, server_update=True)
            self.config.task_stop()

        self.zone_init()
        self.fleet_set(self.config.OpsiFleet_Fleet)
        self.os_order_execute(recon_scan=True,
                              submarine_call=self.config.OpsiFleet_Submarine)
        self.run_auto_search()

        self.map_exit()
        self.handle_after_auto_search()
Esempio n. 3
0
    def clear_abyssal(self):
        """
        Get one abyssal logger in storage,
        attack abyssal boss,
        repair fleets in port.

        Raises:
            ActionPointLimit:
            TaskEnd: If no more abyssal loggers.
            RequestHumanTakeover: If unable to clear boss, fleets exhausted.
        """
        logger.hr('OS clear abyssal', level=1)
        result = self.storage_get_next_item(
            'ABYSSAL', use_logger=self.config.OpsiGeneral_UseLogger)
        if not result:
            # No obscure coordinates, delay next run to tomorrow.
            if get_os_reset_remain() > 0:
                self.config.task_delay(server_update=True)
            else:
                logger.info(
                    'Just less than 1 day to OpSi reset, delay 2.5 hours')
                self.config.task_delay(minute=150, server_update=True)
            self.config.task_stop()

        self.zone_init()
        result = self.run_abyssal()
        if not result:
            raise RequestHumanTakeover

        self.fleet_repair(revert=False)
Esempio n. 4
0
 def opsi_meowfficer_farming(self):
     self.load_campaign()
     try:
         self.campaign.os_meowfficer_farming()
     except ActionPointLimit:
         if get_os_reset_remain() > 0:
             self.campaign.config.task_delay(server_update=True)
         else:
             logger.info(
                 'Just less than 1 day to OpSi reset, delay 2.5 hours')
             self.config.task_delay(minute=150, server_update=True)