OnmyojiAutoScript icon indicating copy to clipboard operation
OnmyojiAutoScript copied to clipboard

✨讓"御魂装配分组设置"支援2組或以上的设置

Open tingo5og opened this issue 1 year ago • 2 comments

当前不足

御魂装配分组设置只支援1組御魂設置, 但是在某一些戰鬥是需要6隻式神(2組)的設定才能正常跑, 如:鬼灵歌姬,六道。

解决方案

在分组设置 填入"7,1;7,2" image

我的做法是 先檢查有沒有";" 有";"的話用";"去區分第一組第二組 每組再用","區分 沒有";"的話照舊

我這裡是能跑能切換,想問問你這邊有什麼建議。

def convert_to_list_of_tuples(target: str) -> list[tuple]:
    """
    transform the string representation of a list of tuples to list[tuple]
    :param target: the string representation of a list of tuples, e.g. "1,1;1,2"
    :return: list[tuple]
    """
    # split the string representation of a list of tuples by ';'
    tuple_strings = target.split(';')
    
    # transform the string representation of a tuple to tuple
    result = [tuple(map(int, t.split(','))) for t in tuple_strings]
    
    return result

class SwitchSoul(BaseTask, SwitchSoulAssets):

    def run_switch_soul(self, target: tuple or list[tuple]):
        """
        保证在式神录的界面
        :return:
        """
        if isinstance(target, str):
            # check target include ';'
            if target.find(';') != -1:
                try:
                    target = convert_to_list_of_tuples(target)
                except ValueError:
                    logger.error('Switch soul config error')
                    return
            else:
                try:
                    target = switch_parser(target)
                except ValueError:
                    logger.error('Switch soul config error')
                    return
        self.click_preset()
        self.switch_souls(target)

image

其他内容

No response

tingo5og avatar Nov 07 '24 20:11 tingo5og

image 这两个是可以同时用的

runhey avatar Nov 08 '24 01:11 runhey

有空再加吧

runhey avatar Nov 08 '24 01:11 runhey