Beispiel #1
0
 def __init__(self, controller_state, options):
     super().__init__(controller_state, options)
     if options is None or len(options) < 2:
         raise JoycontrolPluginError('2つのオプションを指定してください ex "-p 試行回数 回収対象"')
     self.limit_count = int(options[0])
     if self.limit_count > 1000:
         raise JoycontrolPluginError('試行回数は 1000 までの範囲で指定してください。')
     self.get_type = options[1]
     if self.get_type not in ['all', 'nest', 'home', 'no']:
         raise JoycontrolPluginError(
             '回収対象は all nest home no のいずれかを指定してください。all=フクズクの巣と自宅(オトモ隠密隊と交易船), nest=フクズクの巣, home=自宅(オトモ隠密隊と交易船) no=回収しない'
         )
    def __init__(self, controller_state, options):
        super().__init__(controller_state, options)

        if options is None or len(options) < 2:
            raise JoycontrolPluginError(
                'Plugin option not set. Please use "--plugin-options <egg cycle> <total of eggs>".'
            )

        self.egg_cycle = int(options[0])
        self.total_eggs = int(options[1])

        if not 5 <= self.egg_cycle <= 40:
            raise JoycontrolPluginError('Egg cycle must be in 5-40.')

        if not 1 <= self.total_eggs <= 960:
            raise JoycontrolPluginError('Total of eggs must be in 1-960.')
Beispiel #3
0
    def __init__(self, controller_state, options):
        super().__init__(controller_state, options)

        self.box = 1
        if options is not None:
            self.box = int(options[0])

        if not 1 <= self.box <= 32:
            raise JoycontrolPluginError('Number of boxes must be in 1-32.')
Beispiel #4
0
    def __init__(self, controller_state, options):
        super().__init__(controller_state, options)

        if options is None or len(options) < 2:
            raise JoycontrolPluginError(
                'Plugin option not set. Please use "--plugin-options <honey_num> <rare_candy_num>".'
            )

        self.honey_num = int(options[0])
        self.rare_candy_num = int(options[1])
Beispiel #5
0
    async def skip_days(self):

        if self.options is None:
            raise JoycontrolPluginError(
                'Plugin option is not set. Please use "--plugin-options <days>".'
            )

        daysLimitStr = self.options[0]
        daysLimit = int(daysLimitStr)
        daysNow = 0
        daysOfMonth = 0
        perCount = 0

        # Reset cursor position
        await self.button_push('a')
        await self.wait(0.5)
        await self.button_push('right', press_time_sec=0.55)
        await self.wait(0.055)
        await self.button_push('a')
        await self.wait(1)

        while daysNow < daysLimit:
            if daysOfMonth != 30:
                daysNow += 1
                daysOfMonth += 1
            else:
                daysOfMonth = 0

            await self.button_push('a')
            await self.wait(0.5)
            await self.button_push('left')
            await self.wait(0.055)
            await self.button_push('left')
            await self.wait(0.055)
            await self.button_push('left')
            await self.wait(0.055)
            await self.button_push('up')
            await self.wait(0.055)
            await self.button_push('right', press_time_sec=0.55)
            await self.wait(0.055)
            await self.button_push('a')
            await self.wait(0.3)

            if int(daysNow / daysLimit * 100) > perCount:
                logger.info(
                    str(int(daysNow / daysLimit * 100)) + '% (' +
                    str(daysNow) + 'days) finished')
                perCount = int(daysNow / daysLimit * 100)

        await self.button_push('home')
        await self.wait(1)
        await self.button_push('a')
Beispiel #6
0
    def __init__(self, controller_state, options):
        super().__init__(controller_state, options)

        usage = 'Please use "--plugin-options <link_code> [backup]".'

        if options is None:
            raise JoycontrolPluginError(f'Plugin option is not set. {usage}')

        self.link_code = options[0] # require option
        self.backup_mode = False # default

        if not self.link_code.isdecimal() or len(self.link_code) != 8:
            raise ValueError(f'Invalid link code ({self.link_code}). {usage}')

        if len(options) >= 2:
            if options[1] != 'backup':
                raise ValueError(f'Invalid backup mode ({options[1]}). {usage}')
            self.backup_mode = True