Esempio n. 1
0
def main():
    if uData.setting['mode'].lower() == 'gui':
        kirafanbot_GUI().open()
    elif uData.setting['mode'].lower() == 'hotkey':
        try:
            hotkey = Hotkey('rslmptcoxkvei')
            logger.info("kirafan-bot: hotkey setting finish...")
            logger.info(f'kirafan-bot: region = {list(kirafan.region)}')
            logger.info(
                f'kirafan-bot: adb use = {uData.setting["adb"]["use"]}')
            logger.info(
                f'kirafan-bot: quest setting = \x1b[41m{kirafan.quest_name}\x1b[0m'
            )
            check_basic_information()
            logger.info('please press \'f3\' button to exit...')
            hotkey.wait('f3')
            hotkey.safe_exit()
        except KeyboardInterrupt:
            hotkey.safe_exit()
Esempio n. 2
0
def test_hotkey():
    hotkey = Hotkey('rslmptcoxkvei')
    assert hotkey.safe_exit() is None
    assert hotkey._Hotkey__user_command('1') is None
    assert hotkey._Hotkey__user_command('r') is None
    assert hotkey._Hotkey__user_command('s') is None
    assert hotkey._Hotkey__user_command('l') is None
    # assert hotkey._Hotkey__user_command('m') is None
    assert hotkey._Hotkey__user_command('t') is None
    assert hotkey._Hotkey__user_command('c') is None
    assert hotkey._Hotkey__user_command('o') is None
    # assert hotkey._Hotkey__user_command('x') is None
    assert hotkey._Hotkey__user_command('k') is None
    assert hotkey._Hotkey__user_command('k') is None  # switch back
    assert hotkey._Hotkey__user_command('v') is None
    assert hotkey._Hotkey__user_command('s') is None
    assert hotkey._Hotkey__user_command('e') is None
    assert hotkey._Hotkey__user_command('s') is None
    assert hotkey._Hotkey__user_command('i') is None
    assert os.path.exists('screenshot0.png') is True
    assert hotkey.remove_all_hotkey() is None