Dragon-GCS / LOLHelper

英雄联盟游戏助手
Do What The F*ck You Want To Public License
10 stars 0 forks source link

[建议]能增加一个延迟的选项吗? #2

Closed user1121114685 closed 2 years ago

user1121114685 commented 2 years ago

秒选别人总感觉不对容易被举报!!

Dragon-GCS commented 2 years ago
if session_info["benchEnabled"]:
    if champion_id in session_info["benchChampionIds"]:
        # time.sleep(1)
        self.post(
            ROUTE["swap-champion"].format(championId=champion_id))
        self.picked = True
        logger.info(
            "自动选择英雄: {}", self.get_champion_name_by_id(champion_id))
    return

for actions in session_info.get("actions", []):
    for action in actions:
        if action["actorCellId"] == session_info["localPlayerCellId"] \
                and action['type'] == 'pick' \
                and action['isInProgress']:
            # time.sleep(1)
            self.patch(
                ROUTE["bp-champion"].format(actionId=action["id"]),
                data={
                    "completed": True,
                    "type": "pick",
                    "championId": champion_id
                }
            )
            self.picked = True
            logger.info(
                "自动选择英雄: {}", self.get_champion_name_by_id(champion_id))
            return