Skip to content

Conversation

@1004452714
Copy link
Contributor

简单示例

//无参数默认使用本体的参数,但domainRoundNum=0(9999次)
let domainParam = new AutoDomainParam(); 
await dispatcher.runAutoDomainTask(domainParam);

//无参数默认使用本体的参数
let autoFightParam = new AutoFightParam();
await dispatcher.runAutoFightTask(autoFightParam);

秘境参数除了战斗策略需要使用SetCombatStrategyPath()方法、设置树脂优先列表需要使用SetResinPriorityList()方法,其他参数均可直接重新赋值来修改参数。
ClearScript的 V8ScriptEngineFlags.EnableArrayConversion不知道会不会有副作用,所以用方法来设置树脂优先列表

自动战斗参数除了战斗策略需要使用SetCombatStrategyPath()方法指定,其他参数均可直接重新赋值来修改参数。

(async function () {
    try {
        
        let domainParam = new AutoDomainParam(); 

        // 基础参数  
        domainParam.DomainRoundNum = 1;                    // 秘境轮数,0表示9999轮  
        domainParam.SetCombatStrategyPath("那钟万芙");     // 参照设置中显示的字符填写

        // 队伍和秘境配置  
        domainParam.PartyName = "龙王";                    // 刷副本使用的队伍名称  
        domainParam.DomainName = "有顶塔";                 // 需要刷取的副本名称  
        domainParam.SundaySelectedValue = "2";              // 周日奖励序号  

        // 圣遗物分解配置  
        domainParam.AutoArtifactSalvage = true;            // 结束后是否自动分解圣遗物  
        domainParam.MaxArtifactStar = "4";                 // 分解圣遗物的最大星级

        // 树脂使用配置  
        domainParam.SpecifyResinUse = true;                // 是否指定树脂的使用次数  
        domainParam.SetResinPriorityList("浓缩树脂", "原粹树脂"); // 使用树脂优先级列表  
        domainParam.OriginalResinUseCount = 1;             // 使用原粹树脂刷取副本次数  
        domainParam.CondensedResinUseCount = 0;            // 使用浓缩树脂刷取副本次数  
        domainParam.TransientResinUseCount = 0;            // 使用须臾树脂刷取副本次数  
        domainParam.FragileResinUseCount = 0;              // 使用脆弱树脂刷取副本次数  

        // 运行任务  
        await dispatcher.runAutoDomainTask(domainParam);


        
        let autoFightParam = new AutoFightParam();

        // 战斗超时设置  
        autoFightParam.Timeout = 180;

        // 战斗结束检测配置  
        autoFightParam.FightFinishDetectEnabled = true;
        autoFightParam.FinishDetectConfig.FastCheckEnabled = true;
        autoFightParam.FinishDetectConfig.FastCheckParams = "30,钟离";
        autoFightParam.FinishDetectConfig.CheckEndDelay = "1.5;钟离,2";
        autoFightParam.FinishDetectConfig.BeforeDetectDelay = "0.45";
        autoFightParam.FinishDetectConfig.RotateFindEnemyEnabled = false;
        // autoFightParam.FinishDetectConfig.BattleEndProgressBarColor = "95,235,255";
        // autoFightParam.FinishDetectConfig.BattleEndProgressBarColorTolerance = "6";

        // 战斗后拾取配置  
        autoFightParam.PickDropsAfterFightEnabled = true;
        autoFightParam.PickDropsAfterFightSeconds = 15;
        autoFightParam.BattleThresholdForLoot = -1;

        // 万叶拾取配置  
        autoFightParam.KazuhaPickupEnabled = true;
        autoFightParam.KazuhaPartyName = "万叶队伍";

        // 技能CD优化  
        autoFightParam.ActionSchedulerByCd = "";

        // 精英怪拾取模式  
        autoFightParam.OnlyPickEliteDropsMode = "";

        // 盾奶配置  
        autoFightParam.GuardianAvatar = "4";
        autoFightParam.GuardianCombatSkip = false;
        autoFightParam.GuardianAvatarHold = true;
        autoFightParam.SkipModel = false;



        // 运行任务  
        await dispatcher.runAutoFightTask(autoFightParam);


    } catch (error) {
        log.error(`💥脚本执行出错: ${error}`);
    }

})();

@huiyadanli
Copy link
Member

感谢你的PR!看上去没有问题。

@huiyadanli huiyadanli merged commit 92c6556 into babalae:main Oct 5, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants