JS脚本:刷肉添加定期前往神像选项及设置值

This commit is contained in:
起个名字好难
2025-01-26 00:28:41 +08:00
parent c4ede920b6
commit 8f4d872c28
4 changed files with 104 additions and 13 deletions

View File

@@ -0,0 +1,66 @@
{
"info": {
"name": "好感-张牙舞爪的恶党-神像",
"type": "collect",
"author": "起个名字好难的喵",
"version": "1.0",
"description": "",
"bgiVersion": "0.35.1"
},
"positions": [
{
"id": 1,
"action": "",
"move_mode": "walk",
"type": "teleport",
"x": 2567.5400390625,
"y": -1424.11767578125,
"action_params": ""
},
{
"id": 2,
"x": 2565.2373046875,
"y": -1418.88720703125,
"type": "path",
"move_mode": "walk",
"action": "combat_script",
"action_params": "wait(5)"
},
{
"id": 3,
"x": 2613.8125,
"y": -1503.6513671875,
"type": "path",
"move_mode": "fly",
"action": "",
"action_params": ""
},
{
"id": 4,
"x": 2653.1630859375,
"y": -1552.5888671875,
"type": "path",
"move_mode": "fly",
"action": "",
"action_params": ""
},
{
"id": 5,
"x": 2699.2822265625,
"y": -1616.28515625,
"type": "path",
"move_mode": "fly",
"action": "stop_flying",
"action_params": ""
},
{
"id": 6,
"x": 2705.837890625,
"y": -1622.46826171875,
"type": "path",
"move_mode": "walk",
"action": "fight",
"action_params": ""
}
]
}

View File

@@ -31,7 +31,7 @@
"x": 2794.3583984375, "x": 2794.3583984375,
"y": -1707.4033203125, "y": -1707.4033203125,
"type": "path", "type": "path",
"move_mode": "run", "move_mode": "walk",
"action": "", "action": "",
"action_params": "" "action_params": ""
}, },

View File

@@ -72,18 +72,28 @@
await sleep(2000); await sleep(2000);
} }
async function AutoFriendship(times) { async function AutoFriendship(times,statue_times) {
log.info(`导航至好感-张牙舞爪的恶党-触发位置`); log.info(`导航至好感-张牙舞爪的恶党-触发位置`);
await AutoPath('好感-张牙舞爪的恶党-触发位置'); await AutoPath('好感-张牙舞爪的恶党-触发位置');
log.info(`自动好感开始...`); log.info(`自动好感开始...`);
await ReopenTheGate();
for (let i = 0; i < times; i++) { for (let i = 0; i < times; i++) {
log.info(`自动好感当前次数:${i + 1}/${times}`); // 每运行 5 次 '好感-张牙舞爪的恶党-循环' 后运行 '好感-张牙舞爪的恶党-神像'
await AutoPath('好感-张牙舞爪的恶党-循环'); if ((i + 1) % statue_times === 0) {
await ReopenTheGate(); await AutoPath('好感-张牙舞爪的恶党-神像');
await ReopenTheGate();
log.info(`当前次数:${i + 1}/${times}`);
logTimeTaken(startTime);
await AutoPath('好感-张牙舞爪的恶党-循环');
} else {
await ReopenTheGate();
log.info(`当前次数:${i + 1}/${times}`);
logTimeTaken(startTime);
await AutoPath('好感-张牙舞爪的恶党-循环');
}
log.info(`已完成次数:${i + 1}/${times}`);
logTimeTaken(startTime); logTimeTaken(startTime);
} }
log.info('自动好感已完成'); log.info('自动好感已完成');
@@ -105,24 +115,29 @@
setGameMetrics(1920, 1080, 1); // 设置游戏窗口大小和DPI setGameMetrics(1920, 1080, 1); // 设置游戏窗口大小和DPI
let exitdelay = Number(settings.exitdelay); let exitdelay = Number(settings.exitdelay);
let loadingdelay = Number(settings.loadingdelay); let loadingdelay = Number(settings.loadingdelay);
let UL = settings.UL? settings.UL : false; let UL = settings.UL ? settings.UL : false;
let inputValue = settings.inputValue? settings.inputValue : 9999; let inputValue = settings.inputValue ? settings.inputValue : 9999;
let times = UL ? (isNaN(inputValue) ? 1667 : Math.ceil(inputValue / 6)) : 10; let times = UL ? (isNaN(inputValue) ? 1667 : Math.ceil(inputValue / 6)) : 10;
log.info(`计算后的运行次数为: ${times}`); let gostatue = settings.gostatue ? settings.gostatue : false;
let statue = settings.statue ? settings.statue : 5;
let statue_times = gostatue ? (isNaN(statue) ? 5 : statue) : 0;
const { exitDelay: validatedExitDelay, loadingDelay: validatedLoadingDelay } = validateAndSetDefaults(exitdelay, loadingdelay); const { exitDelay: validatedExitDelay, loadingDelay: validatedLoadingDelay } = validateAndSetDefaults(exitdelay, loadingdelay);
const messages = [ const messages = [
'请确保队伍满员,并为队伍配置相应的战斗策略', '请确保队伍满员,并为队伍配置相应的战斗策略',
`退出延迟: ${validatedExitDelay}秒, 加载延迟: ${validatedLoadingDelay}`,
`设置的七天神像周期为: ${statue_times}`,
`计算后的运行次数为: ${times}`,
]; ];
for (let message of messages) { for (let message of messages) {
log.info(message); log.info(message);
await sleep(1000); await sleep(1000);
} }
log.info('自动好感开始...'); log.info('自动好感开始...');
log.info(`退出延迟: ${validatedExitDelay}秒, 加载延迟: ${validatedLoadingDelay}`);
//默认10次自动好感 //默认10次自动好感
await AutoFriendship(times); await AutoFriendship(times,statue_times);
// 计算并输出总时长 // 计算并输出总时长
const endTime = Date.now(); const endTime = Date.now();

View File

@@ -12,11 +12,21 @@
{ {
"name": "UL", "name": "UL",
"type": "checkbox", "type": "checkbox",
"label": "是否开启刷兽肉模式" "label": "开启刷兽肉模式"
}, },
{ {
"name": "inputValue", "name": "inputValue",
"type": "input-text", "type": "input-text",
"label": "刷取个数(默认9999" "label": "刷取个数(选填,默认9999"
},
{
"name": "gostatue",
"type": "checkbox",
"label": "开启定期前往七天神像"
},
{
"name": "statue",
"type": "input-text",
"label": "返回神像周期选填默认为5"
} }
] ]