Compare commits

...

6 Commits

Author SHA1 Message Date
MisakaAldrich
f26d7f1526 update repo.json
Some checks failed
Build repo.json / build (18.x) (push) Has been cancelled
Build repo.json / upload (push) Has been cancelled
2025-07-23 15:45:20 +00:00
b118297cde 狗粮pro 7.23 (#1391)
1.炮台偶尔出现"当前状态无法使用",多按一次"F"尝试优化
2.428花海偶尔被木箱卡死,改变角度
2025-07-23 23:44:55 +08:00
huiyadanli
e9db2bae73 update repo.json 2025-07-23 13:49:00 +00:00
Because
2293b5ab56 提交对5.7活动的自动化脚本。 (#1390)
Co-authored-by: 辉鸭蛋 <huiyadanli@gmail.com>
2025-07-23 21:48:31 +08:00
MisakaAldrich
ce220c5d83 update repo.json 2025-07-23 09:07:34 +00:00
起个名字好难的喵
c959f34248 JS: 双倍好感部分log藏入debug 2025-07-23 17:07:09 +08:00
20 changed files with 453 additions and 28 deletions

View File

@@ -1,5 +1,5 @@
{
"time": "20250723111305",
"time": "20250723234518",
"url": "https://github.com/babalae/bettergi-scripts-list/archive/refs/heads/main.zip",
"file": "repo.json",
"indexes": [
@@ -70139,6 +70139,23 @@
"name": "js",
"type": "directory",
"children": [
{
"name": "5_7PVP_Auto",
"type": "directory",
"hash": "57a55cb4cb28be2414ecffea204af3bd9a9612f4",
"version": "5.7.0",
"author": "pans82",
"authors": [
{
"name": "pans82"
}
],
"description": "PVP活动自动化5.7~|~自动完成5.7版本联机PVP活动。可在脚本设置中自行选择上场角色。如果之前没有玩过这个活动第一次运行建议人工监视到进入战斗界面中间弹出的教学界面需要手动关掉否则会执行失败作者为pans82@proton.me",
"tags": [
"bgi≥0.45.0"
],
"lastUpdated": "2025-07-23 21:48:31"
},
{
"name": "AEscoffier_chef",
"type": "directory",
@@ -70238,8 +70255,8 @@
{
"name": "AutoArtifactsPro",
"type": "directory",
"hash": "22e55eb4a3bbb2f5d512b9b7a1f3895594538998",
"version": "1.6.7",
"hash": "5a1d527abc0fb0cb14099cf8ef9ba6b8dffd8b99",
"version": "1.6.8",
"author": "mno",
"authors": [
{
@@ -70260,7 +70277,7 @@
"好感",
"狗粮"
],
"lastUpdated": "2025-07-22 22:50:43"
"lastUpdated": "2025-07-23 23:44:55"
},
{
"name": "AutoArtifactsSalvageOrDestroy1-4star",

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 876 B

103
repo/js/5_7PVP_Auto/lib.js Normal file
View 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
repo/js/5_7PVP_Auto/main.js Normal file
View 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;
})();

View 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"
}

View 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"
}
]

View File

@@ -171,6 +171,10 @@ https://www.kdocs.cn/wo/sl/v13uXscL
## 更新日志
### 1.6.82025.07.23
1.炮台偶尔出现"当前状态无法使用",多按一次"F"尝试优化
2.428花海偶尔被木箱卡死,改变角度
### 1.6.72025.07.22
1.让狗粮结束后[芙宁娜]变回黑芙,不影响后续战斗
### 1.6.62025.07.22

View File

@@ -140,7 +140,7 @@
"y": -3681.7453963194985,
"action": "combat_script",
"move_mode": "walk",
"action_params": "w(1),wait(1),keypress(f),wait(0.5),keypress(RETURN),wait(9.5),keypress(f),wait(0.4),keypress(w),wait(9.5),keypress(f),wait(0.4),keypress(w),wait(3.2),keypress(f),wait(0.4),keypress(d),wait(3.2),keypress(f),wait(0.4),keypress(d),wait(3.2),keypress(f),wait(0.4),keypress(d),wait(3.2),keypress(f),wait(0.4),keypress(RETURN),wait(3.2),keypress(f),wait(0.4),keypress(a),wait(3.2),keypress(f),wait(0.4),keypress(a),wait(3.2),keypress(f),wait(0.4),keypress(a),wait(3.2),keypress(f),wait(0.4),keypress(s),wait(0.5),keypress(ESCAPE),wait(1),s(0.3),dash,s(0.3),dash,s(0.3),dash,s(0.3),dash",
"action_params": "w(1),wait(1),keypress(f),wait(0.5),keypress(f),wait(0.5),keypress(RETURN),wait(9.5),keypress(f),wait(0.4),keypress(w),wait(9.5),keypress(f),wait(0.4),keypress(w),wait(3.2),keypress(f),wait(0.4),keypress(d),wait(3.2),keypress(f),wait(0.4),keypress(d),wait(3.2),keypress(f),wait(0.4),keypress(d),wait(3.2),keypress(f),wait(0.4),keypress(RETURN),wait(3.2),keypress(f),wait(0.4),keypress(a),wait(3.2),keypress(f),wait(0.4),keypress(a),wait(3.2),keypress(f),wait(0.4),keypress(a),wait(3.2),keypress(f),wait(0.4),keypress(s),wait(0.5),keypress(ESCAPE),wait(1),s(0.3),dash,s(0.3),dash,s(0.3),dash,s(0.3),dash",
"type": "orientation"
},
{

View File

@@ -13,7 +13,7 @@
"map_name": "Teyvat",
"bgi_version": "0.45.0",
"tags": [],
"last_modified_time": 1752679153967,
"last_modified_time": 1753284910049,
"enable_monster_loot_split": false
},
"positions": [
@@ -82,8 +82,8 @@
},
{
"id": 8,
"x": 5593.375055301161,
"y": 827.406174210183,
"x": 5594.205078125,
"y": 826.916015625,
"action": "",
"move_mode": "run",
"action_params": "",
@@ -91,11 +91,11 @@
},
{
"id": 9,
"x": 5590.968783575705,
"y": 825.5312196840732,
"x": 5591.455078125,
"y": 825.72900390625,
"action": "combat_script",
"move_mode": "climb",
"action_params": "keypress(f),w(0.2),keypress(f),d(0.3),keypress(f),attack(0.08),wait(0.3);万叶 attack(0.08),keydown(E),wait(0.51),keyup(E),attack(0.2),wait(0.5);琴 attack(0.08),keydown(E),wait(0.4),moveby(1000,0),wait(0.2),moveby(1000,0),wait(0.2),moveby(1000,0),wait(0.2),moveby(1000,-3500),wait(1.8),keyup(E),wait(0.3),click(middle);",
"action_params": "keypress(f),wait(0.2),keypress(f),wait(0.2),keypress(f),s(0.15),keypress(f),attack(0.08),wait(0.3);万叶 attack(0.08),keydown(E),wait(0.51),keyup(E),attack(0.2),wait(0.5);琴 attack(0.08),keydown(E),wait(0.4),moveby(1000,0),wait(0.2),moveby(1000,0),wait(0.2),moveby(1000,0),wait(0.2),moveby(1000,-3500),wait(1.8),keyup(E),wait(0.3),click(middle);",
"type": "target"
},
{

View File

@@ -59,7 +59,7 @@
"y": -3646.544921875,
"action": "combat_script",
"move_mode": "dash",
"action_params": "keypress(f),wait(0.3),keypress(f),wait(0.3),keypress(f),keypress(f),wait(0.3),keypress(f),wait(0.3),keypress(f),wait(0.3),keypress(f),wait(0.3),keypress(f);万叶 attack(0.08),keydown(E),wait(0.51),keyup(E),attack(0.2),wait(0.5);琴 attack(0.08),keydown(E),wait(0.4),moveby(1000,0),wait(0.2),moveby(1000,0),wait(0.2),moveby(1000,0),wait(0.2),moveby(1000,-3500),wait(1.8),keyup(E),wait(0.3),click(middle);",
"action_params": "keypress(f),wait(0.3),keypress(f),wait(0.3),keypress(f),keypress(f),wait(0.3),keypress(f),wait(0.3),keypress(f),wait(0.3),keypress(f),wait(0.3),keypress(f),attack(0.08);万叶 attack(0.08),keydown(E),wait(0.51),keyup(E),attack(0.2),wait(0.5);琴 attack(0.08),keydown(E),wait(0.4),moveby(1000,0),wait(0.2),moveby(1000,0),wait(0.2),moveby(1000,0),wait(0.2),moveby(1000,-3500),wait(1.8),keyup(E),wait(0.3),click(middle);",
"type": "target"
},
{

View File

@@ -50,7 +50,7 @@
"y": -3544.4013671875,
"action": "combat_script",
"move_mode": "walk",
"action_params": "keypress(f),wait(0.2),keypress(f),wait(0.2),keypress(f),a(0.2);万叶 attack(0.08),keydown(E),wait(0.51),keyup(E),attack(0.2),wait(0.5);",
"action_params": "keypress(f),wait(0.2),keypress(f),wait(0.2),keypress(f),a(0.2);万叶 attack(0.08),keydown(E),wait(0.7),keyup(E),attack(0.2),wait(0.5);琴 attack(0.08),keydown(E),wait(0.4),moveby(1000,0),wait(0.2),moveby(1000,0),wait(0.2),moveby(1000,0),wait(0.2),moveby(1000,-3500),wait(1.8),keyup(E),wait(0.3),click(middle);",
"type": "target"
},
{
@@ -95,7 +95,7 @@
"y": -3571.280939261749,
"action": "combat_script",
"move_mode": "dash",
"action_params": "keypress(f),wait(0.2),keypress(f),wait(0.2),keypress(f),keypress(x);万叶 attack(0.08),keydown(E),wait(0.51),keyup(E),attack(0.2),wait(0.5);",
"action_params": "keypress(f),wait(0.2),keypress(f),wait(0.2),keypress(f),keypress(x);万叶 attack(0.08),keydown(E),wait(0.51),keyup(E),attack(0.2),wait(0.5);琴 attack(0.08),keydown(E),wait(0.4),moveby(1000,0),wait(0.2),moveby(1000,0),wait(0.2),moveby(1000,0),wait(0.2),moveby(1000,-3500),wait(1.8),keyup(E),wait(0.3),click(middle);",
"type": "target"
},
{
@@ -140,7 +140,7 @@
"y": -3477.156219684073,
"action": "combat_script",
"move_mode": "fly",
"action_params": "keypress(f),wait(0.2),keypress(f),wait(0.2),keypress(f),wait(0.2),keypress(f),wait(0.2),keypress(f);万叶 attack(0.08),keydown(E),wait(0.48),keyup(E),attack(0.2),wait(0.5);",
"action_params": "keypress(f),wait(0.2),keypress(f),wait(0.2),keypress(f),wait(0.2),keypress(f),wait(0.2),keypress(f)",
"type": "target"
},
{
@@ -150,7 +150,7 @@
"type": "path",
"move_mode": "walk",
"action": "combat_script",
"action_params": "keypress(f);万叶 attack(0.08),keydown(E),wait(0.7),keyup(E),attack(0.2),wait(0.5);"
"action_params": "keypress(f);万叶 attack(0.08),keydown(E),wait(0.7),keyup(E),attack(0.2),wait(0.5);琴 attack(0.08),keydown(E),wait(0.4),moveby(1000,0),wait(0.2),moveby(1000,0),wait(0.2),moveby(1000,0),wait(0.2),moveby(1000,-3500),wait(1.8),keyup(E),wait(0.3),click(middle);"
},
{
"id": 16,
@@ -230,7 +230,7 @@
"y": -3918.000037894908,
"action": "combat_script",
"move_mode": "walk",
"action_params": "keypress(f),wait(0.2),keypress(f),wait(0.2),keypress(f);万叶 attack(0.08),keydown(E),wait(0.7),keyup(E),attack(0.2),wait(0.5);",
"action_params": "keypress(f),wait(0.2),keypress(f),wait(0.2),keypress(f);万叶 attack(0.08),keydown(E),wait(0.7),keyup(E),attack(0.2),wait(0.5);琴 attack(0.08),keydown(E),wait(0.4),moveby(1000,0),wait(0.2),moveby(1000,0),wait(0.2),moveby(1000,0),wait(0.2),moveby(1000,-3500),wait(1.8),keyup(E),wait(0.3),click(middle);",
"type": "path"
},
{

View File

@@ -126,7 +126,7 @@
"y": -3732.4169921875,
"action": "combat_script",
"move_mode": "walk",
"action_params": "w(1),wait(1),keypress(f),wait(0.5),keypress(a),keypress(w),wait(6),keypress(f),wait(1.4),keypress(a),keypress(w),wait(6),keypress(f),wait(1.4),keypress(a),keypress(w),wait(6),keypress(f),wait(1.4),keypress(a),keypress(w),wait(3.2),keypress(f),wait(0.4),keypress(a),keypress(w),wait(3.2),keypress(f),wait(0.4),keypress(s),wait(0.5),keypress(ESCAPE),wait(1),s(0.2),dash,click,s(0.2),dash,click,s(0.2),dash,click,s(0.2),dash,click,s(0.2),dash,click",
"action_params": "w(1),wait(1),keypress(f),wait(0.5),keypress(f),wait(0.5),keypress(a),keypress(w),wait(6),keypress(f),wait(1.4),keypress(a),keypress(w),wait(6),keypress(f),wait(1.4),keypress(a),keypress(w),wait(6),keypress(f),wait(1.4),keypress(a),keypress(w),wait(3.2),keypress(f),wait(0.4),keypress(a),keypress(w),wait(3.2),keypress(f),wait(0.4),keypress(s),wait(0.5),keypress(ESCAPE),wait(1),s(0.2),dash,click,s(0.2),dash,click,s(0.2),dash,click,s(0.2),dash,click,s(0.2),dash,click",
"type": "orientation"
}
]

View File

@@ -1,7 +1,7 @@
{
"manifest_version": 1,
"name": "自动狗粮重制版",
"version": "1.6.7",
"version": "1.6.8",
"tags": [
"好感",
"狗粮"

View File

@@ -110,7 +110,9 @@ const removedCharacters4 = typeof (settings.removedCharacters4) === 'undefined'
let resList = captureRegion.findMulti(RecognitionObject.ocr(100, 900, 300, 180));
for (let i = 0; i < resList.count; i++) {
let res = resList[i];
if (settings.enableDebug) {
log.info("当前队伍名称位置:({x},{y},{w},{h}), 识别结果:{text}", res.x, res.y, res.Width, res.Height, res.text);
}
if (res.text.includes(partyName)) {
log.info("当前队伍即为目标队伍,无需切换");
keyPress("VK_ESCAPE");
@@ -134,20 +136,26 @@ const removedCharacters4 = typeof (settings.removedCharacters4) === 'undefined'
log.info("文本位置:({x},{y},{w},{h}), 识别内容:{text}", res.x, res.y, res.Width, res.Height, res.text);
}
if (res.text.includes(partyName)) {
if (settings.enableDebug) {
log.info("目标队伍位置:({x},{y},{w},{h}), 识别结果:{text}", res.x, res.y, res.Width, res.Height, res.text);
}
click(res.x, Math.ceil(res.y + res.Height * 1.35));
// 找到目标队伍,点击确定、部署
await sleep(1500);
let ConfirmButton = captureGameRegion().find(ConfirmDeployButtonRo);
if (ConfirmButton.isExist()) {
if (settings.enableDebug) {
log.info("识别到确定按钮:({x},{y},{w},{h})", ConfirmButton.x, ConfirmButton.y, ConfirmButton.Width, ConfirmButton.Height);
}
ConfirmButton.click();
}
await sleep(1500);
let DeployButton = captureGameRegion().find(ConfirmDeployButtonRo);
if (DeployButton.isExist()) {
if (settings.enableDebug) {
log.info("识别到部署按钮:({x},{y},{w},{h})", DeployButton.x, DeployButton.y, DeployButton.Width, DeployButton.Height);
}
DeployButton.click();
ConfigureStatue = true;
break;
@@ -196,7 +204,9 @@ const removedCharacters4 = typeof (settings.removedCharacters4) === 'undefined'
for (let i = 0; i < resList.count; i++) {
let res = resList[i];
if (res.text.includes(settings.appointFriendName)) {
if (settings.enableDebug) {
log.info("指定好友名字位置:({x},{y},{w},{h}), 识别内容:{text}", res.x, res.y, res.Width, res.Height, res.text);
}
click(res.x - 100, res.y + 50);
await sleep(1000);
@@ -206,7 +216,9 @@ const removedCharacters4 = typeof (settings.removedCharacters4) === 'undefined'
for (let i = 0; i < resList.count; i++) {
let res = resList[i];
if (res.text.includes("申请造访") || res.text.includes("visit Serenitea Pot") || res.text.includes("申請造訪")) {
if (settings.enableDebug) {
log.info("申请造访尘歌壶位置:({x},{y},{w},{h}), 识别内容:{text}", res.x, res.y, res.Width, res.Height, res.text);
}
res.click();
}
}
@@ -351,7 +363,9 @@ const removedCharacters4 = typeof (settings.removedCharacters4) === 'undefined'
for (let i = 0; i < resList.count; i++) {
let res = resList[i];
if (res.text.includes("委托") || res.text.includes("委託") || res.text.includes("Commissions") || res.text.includes("委")) {
if (settings.enableDebug) {
log.info("识别到委托选项卡位置:({x},{y},{w},{h}), 识别内容:{text}", res.x, res.y, res.Width, res.Height, res.text);
}
res.click();
} else {
log.info("未识别到识别到委托选项卡");
@@ -475,7 +489,9 @@ const removedCharacters4 = typeof (settings.removedCharacters4) === 'undefined'
let SliderBottom = captureGameRegion().find(SliderBottomRo);
if (SliderBottom.isExist()) {
log.info("当前页面已点击完毕,向下滑动");
if (settings.enableDebug) {
log.info("滑块当前位置:({x},{y},{h},{w})", SliderBottom.x, SliderBottom.y, SliderBottom.Width, SliderBottom.Height);
}
click(Math.ceil(SliderBottom.x + SliderBottom.Width / 2), Math.ceil(SliderBottom.y + SliderBottom.Height * 3.5));
await moveMouseTo(0, 0);
await sleep(100);
@@ -486,7 +502,9 @@ const removedCharacters4 = typeof (settings.removedCharacters4) === 'undefined'
async function pageTop(SliderTopRo) {
let SliderTop = captureGameRegion().find(SliderTopRo);
if (SliderTop.isExist()) {
if (settings.enableDebug) {
log.info("滑条顶端位置:({x},{y},{h},{w})", SliderTop.x, SliderTop.y, SliderTop.Width, SliderTop.Height);
}
await moveMouseTo(Math.ceil(SliderTop.x + SliderTop.Width / 2), Math.ceil(SliderTop.y + SliderTop.Height * 1.5));
leftButtonDown();
await sleep(500);