archive js
BIN
archive/js/5_7PVP_Auto/assets/buff.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
archive/js/5_7PVP_Auto/assets/button1.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
archive/js/5_7PVP_Auto/assets/button2.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
archive/js/5_7PVP_Auto/assets/button3.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
archive/js/5_7PVP_Auto/assets/finish1.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
archive/js/5_7PVP_Auto/assets/finish2.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
archive/js/5_7PVP_Auto/assets/goal.png
Normal file
|
After Width: | Height: | Size: 876 B |
103
archive/js/5_7PVP_Auto/lib.js
Normal file
@@ -0,0 +1,103 @@
|
||||
//eval(file.readTextSync("lib.js"));
|
||||
|
||||
|
||||
const width = genshin.width;
|
||||
const height = genshin.height;
|
||||
|
||||
function clickf(x, y) {
|
||||
click(Math.round(width * x), Math.round(height * y));
|
||||
}
|
||||
function movetof(x, y) {
|
||||
moveMouseTo(Math.round(width * x), Math.round(height * y));
|
||||
}
|
||||
function get_config(name, defval) {
|
||||
let t = settings[name];
|
||||
return typeof (t) === 'undefined' ? defval : t;
|
||||
}
|
||||
function get_config_int(name, defval) {
|
||||
return parseInt(get_config(name, defval), 10);
|
||||
}
|
||||
|
||||
|
||||
class OCRError extends Error {
|
||||
constructor(message, options) { super(message, options); }
|
||||
}
|
||||
|
||||
|
||||
setGameMetrics(genshin.width, genshin.height, 1); // 设置游戏窗口大小和DPI
|
||||
function test1() {
|
||||
log.info(`窗口大小: ${genshin.width} * ${genshin.height}`);
|
||||
let a = captureGameRegion();
|
||||
log.info(`截图:x=${a.x} y=${a.y} w=${a.width} h=${a.height} l=${a.left} t=${a.top} r=${a.right} b=${a.bottom}`);
|
||||
}
|
||||
const global_region = captureGameRegion();
|
||||
//test1();
|
||||
|
||||
function template(filename, x, y, w, h, center = true) {
|
||||
if (center) { x = x - w / 2; y = y - h / 2; }
|
||||
return RecognitionObject.TemplateMatch(file.ReadImageMatSync(filename), 1920 * x, 1080 * y, 1920 * w, 1080 * h);
|
||||
//return RecognitionObject.TemplateMatch(file.ReadImageMatSync(filename), genshin.width * x, genshin.height * y, genshin.width * w, genshin.height * h);
|
||||
}
|
||||
function template_ocr(x, y, w, h, center = true) {
|
||||
if (center) { x = x - w / 2; y = y - h / 2; }
|
||||
return RecognitionObject.Ocr(1920 * x, 1080 * y, 1920 * w, 1080 * h);
|
||||
}
|
||||
|
||||
function draw_obj(obj, name = "test") {
|
||||
const r = obj.RegionOfInterest;
|
||||
let s = global_region.deriveCrop(r.x, r.y, r.width, r.height);
|
||||
s.DrawSelf(name);
|
||||
}
|
||||
|
||||
async function match_click(obj, desc, click = true, timeout = 15000) {
|
||||
draw_obj(obj, "match");
|
||||
await sleep(1000);
|
||||
const start = Date.now();
|
||||
let x = 1;
|
||||
while (Date.now() - start < timeout) {
|
||||
let result = captureGameRegion().Find(obj);
|
||||
await sleep(800);
|
||||
if (result.isExist()) {
|
||||
result.drawSelf("match_found");
|
||||
if (click) {
|
||||
result.click();
|
||||
log.info(`成功识别并点击 ${desc},耗时${Date.now() - start}ms`);
|
||||
} else {
|
||||
log.info(`成功识别到 ${desc},耗时${Date.now() - start}ms`);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
log.info(`第${x}次识别并点击 ${desc} 失败,耗时${Date.now() - start}ms`);
|
||||
x++;
|
||||
await sleep(1000);
|
||||
}
|
||||
throw new OCRError(`等待超时,未找到目标 ${desc}`);
|
||||
}
|
||||
|
||||
async function ocr_click(obj, desc, click = true, timeout = 15000) {
|
||||
draw_obj(obj, "ocr");
|
||||
await sleep(1000);
|
||||
const start = Date.now();
|
||||
let x = 1;
|
||||
while (Date.now() - start < timeout) {
|
||||
let results = captureGameRegion().findMulti(obj);
|
||||
if (results.Count != 1) {
|
||||
log.warn(`搜索到${results.Count}个结果(预期为1个)`);
|
||||
}
|
||||
await sleep(800);
|
||||
if (results.Count == 1) {
|
||||
results[0].drawSelf("ocr_found");
|
||||
if (click) {
|
||||
results[0].click();
|
||||
log.info(`成功Ocr识别并点击 ${desc}, 耗时${Date.now() - start}ms`);
|
||||
} else {
|
||||
log.info(`成功Ocr识别到 ${desc}, 耗时${Date.now() - start}ms`)
|
||||
}
|
||||
return results[0];
|
||||
}
|
||||
log.info(`第${x}次Ocr识别并点击 ${desc} 失败,耗时${Date.now() - start}ms`);
|
||||
x++;
|
||||
await sleep(1000);
|
||||
}
|
||||
throw new OCRError(`等待超时,未找到Ocr目标 ${desc}`);
|
||||
}
|
||||
257
archive/js/5_7PVP_Auto/main.js
Normal file
@@ -0,0 +1,257 @@
|
||||
eval(file.readTextSync("lib.js"));
|
||||
|
||||
const CHAR_X = get_config_int("char_x", 0);
|
||||
const CHAR_Y = get_config_int("char_y", 0);
|
||||
|
||||
const global_region = captureGameRegion();
|
||||
|
||||
const btn_details = template("assets/button1.png", 0.77, 0.75, 0.04, 0.08, true);
|
||||
const btn_startmatch = template("assets/button2.png", 0.832, 0.95, 0.04, 0.08, true);
|
||||
const btn_acceptmatch = template("assets/button1.png", 0.528, 0.68, 0.04, 0.08, true);
|
||||
const btn_closetip = template("assets/button3.png", 0.978, 0.35, 0.043, 0.075, true);
|
||||
const buff_icon = template("assets/buff.png", 0.068, 0.204, 0.03, 0.05, true);
|
||||
const btn_confirm = template("assets/button1.png", 0.832, 0.95, 0.04, 0.08, true);
|
||||
const goal_icon = template("assets/goal.png", 0.031, 0.3125 + 0.035 * 1, 0.012, 0.018 + 0.035 * 2);
|
||||
const btn_finish1 = template("assets/finish1.png", 0.5, 0.805, 0.042, 0.026, true);
|
||||
const btn_finish2 = template("assets/finish2.png", 0.5, 0.805, 0.029, 0.026, true);
|
||||
|
||||
const score = template_ocr(0.162, 0.415, 0.1, 0.06, false);
|
||||
const matching_tip = template_ocr(0.35, 0.77, 0.12, 0.08, false);
|
||||
|
||||
const ACT_KEYS = ["W", "S", "A", "D"];
|
||||
|
||||
/// Press F5 and click on Details button
|
||||
async function F5_and_click() {
|
||||
await keyPress("F5");
|
||||
await sleep(1000);
|
||||
|
||||
for (let i = 0; i < 3; i++) {
|
||||
clickf(0.182, 0.255);
|
||||
await sleep(500);
|
||||
}
|
||||
|
||||
await match_click(btn_details, "活动详情按钮");
|
||||
await sleep(2000);
|
||||
}
|
||||
|
||||
async function start_minigame() {
|
||||
let should_retry = false;
|
||||
while (true) {
|
||||
// 点击开始匹配按钮
|
||||
try {
|
||||
await match_click(btn_startmatch, "开始匹配", true, 10000);
|
||||
await sleep(2000);
|
||||
} catch (e) {
|
||||
log.warn("点击匹配按钮失败,暂时跳过");
|
||||
}
|
||||
|
||||
// 匹配中,准备点击接受按钮
|
||||
should_retry = false;
|
||||
while (true) {
|
||||
let screen = captureGameRegion();
|
||||
await sleep(800);
|
||||
|
||||
// 确保还在匹配状态
|
||||
let tip = screen.Find(matching_tip);
|
||||
if (tip.isExist() && tip.text.startsWith("匹配中")) {
|
||||
} else {
|
||||
log.warn("匹配状态异常,即将重试");
|
||||
should_retry = true;
|
||||
break;
|
||||
}
|
||||
|
||||
let btn = screen.Find(btn_acceptmatch);
|
||||
if (btn.isExist()) {
|
||||
log.info("匹配成功,接受");
|
||||
await sleep(500);
|
||||
btn.click();
|
||||
break;
|
||||
}
|
||||
|
||||
await sleep(1000);
|
||||
}
|
||||
if (should_retry) {
|
||||
await sleep(5000);
|
||||
continue;
|
||||
}
|
||||
|
||||
await sleep(8000);
|
||||
|
||||
// 可能进入战斗准备界面,或匹配失败退回
|
||||
should_retry = false;
|
||||
log.info("等待进入选择角色界面")
|
||||
while (true) {
|
||||
await sleep(1000);
|
||||
let screen = captureGameRegion();
|
||||
draw_obj(btn_startmatch, "start");
|
||||
draw_obj(btn_closetip, "close");
|
||||
await sleep(800);
|
||||
|
||||
if (screen.Find(btn_startmatch).isExist()) {
|
||||
log.warn("匹配失败,即将重试");
|
||||
await sleep(3000);
|
||||
should_retry = true;
|
||||
break;
|
||||
}
|
||||
|
||||
let close = screen.Find(btn_closetip);
|
||||
if (close.isExist()) {
|
||||
close.drawSelf("close_found");
|
||||
log.info("已经进入选择角色界面");
|
||||
await sleep(500);
|
||||
close.click();
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (should_retry) {
|
||||
await sleep(5000);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
throw new Error("Unreachable");
|
||||
}
|
||||
|
||||
function click_char(x, y) {
|
||||
movetof(0.057 + x * 0.073, 0.169 + y * 0.157);
|
||||
clickf(0.057 + x * 0.073, 0.169 + y * 0.157);
|
||||
}
|
||||
|
||||
async function play(times) {
|
||||
for (let ii = 0; ii < times; ii++) {
|
||||
keyPress("Q");
|
||||
await sleep(500);
|
||||
keyPress("E");
|
||||
await sleep(500);
|
||||
let act = Math.floor(Math.random() * 8);
|
||||
let act_key = ACT_KEYS[act % 4];
|
||||
switch (act) {
|
||||
case 0: case 1: case 2: case 3:
|
||||
keyDown("SHIFT");
|
||||
keyDown(act_key);
|
||||
await sleep(1000);
|
||||
keyUp(act_key);
|
||||
keyUp("SHIFT");
|
||||
break;
|
||||
case 4:
|
||||
// 空格跳跃1秒
|
||||
keyDown("SPACE");
|
||||
await sleep(1000);
|
||||
keyUp("SPACE");
|
||||
break;
|
||||
case 5: case 6: case 7:
|
||||
// 左键连续普攻
|
||||
for (let i = 0; i < 5; i++) {
|
||||
leftButtonDown();
|
||||
await sleep(100);
|
||||
leftButtonUp();
|
||||
await sleep(100);
|
||||
}
|
||||
middleButtonClick();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
await sleep(500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
async function one_shot() {
|
||||
await sleep(1000);
|
||||
log.info("任务开始");
|
||||
await genshin.returnMainUi();
|
||||
await sleep(1000);
|
||||
|
||||
log.info("进入活动界面");
|
||||
await F5_and_click();
|
||||
|
||||
log.info("读取当前分数");
|
||||
let score_obj = await ocr_click(score, "活动分数", false);
|
||||
let score_re = score_obj.text.match(/(\d+)\s*\/\s*(\d+)/);
|
||||
let cur_score = -1, max_score = -1;
|
||||
if (score_re && score_re.length >= 3) {
|
||||
cur_score = Number(score_re[1]);
|
||||
max_score = Number(score_re[2]);
|
||||
log.info(`当前分数:${cur_score}/${max_score}`);
|
||||
} else {
|
||||
throw new Error(`分数解析失败:${score_obj.text}`);
|
||||
}
|
||||
|
||||
if (cur_score >= max_score) {
|
||||
log.info("活动完成");
|
||||
return false;
|
||||
}
|
||||
|
||||
log.info("尝试匹配并进入小游戏");
|
||||
await start_minigame();
|
||||
await sleep(3000);
|
||||
|
||||
log.info("选择角色");
|
||||
await sleep(500);
|
||||
click_char(CHAR_X, CHAR_Y);
|
||||
await sleep(500);
|
||||
await match_click(btn_confirm, "确认角色选择");
|
||||
await sleep(500);
|
||||
|
||||
log.info("等待buff选择界面");
|
||||
while (true) {
|
||||
if (captureGameRegion().Find(buff_icon).isExist()) {
|
||||
break;
|
||||
}
|
||||
await sleep(5000);
|
||||
}
|
||||
await sleep(1000);
|
||||
|
||||
log.info("选择buff");
|
||||
clickf(0.25, 0.26);
|
||||
await sleep(500);
|
||||
await match_click(btn_confirm, "确认buff选择");
|
||||
await sleep(500);
|
||||
|
||||
log.info("等待游戏开始");
|
||||
await sleep(5000);
|
||||
log.info("等待游戏提示出现");
|
||||
while (true) {
|
||||
draw_obj(goal_icon);
|
||||
let result = captureGameRegion().FindMulti(goal_icon);
|
||||
await sleep(500);
|
||||
if (result.count != 3) { await sleep(5000); continue; }
|
||||
await sleep(1000);
|
||||
break;
|
||||
}
|
||||
|
||||
log.info("随机行动");
|
||||
while (true) {
|
||||
await play(15);
|
||||
let result = captureGameRegion().Find(btn_finish1);
|
||||
if (result.isExist()) {
|
||||
log.info("完成,点击结算按钮1");
|
||||
result.click();
|
||||
break;
|
||||
}
|
||||
await sleep(1000);
|
||||
}
|
||||
await sleep(1000);
|
||||
await match_click(btn_finish2, "退出活动");
|
||||
await sleep(10000);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
(async function () {
|
||||
let count = 0;
|
||||
while (true) {
|
||||
count++;
|
||||
if (!await one_shot()) break;
|
||||
await genshin.returnMainUi();
|
||||
await sleep(2000);
|
||||
await genshin.returnMainUi();
|
||||
await sleep(2000);
|
||||
log.info("第${count}次游戏结束,重新开始");
|
||||
}
|
||||
log.info("结束运行,可能是分数已满");
|
||||
|
||||
return;
|
||||
})();
|
||||
14
archive/js/5_7PVP_Auto/manifest.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"manifest_version": 1,
|
||||
"name": "PVP活动自动化:5.7",
|
||||
"version": "5.7.0",
|
||||
"bgi_version": "0.45.0",
|
||||
"description": "自动完成5.7版本联机PVP活动。可在脚本设置中自行选择上场角色。如果之前没有玩过这个活动,第一次运行建议人工监视到进入战斗界面,中间弹出的教学界面需要手动关掉,否则会执行失败!作者为:pans82@proton.me",
|
||||
"authors": [
|
||||
{
|
||||
"name": "pans82"
|
||||
}
|
||||
],
|
||||
"settings_ui": "settings.json",
|
||||
"main": "main.js"
|
||||
}
|
||||
12
archive/js/5_7PVP_Auto/settings.json
Normal file
@@ -0,0 +1,12 @@
|
||||
[
|
||||
{
|
||||
"name": "char_x",
|
||||
"type": "input-text",
|
||||
"label": "角色列号,0~3,默认0"
|
||||
},
|
||||
{
|
||||
"name": "char_y",
|
||||
"type": "input-text",
|
||||
"label": "角色行号,0~4,默认0"
|
||||
}
|
||||
]
|
||||
36
archive/js/PathingBenchmark/assets/Benchmark/传送速度测试.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "传送速度测试",
|
||||
"type": "collect",
|
||||
"author": "HZYgrandma",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgi_version": "0.35.0"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": -1629.36328125,
|
||||
"y": 2834.419921875
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"x": -321.7978515625,
|
||||
"y": 1473.583984375,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": -1999.125,
|
||||
"y": 1434.90380859375,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
76
archive/js/PathingBenchmark/assets/Benchmark/寻路速度测试.json
Normal file
@@ -0,0 +1,76 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "寻路速度测试",
|
||||
"type": "collect",
|
||||
"author": "HZYgrandma",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgi_version": "0.35.0"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": -1999.0830078125,
|
||||
"y": 1434.9326171875,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "teleport"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": -2070.6396484375,
|
||||
"y": 1413.53515625,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": -2143.72265625,
|
||||
"y": 1485.27880859375,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "target"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": -2140.0869140625,
|
||||
"y": 1547.9375,
|
||||
"action": "",
|
||||
"move_mode": "run",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": -2065.7763671875,
|
||||
"y": 1586.3212890625,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "target"
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"x": -2021.23046875,
|
||||
"y": 1536.51171875,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"x": -1995.1162109375,
|
||||
"y": 1483.43212890625,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"x": -2002.0029296875,
|
||||
"y": 1442.0478515625,
|
||||
"action": "",
|
||||
"move_mode": "run",
|
||||
"type": "target"
|
||||
}
|
||||
]
|
||||
}
|
||||
100
archive/js/PathingBenchmark/assets/Benchmark/抗打断测试.json
Normal file
@@ -0,0 +1,100 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "抗打断测试",
|
||||
"type": "collect",
|
||||
"author": "HZYgrandma",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgi_version": "0.35.0"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 4,
|
||||
"x": -1273.7822265625,
|
||||
"y": 2721.7109375,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": ""
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": -1275.470703125,
|
||||
"y": 2754.51025390625,
|
||||
"type": "path",
|
||||
"move_mode": "run",
|
||||
"action": ""
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"x": -1289.6181640625,
|
||||
"y": 2780.678955078125,
|
||||
"type": "target",
|
||||
"move_mode": "walk",
|
||||
"action": ""
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"x": -1276.720703125,
|
||||
"y": 2784.83203125,
|
||||
"type": "path",
|
||||
"move_mode": "run",
|
||||
"action": ""
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"x": -1225.1103515625,
|
||||
"y": 2792.60009765625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": ""
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"x": -1219.517578125,
|
||||
"y": 2788.16259765625,
|
||||
"type": "path",
|
||||
"move_mode": "run",
|
||||
"action": ""
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"x": -1208.072265625,
|
||||
"y": 2776.15966796875,
|
||||
"type": "target",
|
||||
"move_mode": "walk",
|
||||
"action": ""
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"x": -1187.6162109375,
|
||||
"y": 2752.934326171875,
|
||||
"type": "path",
|
||||
"move_mode": "run",
|
||||
"action": ""
|
||||
},
|
||||
{
|
||||
"id": 12,
|
||||
"x": -1173.4970703125,
|
||||
"y": 2741.677978515625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": ""
|
||||
},
|
||||
{
|
||||
"id": 13,
|
||||
"x": -1180.5546875,
|
||||
"y": 2738.550537109375,
|
||||
"type": "path",
|
||||
"move_mode": "run",
|
||||
"action": ""
|
||||
},
|
||||
{
|
||||
"id": 14,
|
||||
"x": -1172.67578125,
|
||||
"y": 2714.897705078125,
|
||||
"type": "target",
|
||||
"move_mode": "walk",
|
||||
"action": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
36
archive/js/PathingBenchmark/assets/Benchmark/攀爬速度测试.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "攀爬速度测试",
|
||||
"type": "collect",
|
||||
"author": "HZYgrandma",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgi_version": "0.35.0"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": -1629.373046875,
|
||||
"y": 2834.40283203125
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": -1611.1640625,
|
||||
"y": 2823.08056640625,
|
||||
"type": "path",
|
||||
"move_mode": "climb",
|
||||
"action": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": -1602.9296875,
|
||||
"y": 2819.64990234375,
|
||||
"type": "path",
|
||||
"move_mode": "climb",
|
||||
"action": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
36
archive/js/PathingBenchmark/assets/Benchmark/游泳速度测试.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "游泳速度测试",
|
||||
"type": "collect",
|
||||
"author": "HZYgrandma",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgi_version": "0.35.0"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": -1120.90234375,
|
||||
"y": 2190.519287109375
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": -1078.2978515625,
|
||||
"y": 2216.023681640625,
|
||||
"type": "path",
|
||||
"move_mode": "swim",
|
||||
"action": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": -979.3251953125,
|
||||
"y": 2283.71728515625,
|
||||
"type": "path",
|
||||
"move_mode": "swim",
|
||||
"action": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
36
archive/js/PathingBenchmark/assets/Benchmark/飞行速度测试.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "飞行速度测试",
|
||||
"type": "collect",
|
||||
"author": "HZYgrandma",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgi_version": "0.35.0"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": -1536.8916015625,
|
||||
"y": 1978.646484375
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": -1479.0283203125,
|
||||
"y": 1869.71875,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": -1476.4248046875,
|
||||
"y": 1864.8203125,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "stop_flying"
|
||||
}
|
||||
]
|
||||
}
|
||||
56
archive/js/PathingBenchmark/main.js
Normal file
@@ -0,0 +1,56 @@
|
||||
(async function () {
|
||||
dispatcher.addTimer(new RealtimeTimer("AutoPick"));
|
||||
|
||||
async function AutoPath(locationName) {
|
||||
let filePath = `assets/Benchmark/${locationName}.json`;
|
||||
await pathingScript.runFile(filePath);
|
||||
await sleep(1000);
|
||||
}
|
||||
|
||||
function logScore(startTime, testName) {
|
||||
const endTime = Date.now();
|
||||
const timeTaken = (endTime - startTime) / 1000;
|
||||
const presetTimes = {
|
||||
'传送速度测试': 4500,
|
||||
'飞行速度测试': 3000,
|
||||
'游泳速度测试': 6000,
|
||||
'攀爬速度测试': 7000,
|
||||
'寻路速度测试': 12000,
|
||||
'抗打断测试': 9000
|
||||
};
|
||||
const score = presetTimes[testName] / timeTaken;
|
||||
log.info(`完成 ${testName} ,得分 ${score.toFixed(2)}`);
|
||||
return score;
|
||||
}
|
||||
|
||||
async function runTest(testName, weight) {
|
||||
const startTime = Date.now();
|
||||
log.info('进行 {name}', testName);
|
||||
await AutoPath(testName);
|
||||
const score = await logScore(startTime, testName);
|
||||
scores.push({ name: testName, score, weight });
|
||||
}
|
||||
|
||||
const weights = {
|
||||
'传送速度测试': 0.1,
|
||||
'飞行速度测试': 0.1,
|
||||
'游泳速度测试': 0.1,
|
||||
'攀爬速度测试': 0.1,
|
||||
'抗打断测试': 0.1,
|
||||
'寻路速度测试': 0.5
|
||||
};
|
||||
|
||||
const scores = [];
|
||||
|
||||
await runTest('传送速度测试', weights['传送速度测试']);
|
||||
await runTest('飞行速度测试', weights['飞行速度测试']);
|
||||
await runTest('游泳速度测试', weights['游泳速度测试']);
|
||||
await runTest('攀爬速度测试', weights['攀爬速度测试']);
|
||||
await runTest('寻路速度测试', weights['寻路速度测试']);
|
||||
await runTest('抗打断测试', weights['抗打断测试']);
|
||||
|
||||
// 计算加权总得分
|
||||
const totalWeightedScore = scores.reduce((sum, item) => sum + item.score * item.weight, 0);
|
||||
log.info(`加权总得分:${totalWeightedScore.toFixed(2)}`);
|
||||
keyPress("m");
|
||||
})();
|
||||
13
archive/js/PathingBenchmark/manifest.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"manifest_version": 1,
|
||||
"name": "路径追踪配队跑分",
|
||||
"version": "1.0",
|
||||
"description": "对配队的路径追踪性能进行量化呈现",
|
||||
"authors": [
|
||||
{
|
||||
"name": "HZYgrandma",
|
||||
"links": "https://github.com/HZYgrandma"
|
||||
}
|
||||
],
|
||||
"main": "main.js"
|
||||
}
|
||||
14
archive/js/SereniteaPot/README.md
Normal file
@@ -0,0 +1,14 @@
|
||||
1、使用前将JS脚本添加到调度器,右键修改JS脚本自定义配置,选择宅邸的建筑类型
|
||||
|
||||
根据请根据宅邸类型选择自定义配置
|
||||
罗浮洞、翠黛峰 默认使用“默认宅邸类型.png”左2的宅邸,即璃月绿顶建筑;
|
||||
清琼岛 默认使用“默认宅邸类型.png”左1的宅邸,即蒙德红顶建筑;
|
||||
绘绮庭 默认使用“默认宅邸类型.png”左3的宅邸,即稻妻蓝顶建筑;
|
||||
妙香林 默认使用“默认宅邸类型.png”左4的宅邸,即须弥绿色建筑;
|
||||
旋流屿 默认使用“默认宅邸类型.png”左5的宅邸,即枫丹白色建筑;
|
||||
|
||||
2、确保4个快捷道具都装备上了
|
||||
3、请在平坦区域运行此脚本
|
||||
|
||||
V1.1修复了自定义选项与实际不匹配的BUG
|
||||
V1.2完善了自定义选项,使之更符合使用习惯
|
||||
75
archive/js/SereniteaPot/main.js
Normal file
@@ -0,0 +1,75 @@
|
||||
(async function () {
|
||||
setGameMetrics(1920, 1080, 2);
|
||||
// 来自于界面配置
|
||||
let sereniteaPotType = settings.sereniteaPot;
|
||||
log.info('快捷道具栏需装满4个,确保尘歌壶在第5位');
|
||||
setGameMetrics(1920, 1080, 2);
|
||||
await sleep(1000);
|
||||
keyPress("B"); //打开背包
|
||||
await sleep(1000);
|
||||
click(1058, 48); //小道具
|
||||
await sleep(500);
|
||||
click(765, 190); //背包第5位(诚哥壶)
|
||||
await sleep(500);
|
||||
click(1700, 1018); //放置
|
||||
await sleep(1000);
|
||||
keyPress("F"); //进入诚哥壶
|
||||
await sleep(10000);
|
||||
|
||||
if (sereniteaPotType == "璃月绿顶建筑"){
|
||||
log.info("璃月绿顶建筑");
|
||||
keyDown("D");
|
||||
await sleep(500);
|
||||
keyUp("D");
|
||||
await sleep(500);
|
||||
}else if(sereniteaPotType == "蒙德红顶建筑"){
|
||||
log.info("蒙德红顶建筑");
|
||||
keyDown("A");
|
||||
await sleep(1200);
|
||||
keyUp("A");
|
||||
await sleep(500);
|
||||
}else if(sereniteaPotType == "稻妻蓝顶建筑"){
|
||||
log.info("稻妻蓝顶建筑");
|
||||
keyDown("A");
|
||||
await sleep(1700);
|
||||
keyUp("A");
|
||||
await sleep(500);
|
||||
keyDown("S");
|
||||
await sleep(1700);
|
||||
keyUp("S");
|
||||
await sleep(500);
|
||||
}else if(sereniteaPotType == "须弥绿色建筑"){
|
||||
log.info("须弥绿色建筑");
|
||||
keyDown("D");
|
||||
await sleep(1300);
|
||||
keyUp("D");
|
||||
await sleep(500);
|
||||
}else if(sereniteaPotType == "枫丹白色建筑"){
|
||||
log.info("枫丹白色建筑");
|
||||
keyDown("S");
|
||||
await sleep(1300);
|
||||
keyUp("S");
|
||||
await sleep(500);
|
||||
keyDown("A");
|
||||
await sleep(500);
|
||||
keyUp("A");
|
||||
await sleep(500);
|
||||
}else{
|
||||
}
|
||||
keyPress("F"); //阿圆对话
|
||||
await sleep(2000);
|
||||
click(1081, 955); //跳过对话
|
||||
await sleep(2000);
|
||||
click(1383, 430); //信任等阶
|
||||
await sleep(2000);
|
||||
click(1081, 955); //宝钱
|
||||
await sleep(2000);
|
||||
click(1812, 716); //好感度
|
||||
await sleep(2000);
|
||||
click(1863, 48);; //返回
|
||||
await sleep(5000);
|
||||
click(1356, 804); //再见1
|
||||
await sleep(2000);
|
||||
click(1356, 804); //再见2
|
||||
await sleep(1000);
|
||||
})();
|
||||
14
archive/js/SereniteaPot/manifest.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"manifest_version": 1,
|
||||
"name": "尘歌壶",
|
||||
"version": "1.2",
|
||||
"description": "自动领诚哥壶奖励",
|
||||
"authors": [
|
||||
{
|
||||
"name": "愚溪",
|
||||
"links": "https://github.com/Kupder"
|
||||
}
|
||||
],
|
||||
"settings_ui": "settings.json",
|
||||
"main": "main.js"
|
||||
}
|
||||
14
archive/js/SereniteaPot/settings.json
Normal file
@@ -0,0 +1,14 @@
|
||||
[
|
||||
{
|
||||
"name": "sereniteaPot",
|
||||
"type": "select",
|
||||
"label": "宅邸类型",
|
||||
"options": [
|
||||
"蒙德红顶建筑",
|
||||
"璃月绿顶建筑",
|
||||
"稻妻蓝顶建筑",
|
||||
"须弥绿色建筑",
|
||||
"枫丹白色建筑"
|
||||
]
|
||||
}
|
||||
]
|
||||
BIN
archive/js/SereniteaPot/默认宅邸类型.jpg
Normal file
|
After Width: | Height: | Size: 40 KiB |