Exemplo n.º 1
0
def show_accounts_status(cfg, ctx):
    logger.info("")
    _show_head_line("部分活动信息")
    logger.warning("如果一直卡在这一步,请在小助手目录下创建一个空文件:不查询活动.txt")
    Urls().show_current_valid_act_infos()

    logger.info("")
    _show_head_line("付费相关信息")
    user_buy_info = get_user_buy_info(cfg)
    show_buy_info(user_buy_info)

    if not has_any_account_in_normal_run(cfg):
        return
    _show_head_line(ctx)

    heads = ["序号", "账号名", "启用状态", "聚豆余额", "聚豆历史总数", "成就点", "心悦组队", "心悦G分", "编年史", "年史碎片", "守护者卡片", "马杰洛石头"]
    colSizes = [4, 12, 8, 8, 12, 6, 8, 8, 14, 8, 15, 10]

    logger.info(tableify(heads, colSizes))
    for _idx, account_config in enumerate(cfg.account_configs):
        idx = _idx + 1
        if not account_config.is_enabled():
            # 未启用的账户的账户不走该流程
            continue

        djcHelper = DjcHelper(account_config, cfg.common)
        djcHelper.check_skey_expired()
        djcHelper.get_bind_role_list(print_warning=False)

        status = "启用" if account_config.is_enabled() else "未启用"

        djc_info = djcHelper.query_balance("查询聚豆概览", print_res=False)["data"]
        djc_allin, djc_balance = int(djc_info['allin']), int(djc_info['balance'])

        xinyue_info = djcHelper.query_xinyue_info("查询心悦成就点概览", print_res=False)
        teaminfo = djcHelper.query_xinyue_teaminfo(print_res=False)
        team_score = "无队伍"
        if teaminfo.id != "":
            team_score = f"{teaminfo.score}/20"
            fixed_team = djcHelper.get_fixed_team()
            if fixed_team is not None:
                team_score = f"[{fixed_team.id}]{team_score}"

        gpoints = djcHelper.query_gpoints()

        ui = djcHelper.query_dnf_helper_chronicle_info()
        levelInfo = f"LV{ui.level}({ui.currentExp}/{ui.levelExp})"
        chronicle_points = ui.point
        if ui.totalExp == 0:
            levelInfo = ""
            chronicle_points = ""

        majieluo_cards = djcHelper.query_majieluo_card_info()

        stone_count = djcHelper.query_stone_count()

        cols = [idx, account_config.name, status, djc_balance, djc_allin, xinyue_info.score, team_score, gpoints, levelInfo, chronicle_points, majieluo_cards, stone_count]
        logger.info(color("fg_bold_green") + tableify(cols, colSizes, need_truncate=True))
Exemplo n.º 2
0
def show_accounts_status(cfg, ctx):
    if not has_any_account_in_normal_run(cfg):
        return
    _show_head_line(ctx)

    heads = [
        "序号", "账号名", "启用状态", "聚豆余额", "聚豆历史总数", "成就点", "心悦组队", "闪光杯出货数",
        "赛丽亚卡片", "爆竹积分", "马杰洛石头"
    ]
    colSizes = [4, 12, 8, 8, 12, 6, 8, 12, 14, 8, 10]

    logger.info(tableify(heads, colSizes))
    for _idx, account_config in enumerate(cfg.account_configs):
        idx = _idx + 1
        if not account_config.is_enabled():
            # 未启用的账户的账户不走该流程
            continue

        djcHelper = DjcHelper(account_config, cfg.common)
        djcHelper.check_skey_expired()

        status = "启用" if account_config.is_enabled() else "未启用"

        djc_info = djcHelper.query_balance("查询聚豆概览", print_res=False)["data"]
        djc_allin, djc_balance = int(djc_info['allin']), int(
            djc_info['balance'])

        xinyue_info = djcHelper.query_xinyue_info("查询心悦成就点概览", print_res=False)
        teaminfo = djcHelper.query_xinyue_teaminfo(print_res=False)
        team_score = "无队伍"
        if teaminfo.id != "":
            team_score = f"{teaminfo.score}/20"
            fixed_team = djcHelper.get_fixed_team()
            if fixed_team is not None:
                team_score = f"[{fixed_team.id}]{team_score}"

        shanguang_equip_count = djcHelper.query_dnf_shanguang_equip_count(
            print_warning=False)

        sailiya_cards = djcHelper.query_majieluo_card_info()

        firecrackers_points = djcHelper.query_firecrackers_points()

        stone_count = djcHelper.query_stone_count()

        cols = [
            idx, account_config.name, status, djc_balance, djc_allin,
            xinyue_info.score, team_score, shanguang_equip_count,
            sailiya_cards, firecrackers_points, stone_count
        ]
        logger.info(
            color("fg_bold_green") +
            tableify(cols, colSizes, need_truncate=True))

    logger.info("")
    _show_head_line("付费相关信息")
    user_buy_info = get_user_buy_info(cfg)
    show_buy_info(user_buy_info)