diff --git a/repo.json b/repo.json index 4afc5f7e..57a24e57 100644 --- a/repo.json +++ b/repo.json @@ -1,5 +1,5 @@ { - "time": "20250406221610", + "time": "20250406222259", "url": "https://github.com/babalae/bettergi-scripts-list/archive/refs/heads/main.zip", "file": "repo.json", "indexes": [ @@ -32330,6 +32330,15 @@ "description": "购买食材杂货~|~寻路杂货商,枫丹有咖啡豆、秃秃豆,璃月有豆腐、杏仁,稻妻有豆腐,顺路有点鱼蟹,这几个路线短快。用法:放入BetterGI中User中JsScript文件夹内。已屏蔽纳塔杂货商,解开选项即恢复。在纳塔杂货商购买时,移动速度不宜过快;在纳塔杂货商购买时,如撞到npc将无法正常寻路。", "tags": [] }, + { + "name": "自动领取成就奖励(OCR)", + "type": "directory", + "hash": "fea6e1a58fffcd6e9468bcf94a72e8385491fad9", + "version": "1.0", + "author": "柒叶子", + "description": "自动领取成就奖励~|~所以米桑什么时候实装一键领取?", + "tags": [] + }, { "name": "芙芙挂机暗杀流", "type": "directory", diff --git a/repo/js/自动领取成就奖励(OCR)/assets/receive.png b/repo/js/自动领取成就奖励(OCR)/assets/receive.png new file mode 100644 index 00000000..a119e75e Binary files /dev/null and b/repo/js/自动领取成就奖励(OCR)/assets/receive.png differ diff --git a/repo/js/自动领取成就奖励(OCR)/main.js b/repo/js/自动领取成就奖励(OCR)/main.js new file mode 100644 index 00000000..67c8c757 --- /dev/null +++ b/repo/js/自动领取成就奖励(OCR)/main.js @@ -0,0 +1,70 @@ +const receiveRo = RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/receive.png")); + +(async function () { + +const topLeft = {x: 192, y: 281}; // 左上角坐标 +const bottomRight = {x: 1738, y: 984}; // 右下角坐标 +const rows = 3; // 行数 +const cols = 7; // 列数 +const topLeft1 = {x: 190, y: 870}; // 左上角坐标 +const bottomRight1 = {x: 1735, y: 870}; // 右下角坐标 +const rows1 = 1; // 行数 +const cols1 = 7; // 列数 +let sum = 1; +let sum1= 0; +//用于点击多个点位 +async function autoClick( + topLeft, // 左上角点位 {x, y} + bottomRight, // 右下角点位 {x, y} + rows, // 行数 + cols // 列数 +) { + // 计算每个点之间的水平和垂直间距 + let stepX = cols > 1 ? (bottomRight.x - topLeft.x) / (cols - 1) : 0; // 处理单列情况 + let stepY = rows > 1 ? (bottomRight.y - topLeft.y) / (rows - 1) : 0; // 处理单行情况 + // 从左到右,从上到下依次点击 + for (let row = 0; row < rows; row++) { + for (let col = 0; col < cols; col++) { + // 计算当前点的坐标并四舍五入 + let x = Math.round(topLeft.x + col * stepX); + let y = Math.round(topLeft.y + row * stepY); + // 执行点击 + click(x, y); + await sleep(1000); + log.info(`第${sum}次识别`); + sum++; + let receive = captureGameRegion().find(receiveRo); + await sleep(1000); + while(receive.isExist()){ + receive.click(); + await sleep(500); + sum1++; + log.info(`成功识别${sum1}次`); + + click(400,1010);//点击空白处 + await sleep(500); + receive = captureGameRegion().find(receiveRo); + } + + click(400,1010);//如果是本行最后一个成就会自动翻页 + await sleep(500); + keyPress("ESCAPE"); + // 等待1秒 + await sleep(1000); + } + } +} + +//主流程 +await genshin.returnMainUi(); +await sleep(1000); +keyPress("ESCAPE"); +await sleep(1000); +click(670 ,420 );//点击成就 +await sleep(2000); +await autoClick(topLeft, bottomRight, rows, cols); +for (let i = 0; i < 6; i++) { +await autoClick(topLeft1, bottomRight1, rows1, cols1); +} + +})(); diff --git a/repo/js/自动领取成就奖励(OCR)/manifest.json b/repo/js/自动领取成就奖励(OCR)/manifest.json new file mode 100644 index 00000000..aa36c3bd --- /dev/null +++ b/repo/js/自动领取成就奖励(OCR)/manifest.json @@ -0,0 +1,14 @@ +{ + "manifest_version": 1, + "name": "自动领取成就奖励", + "version": "1.0", + "description": "所以米桑什么时候实装一键领取?", + "authors": [ + { + "name": "柒叶子", + "link": "https://github.com/511760049" + } + ], + "settings_ui": "settings.json", + "main": "main.js" +}