Compare commits
6 Commits
409083bf74
...
f26d7f1526
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f26d7f1526 | ||
|
|
b118297cde | ||
|
|
e9db2bae73 | ||
|
|
2293b5ab56 | ||
|
|
ce220c5d83 | ||
|
|
c959f34248 |
25
repo.json
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"time": "20250723111305",
|
"time": "20250723234518",
|
||||||
"url": "https://github.com/babalae/bettergi-scripts-list/archive/refs/heads/main.zip",
|
"url": "https://github.com/babalae/bettergi-scripts-list/archive/refs/heads/main.zip",
|
||||||
"file": "repo.json",
|
"file": "repo.json",
|
||||||
"indexes": [
|
"indexes": [
|
||||||
@@ -70139,6 +70139,23 @@
|
|||||||
"name": "js",
|
"name": "js",
|
||||||
"type": "directory",
|
"type": "directory",
|
||||||
"children": [
|
"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",
|
"name": "AEscoffier_chef",
|
||||||
"type": "directory",
|
"type": "directory",
|
||||||
@@ -70238,8 +70255,8 @@
|
|||||||
{
|
{
|
||||||
"name": "AutoArtifactsPro",
|
"name": "AutoArtifactsPro",
|
||||||
"type": "directory",
|
"type": "directory",
|
||||||
"hash": "22e55eb4a3bbb2f5d512b9b7a1f3895594538998",
|
"hash": "5a1d527abc0fb0cb14099cf8ef9ba6b8dffd8b99",
|
||||||
"version": "1.6.7",
|
"version": "1.6.8",
|
||||||
"author": "mno",
|
"author": "mno",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
@@ -70260,7 +70277,7 @@
|
|||||||
"好感",
|
"好感",
|
||||||
"狗粮"
|
"狗粮"
|
||||||
],
|
],
|
||||||
"lastUpdated": "2025-07-22 22:50:43"
|
"lastUpdated": "2025-07-23 23:44:55"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "AutoArtifactsSalvageOrDestroy(1-4star)",
|
"name": "AutoArtifactsSalvageOrDestroy(1-4star)",
|
||||||
|
|||||||
BIN
repo/js/5_7PVP_Auto/assets/buff.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
repo/js/5_7PVP_Auto/assets/button1.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
repo/js/5_7PVP_Auto/assets/button2.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
repo/js/5_7PVP_Auto/assets/button3.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
repo/js/5_7PVP_Auto/assets/finish1.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
repo/js/5_7PVP_Auto/assets/finish2.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
repo/js/5_7PVP_Auto/assets/goal.png
Normal file
|
After Width: | Height: | Size: 876 B |
103
repo/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
repo/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
repo/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
repo/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"
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -171,6 +171,10 @@ https://www.kdocs.cn/wo/sl/v13uXscL
|
|||||||
|
|
||||||
|
|
||||||
## 更新日志
|
## 更新日志
|
||||||
|
|
||||||
|
### 1.6.8(2025.07.23)
|
||||||
|
1.炮台偶尔出现"当前状态无法使用",多按一次"F"尝试优化
|
||||||
|
2.428花海偶尔被木箱卡死,改变角度
|
||||||
### 1.6.7(2025.07.22)
|
### 1.6.7(2025.07.22)
|
||||||
1.让狗粮结束后[芙宁娜]变回黑芙,不影响后续战斗
|
1.让狗粮结束后[芙宁娜]变回黑芙,不影响后续战斗
|
||||||
### 1.6.6(2025.07.22)
|
### 1.6.6(2025.07.22)
|
||||||
|
|||||||
@@ -140,7 +140,7 @@
|
|||||||
"y": -3681.7453963194985,
|
"y": -3681.7453963194985,
|
||||||
"action": "combat_script",
|
"action": "combat_script",
|
||||||
"move_mode": "walk",
|
"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"
|
"type": "orientation"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
"map_name": "Teyvat",
|
"map_name": "Teyvat",
|
||||||
"bgi_version": "0.45.0",
|
"bgi_version": "0.45.0",
|
||||||
"tags": [],
|
"tags": [],
|
||||||
"last_modified_time": 1752679153967,
|
"last_modified_time": 1753284910049,
|
||||||
"enable_monster_loot_split": false
|
"enable_monster_loot_split": false
|
||||||
},
|
},
|
||||||
"positions": [
|
"positions": [
|
||||||
@@ -82,8 +82,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 8,
|
"id": 8,
|
||||||
"x": 5593.375055301161,
|
"x": 5594.205078125,
|
||||||
"y": 827.406174210183,
|
"y": 826.916015625,
|
||||||
"action": "",
|
"action": "",
|
||||||
"move_mode": "run",
|
"move_mode": "run",
|
||||||
"action_params": "",
|
"action_params": "",
|
||||||
@@ -91,11 +91,11 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 9,
|
"id": 9,
|
||||||
"x": 5590.968783575705,
|
"x": 5591.455078125,
|
||||||
"y": 825.5312196840732,
|
"y": 825.72900390625,
|
||||||
"action": "combat_script",
|
"action": "combat_script",
|
||||||
"move_mode": "climb",
|
"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"
|
"type": "target"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
"y": -3646.544921875,
|
"y": -3646.544921875,
|
||||||
"action": "combat_script",
|
"action": "combat_script",
|
||||||
"move_mode": "dash",
|
"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"
|
"type": "target"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
"y": -3544.4013671875,
|
"y": -3544.4013671875,
|
||||||
"action": "combat_script",
|
"action": "combat_script",
|
||||||
"move_mode": "walk",
|
"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"
|
"type": "target"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -95,7 +95,7 @@
|
|||||||
"y": -3571.280939261749,
|
"y": -3571.280939261749,
|
||||||
"action": "combat_script",
|
"action": "combat_script",
|
||||||
"move_mode": "dash",
|
"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"
|
"type": "target"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -140,7 +140,7 @@
|
|||||||
"y": -3477.156219684073,
|
"y": -3477.156219684073,
|
||||||
"action": "combat_script",
|
"action": "combat_script",
|
||||||
"move_mode": "fly",
|
"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"
|
"type": "target"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -150,7 +150,7 @@
|
|||||||
"type": "path",
|
"type": "path",
|
||||||
"move_mode": "walk",
|
"move_mode": "walk",
|
||||||
"action": "combat_script",
|
"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,
|
"id": 16,
|
||||||
@@ -230,7 +230,7 @@
|
|||||||
"y": -3918.000037894908,
|
"y": -3918.000037894908,
|
||||||
"action": "combat_script",
|
"action": "combat_script",
|
||||||
"move_mode": "walk",
|
"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"
|
"type": "path"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -126,7 +126,7 @@
|
|||||||
"y": -3732.4169921875,
|
"y": -3732.4169921875,
|
||||||
"action": "combat_script",
|
"action": "combat_script",
|
||||||
"move_mode": "walk",
|
"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"
|
"type": "orientation"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 1,
|
"manifest_version": 1,
|
||||||
"name": "自动狗粮重制版",
|
"name": "自动狗粮重制版",
|
||||||
"version": "1.6.7",
|
"version": "1.6.8",
|
||||||
"tags": [
|
"tags": [
|
||||||
"好感",
|
"好感",
|
||||||
"狗粮"
|
"狗粮"
|
||||||
|
|||||||
@@ -110,7 +110,9 @@ const removedCharacters4 = typeof (settings.removedCharacters4) === 'undefined'
|
|||||||
let resList = captureRegion.findMulti(RecognitionObject.ocr(100, 900, 300, 180));
|
let resList = captureRegion.findMulti(RecognitionObject.ocr(100, 900, 300, 180));
|
||||||
for (let i = 0; i < resList.count; i++) {
|
for (let i = 0; i < resList.count; i++) {
|
||||||
let res = resList[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);
|
log.info("当前队伍名称位置:({x},{y},{w},{h}), 识别结果:{text}", res.x, res.y, res.Width, res.Height, res.text);
|
||||||
|
}
|
||||||
if (res.text.includes(partyName)) {
|
if (res.text.includes(partyName)) {
|
||||||
log.info("当前队伍即为目标队伍,无需切换");
|
log.info("当前队伍即为目标队伍,无需切换");
|
||||||
keyPress("VK_ESCAPE");
|
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);
|
log.info("文本位置:({x},{y},{w},{h}), 识别内容:{text}", res.x, res.y, res.Width, res.Height, res.text);
|
||||||
}
|
}
|
||||||
if (res.text.includes(partyName)) {
|
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);
|
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));
|
click(res.x, Math.ceil(res.y + res.Height * 1.35));
|
||||||
|
|
||||||
// 找到目标队伍,点击确定、部署
|
// 找到目标队伍,点击确定、部署
|
||||||
await sleep(1500);
|
await sleep(1500);
|
||||||
let ConfirmButton = captureGameRegion().find(ConfirmDeployButtonRo);
|
let ConfirmButton = captureGameRegion().find(ConfirmDeployButtonRo);
|
||||||
if (ConfirmButton.isExist()) {
|
if (ConfirmButton.isExist()) {
|
||||||
|
if (settings.enableDebug) {
|
||||||
log.info("识别到确定按钮:({x},{y},{w},{h})", ConfirmButton.x, ConfirmButton.y, ConfirmButton.Width, ConfirmButton.Height);
|
log.info("识别到确定按钮:({x},{y},{w},{h})", ConfirmButton.x, ConfirmButton.y, ConfirmButton.Width, ConfirmButton.Height);
|
||||||
|
}
|
||||||
ConfirmButton.click();
|
ConfirmButton.click();
|
||||||
}
|
}
|
||||||
await sleep(1500);
|
await sleep(1500);
|
||||||
let DeployButton = captureGameRegion().find(ConfirmDeployButtonRo);
|
let DeployButton = captureGameRegion().find(ConfirmDeployButtonRo);
|
||||||
if (DeployButton.isExist()) {
|
if (DeployButton.isExist()) {
|
||||||
|
if (settings.enableDebug) {
|
||||||
log.info("识别到部署按钮:({x},{y},{w},{h})", DeployButton.x, DeployButton.y, DeployButton.Width, DeployButton.Height);
|
log.info("识别到部署按钮:({x},{y},{w},{h})", DeployButton.x, DeployButton.y, DeployButton.Width, DeployButton.Height);
|
||||||
|
}
|
||||||
DeployButton.click();
|
DeployButton.click();
|
||||||
ConfigureStatue = true;
|
ConfigureStatue = true;
|
||||||
break;
|
break;
|
||||||
@@ -196,7 +204,9 @@ const removedCharacters4 = typeof (settings.removedCharacters4) === 'undefined'
|
|||||||
for (let i = 0; i < resList.count; i++) {
|
for (let i = 0; i < resList.count; i++) {
|
||||||
let res = resList[i];
|
let res = resList[i];
|
||||||
if (res.text.includes(settings.appointFriendName)) {
|
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);
|
log.info("指定好友名字位置:({x},{y},{w},{h}), 识别内容:{text}", res.x, res.y, res.Width, res.Height, res.text);
|
||||||
|
}
|
||||||
click(res.x - 100, res.y + 50);
|
click(res.x - 100, res.y + 50);
|
||||||
await sleep(1000);
|
await sleep(1000);
|
||||||
|
|
||||||
@@ -206,7 +216,9 @@ const removedCharacters4 = typeof (settings.removedCharacters4) === 'undefined'
|
|||||||
for (let i = 0; i < resList.count; i++) {
|
for (let i = 0; i < resList.count; i++) {
|
||||||
let res = resList[i];
|
let res = resList[i];
|
||||||
if (res.text.includes("申请造访") || res.text.includes("visit Serenitea Pot") || res.text.includes("申請造訪")) {
|
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);
|
log.info("申请造访尘歌壶位置:({x},{y},{w},{h}), 识别内容:{text}", res.x, res.y, res.Width, res.Height, res.text);
|
||||||
|
}
|
||||||
res.click();
|
res.click();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -351,7 +363,9 @@ const removedCharacters4 = typeof (settings.removedCharacters4) === 'undefined'
|
|||||||
for (let i = 0; i < resList.count; i++) {
|
for (let i = 0; i < resList.count; i++) {
|
||||||
let res = resList[i];
|
let res = resList[i];
|
||||||
if (res.text.includes("委托") || res.text.includes("委託") || res.text.includes("Commissions") || res.text.includes("委")) {
|
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);
|
log.info("识别到委托选项卡位置:({x},{y},{w},{h}), 识别内容:{text}", res.x, res.y, res.Width, res.Height, res.text);
|
||||||
|
}
|
||||||
res.click();
|
res.click();
|
||||||
} else {
|
} else {
|
||||||
log.info("未识别到识别到委托选项卡");
|
log.info("未识别到识别到委托选项卡");
|
||||||
@@ -475,7 +489,9 @@ const removedCharacters4 = typeof (settings.removedCharacters4) === 'undefined'
|
|||||||
let SliderBottom = captureGameRegion().find(SliderBottomRo);
|
let SliderBottom = captureGameRegion().find(SliderBottomRo);
|
||||||
if (SliderBottom.isExist()) {
|
if (SliderBottom.isExist()) {
|
||||||
log.info("当前页面已点击完毕,向下滑动");
|
log.info("当前页面已点击完毕,向下滑动");
|
||||||
|
if (settings.enableDebug) {
|
||||||
log.info("滑块当前位置:({x},{y},{h},{w})", SliderBottom.x, SliderBottom.y, SliderBottom.Width, SliderBottom.Height);
|
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));
|
click(Math.ceil(SliderBottom.x + SliderBottom.Width / 2), Math.ceil(SliderBottom.y + SliderBottom.Height * 3.5));
|
||||||
await moveMouseTo(0, 0);
|
await moveMouseTo(0, 0);
|
||||||
await sleep(100);
|
await sleep(100);
|
||||||
@@ -486,7 +502,9 @@ const removedCharacters4 = typeof (settings.removedCharacters4) === 'undefined'
|
|||||||
async function pageTop(SliderTopRo) {
|
async function pageTop(SliderTopRo) {
|
||||||
let SliderTop = captureGameRegion().find(SliderTopRo);
|
let SliderTop = captureGameRegion().find(SliderTopRo);
|
||||||
if (SliderTop.isExist()) {
|
if (SliderTop.isExist()) {
|
||||||
|
if (settings.enableDebug) {
|
||||||
log.info("滑条顶端位置:({x},{y},{h},{w})", SliderTop.x, SliderTop.y, SliderTop.Width, SliderTop.Height);
|
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));
|
await moveMouseTo(Math.ceil(SliderTop.x + SliderTop.Width / 2), Math.ceil(SliderTop.y + SliderTop.Height * 1.5));
|
||||||
leftButtonDown();
|
leftButtonDown();
|
||||||
await sleep(500);
|
await sleep(500);
|
||||||
|
|||||||