JS脚本:fix:兽肉好感前往触发地点重上回原地的bug,removed:移除旧的返回七天神像切换队伍
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
{"macroEvents":[{"type":4,"mouseX":1000,"mouseY":800,"mouseButton":"Left","time":100},
|
||||
{"type":2,"mouseX":1000,"mouseY":900,"time":150},
|
||||
{"type":2,"mouseX":1000,"mouseY":1000,"time":200},
|
||||
{"type":2,"mouseX":1000,"mouseY":1100,"time":250},
|
||||
{"type":2,"mouseX":1000,"mouseY":1200,"time":300},
|
||||
{"type":2,"mouseX":1000,"mouseY":1300,"time":350},
|
||||
{"type":2,"mouseX":1000,"mouseY":1400,"time":400},
|
||||
{"type":2,"mouseX":1000,"mouseY":1500,"time":450},
|
||||
{"type":5,"mouseX":1000,"mouseY":1500,"mouseButton":"Left","time":500}],
|
||||
"info":{"name":"","description":"","x":746,"y":620,"width":1920,"height":1080,"recordDpi":1.75}}
|
||||
@@ -1,56 +0,0 @@
|
||||
(async function () {
|
||||
async function SwitchCurrentParty() {
|
||||
setGameMetrics(3840, 2160, 2);
|
||||
await genshin.tp(2297.60, -824.45);
|
||||
await sleep(3000);
|
||||
await genshin.returnMainUi();
|
||||
await sleep(2000);
|
||||
keyPress("L");
|
||||
await sleep(4500);
|
||||
click(100, 2050);
|
||||
await sleep(800);
|
||||
|
||||
for(let i = 0; i < 2; i++){
|
||||
await keyMouseScript.runFile(`assets/Team.json`);
|
||||
await sleep(800);
|
||||
}
|
||||
|
||||
click(100, 300);
|
||||
await sleep(800);
|
||||
click(100, 2050);
|
||||
await sleep(800);
|
||||
|
||||
for(let i = 1; i < settings.n; i++){
|
||||
click(3684, 1078);
|
||||
await sleep(800);
|
||||
}
|
||||
|
||||
click(3200, 2050);
|
||||
await sleep(1000);
|
||||
keyPress("Escape");
|
||||
await sleep(1000);
|
||||
|
||||
log.info("已切换至第"+ settings.n +"队");
|
||||
}
|
||||
|
||||
if (!!settings.partyName) {
|
||||
try {
|
||||
log.info("正在传送回七天神像切换队伍");
|
||||
await genshin.tp(2297.60, -824.45);
|
||||
await sleep(3000);
|
||||
log.info("正在尝试切换至" + settings.partyName);
|
||||
await genshin.switchParty(settings.partyName);
|
||||
} catch {
|
||||
log.warn("队伍切换失败,可能处于联机模式或其他不可切换状态");
|
||||
await genshin.returnMainUi();
|
||||
}
|
||||
} else {
|
||||
if (isNaN(settings.n)) {
|
||||
log.warn("不是戈门,你连几号队伍都还没设置,你想让BetterGI切换成啥啊?赶紧去设置一下。如果不会,那就去去看看《BetterGI快速入门》,认真学习一下怎么“修改JS脚本自定义设置”吧,要是这都学不会的话还是去宛平南路600号看看");
|
||||
}else if (settings.n <= 0 || settings.n > 15){
|
||||
log.warn("不是戈门,你...你设置了个啥啊,BetterGI这也没法切啊");
|
||||
}else{
|
||||
await SwitchCurrentParty();
|
||||
}
|
||||
}
|
||||
})();
|
||||
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"manifest_version": 1,
|
||||
"name": "返回七天神像切换指定队伍",
|
||||
"version": "1.0",
|
||||
"description": "回七天神像(脱战&回血),再按顺序切换指定队伍",
|
||||
"authors": [
|
||||
{
|
||||
"name": "LL&起个名字好难的喵"
|
||||
}
|
||||
],
|
||||
"settings_ui": "settings.json",
|
||||
"main": "main.js"
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
[
|
||||
{
|
||||
"name": "partyName",
|
||||
"type": "input-text",
|
||||
"label": "(二选一)需要切换的队伍名称"
|
||||
},
|
||||
{
|
||||
"name": "n",
|
||||
"type": "input-text",
|
||||
"label": "(二选一)需要切换的队伍序号"
|
||||
}
|
||||
|
||||
]
|
||||
@@ -5,12 +5,12 @@
|
||||
"author": "起个名字好难的喵",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgiVersion": "0.43.5"
|
||||
"bgiVersion": "0.44.4"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"action": "",
|
||||
"action": "exit_and_relogin",
|
||||
"move_mode": "dash",
|
||||
"type": "path",
|
||||
"x": 3614.6240234375,
|
||||
@@ -41,7 +41,7 @@
|
||||
"y": -521.4970703125,
|
||||
"type": "path",
|
||||
"move_mode": "dash",
|
||||
"action": "exit_and_relogin",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
"author": "起个名字好难的喵",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgiVersion": "0.43.5"
|
||||
"bgiVersion": "0.44.4"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 3614.63,
|
||||
"y": -521.6,
|
||||
"action": "",
|
||||
"action": "exit_and_relogin",
|
||||
"move_mode": "dash",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
@@ -84,7 +84,7 @@
|
||||
"id": 9,
|
||||
"x": 3614.63,
|
||||
"y": -521.6,
|
||||
"action": "exit_and_relogin",
|
||||
"action": "",
|
||||
"move_mode": "dash",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"author": "起个名字好难的喵",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgiVersion": "0.43.5"
|
||||
"bgiVersion": "0.44.4"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
@@ -31,15 +31,8 @@
|
||||
"y": -521.2724609375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "combat_script",
|
||||
"action_params": "wait(10)"
|
||||
},
|
||||
{
|
||||
"x": 3615.4814453125,
|
||||
"y": -521.2724609375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "exit_and_relogin"
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
async function AutoPath(locationName) {
|
||||
try {
|
||||
let filePath = `assets/AutoPath/${locationName}.json`;
|
||||
let filePath = `Assets/AutoPath/${locationName}.json`;
|
||||
await pathingScript.runFile(filePath);
|
||||
} catch (error) {
|
||||
log.error(`执行 ${locationName} 路径时发生错误`);
|
||||
@@ -31,27 +31,61 @@
|
||||
await sleep(1000);
|
||||
}
|
||||
|
||||
async function comparePosition() {
|
||||
const targetPosition = { X: 3615.48, Y: -521.27 };
|
||||
const maxDistance = 20;
|
||||
let currentPosition;
|
||||
|
||||
try {
|
||||
// 优先使用小地图坐标
|
||||
await genshin.returnMainUi();
|
||||
currentPosition = genshin.getPositionFromMap();
|
||||
log.info(`当前小地图坐标: X=${currentPosition.X}, Y=${currentPosition.Y}`);
|
||||
} catch (error) {
|
||||
// 如果失败,使用大地图坐标
|
||||
log.warn(`获取小地图坐标失败,使用大地图坐标。错误信息: ${error}`);
|
||||
await genshin.returnMainUi();
|
||||
keyPress("M");
|
||||
await sleep(2000);
|
||||
currentPosition = genshin.getPositionFromBigMap();
|
||||
log.info(`当前大地图坐标: X=${currentPosition.X}, Y=${currentPosition.Y}`);
|
||||
keyPress("Escape");
|
||||
}
|
||||
|
||||
// 计算欧氏距离
|
||||
const dx = currentPosition.X - targetPosition.X;
|
||||
const dy = currentPosition.Y - targetPosition.Y;
|
||||
const distance = Math.sqrt(dx * dx + dy * dy);
|
||||
|
||||
log.info(`与目标坐标的距离为: ${distance}`);
|
||||
|
||||
// 判断距离是否在允许范围内
|
||||
if (distance <= maxDistance) {
|
||||
log.info("距离在突发任务范围内,循环继续");
|
||||
return true;
|
||||
} else {
|
||||
log.warn("距离超出突发任务范围,执行触发线路");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 好感核心函数
|
||||
async function AutoFriendship(runTimes, statueTimes, GetMeatMode,startTime) {
|
||||
log.info(`导航至好感-张牙舞爪的恶党-触发位置(二净甸)`);
|
||||
await AutoPath(`好感-张牙舞爪的恶党-触发位置(二净甸)`);
|
||||
|
||||
log.info(`已抵达预期位置,兽肉好感循环开始...`);
|
||||
|
||||
for (let i = 0; i < runTimes; i++) {
|
||||
if ((i + 1) % statueTimes === 0) {
|
||||
await genshin.tp(2297.60, -824.45); // 神像坐标
|
||||
if ((i + 1) % statueTimes === 0) { // 判断当前循环次数否达到去神像设置值
|
||||
await genshin.tpToStatueOfTheSeven();
|
||||
await AutoPath(`好感-张牙舞爪的恶党-触发位置(二净甸)`);
|
||||
} else if (!await comparePosition()){ // 对比触发位置坐标,如果不符合预期坐标则重新执行触发线路
|
||||
log.info(`导航至好感-张牙舞爪的恶党-触发位置(二净甸)`);
|
||||
await AutoPath(`好感-张牙舞爪的恶党-触发位置(二净甸)`);
|
||||
log.info(`当前次数:${i + 1}/${runTimes}`);
|
||||
await AutoPath(`好感-张牙舞爪的恶党-循环${GetMeatMode ? '(二净甸刷肉版)' : '(二净甸)'}`);
|
||||
} else {
|
||||
log.info(`当前次数:${i + 1}/${runTimes}`);
|
||||
await AutoPath(`好感-张牙舞爪的恶党-循环${GetMeatMode ? '(二净甸刷肉版)' : '(二净甸)'}`);
|
||||
}
|
||||
log.info(`当前次数:${i + 1}/${runTimes}`);
|
||||
await AutoPath(`好感-张牙舞爪的恶党-循环${GetMeatMode ? '(二净甸刷肉版)' : '(二净甸)'}`);
|
||||
const estimatedCompletion = calculateEstimatedCompletion(startTime, i + 1, runTimes);
|
||||
log.info(`已完成次数:${i + 1}/${runTimes}`);
|
||||
logTimeTaken(startTime);
|
||||
log.info(`预计完成时间:${estimatedCompletion}`);
|
||||
await sleep(10000);
|
||||
}
|
||||
log.info('兽肉好感已完成');
|
||||
}
|
||||
@@ -92,7 +126,6 @@
|
||||
|
||||
// Main
|
||||
dispatcher.addTimer(new RealtimeTimer("AutoPick", { "forceInteraction": true }));
|
||||
const startTime = Date.now();
|
||||
let messages = [
|
||||
'请确保队伍满员,并为队伍配置相应的战斗策略',
|
||||
`使用的七天神像周期为: ${statueTimes}`,
|
||||
@@ -107,8 +140,8 @@
|
||||
// 切换队伍
|
||||
if (!!settings.partyName) {
|
||||
try {
|
||||
await genshin.tp(2297.60, -824.45);
|
||||
await sleep(3000);
|
||||
await genshin.tpToStatueOfTheSeven();
|
||||
await sleep(2000);
|
||||
log.info("正在尝试切换至" + settings.partyName);
|
||||
await genshin.switchParty(settings.partyName);
|
||||
} catch {
|
||||
@@ -119,6 +152,7 @@
|
||||
await genshin.returnMainUi();
|
||||
}
|
||||
|
||||
const startTime = Date.now();
|
||||
await AutoFriendship(runTimes,statueTimes,GetMeatMode,startTime);
|
||||
log.info(`兽肉好感运行总时长:${LogTimeTaken(startTime)}`);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"manifest_version": 1,
|
||||
"name": "兽肉好感:自动好感度&刷两只鳄鱼兽肉&卡时间",
|
||||
"version": "1.2.0",
|
||||
"version": "1.3.0",
|
||||
"description": "通过突发事件:张牙舞爪的恶党刷兽肉,并顺带获取好感度(超过10次后不再获取),请使用满员好感度队伍,并为全体队伍角色配置相应的战斗策略",
|
||||
"authors": [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user